Register Login

Interactive Reports

Updated May 18, 2018

What are Interactive Reports?

As the name suggests, the user can Interact with the report. We can have a drill down into the report data. For example, Column one of the report displays the material numbers, and the user feels that he needs some more specific data about the vendor for that material, he can HIDE that data under those material numbers. And when the user clicks the material number, another report (actually sub report/secondary list) which displays the vendor details will be displayed.

Interactive reporting allows the user to participate actively in retrieving and presenting data during the session.

Instead of one extensive and detailed list, with interactive reporting, you create a condensed basic list from which the user can call detailed information by positioning the cursor and entering commands.

HIDE:HIDE <f>.

Stores the contents of variable <f> in relation to the current output line (system field SY-LINNO) internally in the so-called HIDE area. <f> must not necessarily appear on the current line.

READ LINE:

The system internally stores all lists created in succession by one report program. Therefore, you can access any list from within the program that was created during the current dialog session and has not been deleted by returning to a previous list level.
READ LINE <n> [INDEX <index>]

[FIELD VALUE <f1> [INTO <g1>] ... <fn> [INTO <gn>]]
[OF CURRENT PAGE|OF PAGE <n>].

READ CURRENT LINE

[FIELD VALUE <f1> [INTO <g1>] ... <fn> [INTO <gn>]]

Stores the contents of line from the list on which the event was triggered (list index SY-LISTI, line number SY-LILLI) in the SY-LISEL system field and fills all HIDE information stored for this line back into the corresponding fields.

SY-SUBRC = 0 : Ok; = 4 : line does not exist.

FIELD VALUE uses Conversion Rules Fields that do not appear in a line, do not affect the target field. If a field appears several times in a line, the system uses only the first one.

MODIFY LINE:

MODIFY {LINE <n> | LINE <n> OF CURRENT PAGE | LINE <n> OF PAGE <page> | CURRENT LINE}
[INDEX <index>] - index=SY-LSIND, applied only for LINE <n>
[LINE FORMAT <fmt1> ... <fmtn>] - applied for whole line
[FIELD FORMAT <f1> <fmt11> ... <fmt1m> [... <fn> <fmtn1> ... <fmtnm>]]
[LINE VALUE FROM <wa>]
[FIELD VALUE <f1> [FROM <g1>] [... <fn> [FROM <gn>]]. - <f1> means <f1> FROM <f1>

Changes the line of the list taking values from SY-LISEL (or from the <wa> or <gn>). Usually after List Events: AT LINE-SELECTION, AT PFxx, AT USER-COMMAND, where the SY-LISEL is filled. Fills HIDE information.
SY-SUBRC = 0 : Ok; <> 0 : line was not changed.

SY-LISEL is filled. Fills HIDE information.
SY-SUBRC = 0 : Ok; <> 0 : line was not changed.

GET CURSOR:

GET CURSOR FIELD <f> [OFFSET <o>] [LINE <n>] [VALUE <val>] [LENGTH <l>].

Transfers the name of the field on which the cursor is positioned during a user action into the variable <f>. If the cursor is on a field, the SY-SUBRC is 0, otherwise 4. The system transports the names of global variables, constants, field symbols, or reference parameters of subroutines. For literals, local fields, and VALUE parameters of subroutines, the system sets SY-SUBRC to 0, but transfers SPACE as the name.

GET CURSOR LINE <n> [OFFSET <o>] [VALUE <val>] [LENGTH <l>].

Transfers the number of the line on which the cursor is positioned during a user action into the variable <n>. If the cursor is on a list line, the SY-SUBRC is 0, otherwise 4.

  • <o> contains the position of the cursor within the field. If the cursor is on the first column, <o> = 0;
  • <n> contains the number of the list line on which the cursor is positioned (SY-LILLI);
  • <val> contains the character string output representation of the field|line on which the cursor is positioned. The representation includes formatting characters;
  • <l> contains the output length of the field on which the cursor is positioned.

SET CURSOR:

SET CURSOR FIELD <f> [OFFSET <o>] [LINE <n>].

Set cursor at begin of field <f> (should be in uppercase), or at column <o> (begin is ). In step loop or in list processing (if the field is displayed on several lines) <n> is needed. In list processing <n> means SY-LILLI.

SET CURSOR LINE <n> [OFFSET <o>].

In list processing <n> means SY-LILLI.

SET CURSOR <column> <line>.

<column> and <line> are absolute position on the current screen.

Event Control for Interactive Lists:

AT LINE-SELECTION occurs after the user double-clicks on a line, clicks once on a hotspot, or chooses Edit-Choose;

AT PF<nn> occurs after the user presses the corresponding function key. Predefined system functions have higher priority than self-defined events. The system does not trigger an event AT PF<nn> for keys whose function code is predefined:

Help

F1

Choose

F2

Back

F3

Possible Entries

F4

Cancel

F12

First Page

F21

Previous Page

F22

Next Page

F23

Last Page

F24

Recommended use AT PF for testing purposes only. In final version use AT USER-COMMAND together with self-defined interfaces.

AT USER-COMMAND occurs after the user chooses a self-defined action. SY-UCOMM contains chosen function code.

SET USER-COMMAND <command> triggers event from within the program. Takes effect after the current list is completed. Before the system displays the list, it triggers the event that corresponds to the function code stored in <command>, independent of the applied user interface.

<command>

Event

self-defined function code

AT USER-COMAND

'PICK'

AT LINE-SELECTION

'PF<nn>'

AT PF<nn>

Predefined Function Code

not event, but direct action

SET PF-STATUS

SET PF-STATUS <status> [EXCLUDING <function>|<itab>] [IMMEDIATELY].

Sets user-defined <status> for all subsequent list levels until you set another status. SY-PFKEY - status of the current list. <status> is SPACE to set system status. <function>, type C(4), (or list of functions in the <itab>) - function code(s) to be deactivated in the <status>. IMMEDIATELY changes the status of the currently displayed list (SY-LISTI) within the processing block of the interactive event. Without this option, the system changes the status of the current secondary list (SY-LSIND) that is displayed only at the end of the processing block.

Messages in Lists:

Messages are stored and maintained in the T100 "Messages" table by

1.Language key - type C(1);
2.Application area (or message Id) - type C(2);
3.Message number - type C(3).

REPORT <report> MESSAGE-ID <id>.

Specifies <id> for use in <report> statically.

  • MESSAGE <type><number>[(<id>)] [WITH <f1>...<f4>] [RAISING <exception>].
  • MESSAGE ID <fid> TYPE <ftype> NUMBER <fnumber> [WITH <f1>...<f4>] [RAISING <exception>].

Specifies message dynamically (2nd statement - at runtime: <fid>, <ftype>, <fnumber> - variables). <f1>...<f4> replace placeholders in the message text: the '&' - one after the other; the '&i' - according to the number. Use '&&' to display the '&' symbol in the message. Up to 4 placeholders are allowed, each can place up to 50 characters.

RAISING is allowed only for a function module.

When executing the statement, the following system variables are set: SY-MSGID - message ID; SY-MSGTY - message type; SY-MSGNO - message number.

Message Type:

Type

Display

Action

I - Info

Dialog window

'Press Enter to continue'.

W - Warning

Status window

'Correction possible'.
= E for Lists Processing

E - Error

Status window

'Correction required'.
= A for Processing of basic list,
returns to the previous list level for a secondary list.

A - Abend

Dialog window

'Transaction terminated'.

X - eXit

Status window

= A, but transaction terminated with short dump
MESSAGE_TYPE_X

S - Success

Status window

'Message on next screen'.

Predefined System Codes

Predefined and assigned to the different elements of the status

Code

Menu

Function Key

Description

%PC

List

Shift-F8

Write list to file

PRI

List

Ctrl-P

Print displayed list

%EX

List

Shift-F3

Exit processing

PICK

Edit

F2

Event AT LINE-SELECTION

RW

Edit

F12, Esc

Cancel processing

%SC

Edit

Ctrl-F

Search pattern

%SC+

Edit

Ctrl-G

Continue search

BACK

Goto

F3

Back one level

P--

 

F21

Scroll to first window page

P-

 

F22

Scroll to previous window page

P+

 

F23

Scroll to next window page

P++

 

F24

Scroll to last window page

 

 

F10

Places the cursor into the menu bar to select a menu function

Predefined, but not set as status functions. Can be assigned to any empty status element.

Code

Description

PF<nn>

Event AT PF<nn>

PP<n>

Scroll to top of list page <n>

PP-[<n>]

Scroll backward 1 or <n> pages

PP+[<n>]

Scroll forward 1 or <n> pages

PS<n>

Scroll to column <n>

PS--

Scroll to first column of the list

PS-[<n>]

Scroll left by 1 or <n> columns

PS+[<n>]

Scroll right by 1 or <n> columns

PS++

Scroll to last column of the list

PZ<n>

Scroll to line <n>

PL-[<n>]

Scroll backward to first line of the page or by <n> lines

PL+[<n>]

Scroll forward to last line of the page or by <n> lines

/....

For other system commands

Tips and Tricks:

  • Any other (own or predefined) function code cannot be assigned to F10;
  • Replace function code PICK with your own function code to prevent the AT LINE-SELECTION event from being triggered in the report. You can then program all reactions to user actions in a single processing block (AT USER-COMMAND).
  • Delete predefined function codes whose functionality you do not want to support. For example, you may not want the user to print a list directly or to save a list in a file on the presentation server.
  • Modify the standard key settings. For example, you can assign your own function code to F3 to navigate within the lists according to your requirements, instead of returning one list level (Back). This may be important if you keep several lists on the same logical level and therefore do not want to delete the displayed list as would the standard F3 setting. Or you may want to display a warning before leaving a list level

 


Comments

  • 28 Jul 2017 1:54 pm Jyoti Pandey Helpful Answer

    We can have a basic list (number starts from 0) and 20 secondary lists (1 to 21). Events associated with Interactive Reports are:

    • AT LINE-SELECTION
    • AT USER-COMMAND
    • AT PF
    • TOP-OF-PAGE DURING LINE-SELECTION.

    HIDE statement holds the data to be displayed in the secondary list. sy-lisel: contains data of the selected line. sy-lsind: contains the level of the report (from 0 to 21)

    Interactive Report Events:

    AT LINE-SELECTION: This Event triggers when we double click a line on the list when the event is triggered a new sublist is going to be generated. Under this event what ever the statements that are been return will be displayed on newly generated sublist.

    AT PFn: For predefined function keys.

    AT USER-COMMAND: It provides user functions keys.

  • 18 Jan 2012 11:41 am rekha
    When a user sees a report he may want to have some detail information on a particular record. When click on that record he has been taken to detail info about that record screen. This process of interactive information on the record is called interactive reporting. We can have 0 – 21 i.e. 22 levels of screens.
  • 13 Feb 2012 9:30 am hari
    what is the standard program for sales order history detials in alv or in reports

×