Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Interactive Reports

Former Member
0 Likes
4,920

Hi,

Can anyone tell me what is interactive report?

How many lists are possible in interactive report.

If we r in 5th list and want to jump directly to 2nd list then how can we do this?

Please reply.

Thanks in advance.

Regards,

Deepak.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,163

Interactive reports are those,where from a report program you can call a transaction or a module pool program screen. the event for interactive reports are:

AT LINE-SELECTION, AT-USER-COMMAND,AT PFn etc

AT LINE-SELECTION event

Double clicking is the way most users navigate through programs. Double clicking on basic list or any secondary list triggers the event AT LINE-SELECTION. SY-LSIND denotes the index of the list currently created.

AT USER-COMMAND

When the user selects the menu item or presses any function key, the event that is triggered is AT USER-COMMAND, and can be handled in the program by writing code for the same. The system variable SY-UCOMM stores the function code for the clicked menu item or for the function key and the same can be checked in the program.

to make a report intercative make a hotspot on for one field in our report by adding HOTSPOT ON to that field in END-OF-SELECTION-EVENT

also do coding in say AT_LINE_SELECTION event

HIDE ernam.

((HIDE technique

In this case thins are much simpler. Consider the case, wherein you display fields from table sflight in basic list. When user double clicks on any sflight-carrid, you are displaying the detailed information related to that particular carrid on secondary list. Hence there is a need to store the clicked carrid in some variable. So that you can access this carrid for next list. ABAP/4 has facility; a statement called HIDE, which provides the above functionality.

HIDE command temporarily stores the content of clicked field in system area.))

SET PARAMETER ID 'FIELD' ERNAM.(when you are calling module pool screen with the help of report do this and in module pool program PBO use GET PARAMETER)

where ernam is the field fr which hotspot has been activated.the contents of ernam field will be stored in SAP memory now in end of selection event write:

CALL TRANSACTION <transaction name>.

by doin this when user clicks on ernam field control will be passed to the transaction and the screen for that transaction or module pool screen will be opened.

If we r in 5th list and want to jump directly to 2nd list How?

The system variable sy-lsind will hold the current list index.

at line-selection.

If sy-lsind = 2.

if sy-ucomm = 'LI10'.

sy-lsind = 10.

endif.

endif.

Edited by: Richa Khosla on Mar 25, 2008 8:01 AM

Edited by: Richa Khosla on Mar 28, 2008 5:38 AM

Edited by: Richa Khosla on Mar 28, 2008 5:43 AM

6 REPLIES 6
Read only

Former Member
0 Likes
2,163

21 lists are possible totally

u can jump to desired list by setting value of sy-lsind which is level value.

plz reward if useful

vivek

Read only

Former Member
0 Likes
2,164

Interactive reports are those,where from a report program you can call a transaction or a module pool program screen. the event for interactive reports are:

AT LINE-SELECTION, AT-USER-COMMAND,AT PFn etc

AT LINE-SELECTION event

Double clicking is the way most users navigate through programs. Double clicking on basic list or any secondary list triggers the event AT LINE-SELECTION. SY-LSIND denotes the index of the list currently created.

AT USER-COMMAND

When the user selects the menu item or presses any function key, the event that is triggered is AT USER-COMMAND, and can be handled in the program by writing code for the same. The system variable SY-UCOMM stores the function code for the clicked menu item or for the function key and the same can be checked in the program.

to make a report intercative make a hotspot on for one field in our report by adding HOTSPOT ON to that field in END-OF-SELECTION-EVENT

also do coding in say AT_LINE_SELECTION event

HIDE ernam.

((HIDE technique

In this case thins are much simpler. Consider the case, wherein you display fields from table sflight in basic list. When user double clicks on any sflight-carrid, you are displaying the detailed information related to that particular carrid on secondary list. Hence there is a need to store the clicked carrid in some variable. So that you can access this carrid for next list. ABAP/4 has facility; a statement called HIDE, which provides the above functionality.

HIDE command temporarily stores the content of clicked field in system area.))

SET PARAMETER ID 'FIELD' ERNAM.(when you are calling module pool screen with the help of report do this and in module pool program PBO use GET PARAMETER)

where ernam is the field fr which hotspot has been activated.the contents of ernam field will be stored in SAP memory now in end of selection event write:

CALL TRANSACTION <transaction name>.

by doin this when user clicks on ernam field control will be passed to the transaction and the screen for that transaction or module pool screen will be opened.

If we r in 5th list and want to jump directly to 2nd list How?

The system variable sy-lsind will hold the current list index.

at line-selection.

If sy-lsind = 2.

if sy-ucomm = 'LI10'.

sy-lsind = 10.

endif.

endif.

Edited by: Richa Khosla on Mar 25, 2008 8:01 AM

Edited by: Richa Khosla on Mar 28, 2008 5:38 AM

Edited by: Richa Khosla on Mar 28, 2008 5:43 AM

Read only

Former Member
0 Likes
2,163

How many lists are possible in interactive report.

20 secondary lists and one basic list...

INTERACTIVE REPORTS

About interactive report

A classical report consists of one program that creates a single list. This means that when the list is displayed, it has to contain all the requested data, regardless of the number of details the user want to see. This procedure may result in extensive and cluttered lists from which the user has to pick the relevant data. The desired selections must be made before hand and the report must provide detailed information.

This is not possible using the classical report and for this ABAP/4 has provided reporting feature called INTERACTIVE REPORT. The list produced by classical report doesn’t allow user to interact with the system but the list produced by interactive report allows the user to interact with the system i.e., user can tell the system, that he needs further information. Depending upon what the user tells the system, the action is taken. Interactive reporting thus reduces information retrieval to the data actually required.

Interactive reporting allows the user to participate in retrieving and presenting data at each level during the session. Instead of presenting one extensive and detailed list with cluttered information, with interactive reporting you can create a condensed basic list from which the user can call detailed information by positioning the cursor and entering commands.

Detailed information is presented in secondary lists. A secondary list may either overlay the basic list completely or appear in an additional dialog window on the same screen. The secondary list can itself be interactive again. The basic list is not deleted when secondary list is created.

User can interact with the system by:

• Double clicking or pressing F2

• Selecting menu option

Like classical report, the interactive report is also event driven. Both the action mentioned above trigger events and code is written to handle these events. The events triggered by this action are as follows:

• At line-selection

• At user-command

• Top-of-Page During Line-Selection for Secondary Page Header info

Interactive report consists of one BASIC list and 20 secondary list. Basic list is produced by START-OF-SELECTION event. When the user double clicks on the basic list or chooses the menu option, the secondary list is produced. All the events associated with classical report except end-of-page are applicable only to basic list.

AT LINE-SELECTION event

Double clicking is the way most users navigate through programs. Double clicking on basic list or any secondary list triggers the event AT LINE-SELECTION. SY-LSIND denotes the index of the list currently created. For BASIC list it is always 0. Following piece of code shows how to handle the event.

Start-of-selection.

Write: / ‘this is basic list’.

At line-selection.

Write : ‘this is first secondary list’.

In this case the output will be displayed on basic list i.e.

This is basic list.

When user double clicks on this line, the event at line-selection gets triggered and secondary list is produced, i.e.

This is first secondary list.

You can go back to basic list by clicking on F3 or back icon on the standard tool bar. For this list, the value of sy-lsind will be 1.

HIDE technique

In this case thins are much simpler. Consider the case, wherein you display fields from table sflight in basic list. When user double clicks on any sflight-carrid, you are displaying the detailed information related to that particular carrid on secondary list. Hence there is a need to store the clicked carrid in some variable. So that you can access this carrid for next list. ABAP/4 has facility; a statement called HIDE, which provides the above functionality.

HIDE command temporarily stores the content of clicked field in system area.

Syntax:

HIDE <FIELDS>.

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

You have to place the HIDE statement always directly after the output statement i.e., WRITE for the variable <f>. As when you hide the variable, control is passed to next record. While writing, WRITE statement takes that record from header and writes it on to the list, but when writing onto your interactive list you will miss out 1st record.

To hide several variables, use chain HIDE statement.

As soon as the user selects a line for which you stored HIDE fields, the system fills the variables in the program with the values stored. A line can be selected.

• By an interactive event.

For each interactive event, the HIDE fields of the line on which the cursor is positioned during the event are filled with the stored values.

The HIDE area is a table, in which the system stores the names and values of all HIDE fields for each list and line number. As soon as they are needed, the system reads the values from the table. (Please try to find the name of this table.)

Sy-lsind indicates the index of the list and can be used to handle all the secondary lists. When the user double clicks on the line or presses F2, sy-lsind is increased by one and this new sy-lsind can be handled. For example:

Write: / ‘this is basic list’.

• Will create a basic list.

If sy-lsind = 1.

Write: / ‘this is first secondary list’.

Elseif sy-lsind = 2.

Write: / ‘This is second secondary list’.

Endif.

When this code is executed,

• Basic list is produced.

• When the user clicks on the basic list, sy-lsind becomes one.

• AT LINE-SELECTION event is triggered.

• Whatever is written under IF Sy-lsind = 1, gets executed.

• Secondary list is produced.

• Again if user clicks on this list, sy-lsind becomes two.

• AT LINE-SELECTION gets triggered.

• Code written under IF Sy-lsind = 2, gets executed.

A sample program for AT LINE-SELECTION.

User interface

An interactive report starts with basic list where condensed information is stored on basic list and detailed information is stored on secondary list. To implement this kind of reporting, you need to provide the user with things like menu, icons, function keys. You also need to write code, which must react, to the user’s action.

For this, you need to create the interface, which interacts with the user.

The user interface is independent of the program or list or screen. However both interface and list can be associated by means of GUI status. A GUI status groups together the interface components.

• Menu bar

• Application tool bar

• Function keys

• Title bar

The last element of the user interface is independent of the GUI status i.e., titlebar.

To assign status to your list the statement SET PR-STATUS.

Some facts about GUI status are:

• A program can have multiple GUI status and titles for different lists.

• Multiple lists can be assigned to same GUI status.

• Normally both GUI status and title go together.

Function code

An important concept, when working with user interface. Function is a four character alphanumeric code, which the system stores in the system variable called SY-UCOMM for each function key, push button, or menu option. Whenever any push button is clicked or menu option is selected, the code attached to that, is stored in SY-UCOMM and can be handled in your program.

Menu painter

Menu painter is the ABAP/4 workbench tool for creating and maintaining user interface.

Starting Menu Painter

ABAP/4 development workbench &#61614; menu painter

Or

Transaction SE41 in the command field.

Or

Through program SET PF-STATUS <var>

If you double click on the variable, the system takes you to the menu painter screen.

Creating Menu bar

Steps involved are as follows:

• Enter the name in the first field. It is just a name given to the menu and is not displayed anywhere in the output.

• Enter the name of each menu item. You can create up to six menus (total eight menu items are available, out of which system and help are mandatory).

• Enter name of the menu items and function code. You can have fifteen menu items under one

In Application tool bar you can include icon assigned for function keys.

Procedure:

• Select function key.

• From the menu, more utilities - &#61614; change text type. The system displays a dialog box, click on icon and presses ENTER.

• Select icon from list of icons displayed

Creating GUI title

From your program, you can set title for your list and SET TITLEBAR is used.

Syntax:

SET TITLEBAR <var>.

Here var can be any three-character name. When developer double clicks on the var, system displays the dialog box in which you enter the title number, the description, and the actual text for title.

Similar to dictionary objects, the GUI status must be generated to be accessible by program.

AT USER-COMMAND

When the user selects the menu item or presses any function key, the event that is triggered is AT USER-COMMAND, and can be handled in the program by writing code for the same. The system variable SY-UCOMM stores the function code for the clicked menu item or for the function key and the same can be checked in the program. Sample code would look like

AT USER-COMMAND.

Case sy-ucomm.

When ‘DISP’.

Select * from sflight.

Write sflight-carrid, sflight-connid.

Endselect.

When ‘EXIT’.

LEAVE.

If GUI status, suppose you have set menu bar for two items and the function code is ‘DISP’ and ‘EXIT’ respectively. If the user clicks the menu item ‘DISPLAY’, then function code ‘DISP’ is stored in the sy-ucomm and whatever is written under the when ‘DISP’, gets executed. This is applicable for EXIT as well.

Sy-lsind for the screen increases when the user clicks the menu item.

Usually you have combination of all the three navigations in your user interface, i.e., you have to create menu bar, assign function code for the function keys and write code to handle all this in addition to handling double clicking.

Things to remember while using all the combinations:

• Sy-lsind increases even if you select menu-item.

• When the user double clicks on particular line, value of sy-ucomm is ‘PICK.

• If you set sy-lsind = 2 for your 4th secondary list, when control is transferred to the 2nd secondary list, all the other lists after 2nd are lost or memory allocated to them is lost.

• Sy-lisel also gives you the value of clicked line but in this case you cannot differentiate between field. To retrieve the exact field, you have to know the field length of each field.

• If you use statement SY-LSIND = 1.

The system reacts to a manipulation of SY-LSIND only at the end of an event, directly before displaying the secondary list. So, if within the processing block, you use statements whose INDEX options access the list with the index SY-LSIND, make sure that you manipulate the SY-LSIND field only after processing these statements. The best way is to have it always at the `as the last statement’ of the processing block.

Read only

Former Member
0 Likes
2,163

Purpose of Interactive Reports

Interactive report provides you with comfortable functions for navigating through your data.

Use

1>Interactive report are used to display multiple list in one single report

2>It has basic list and then you can navigate to one or other screens in one single report

3>Enhance the efficiency & transparency of Business Processes

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.

Interactive Process Flow

1. Basic list is displayed.

2. User double clicks on any valid line or User selects a line and presses as button on the tool bar.

3. The corresponding event is triggered

4. Then in the code, the line on which action was done, is read.

5. Depending on the values in that selected line, a secondary list is displayed.

6. Steps from 2-5 are repeated till the end.

Read only

Former Member
0 Likes
2,163

Hi

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.

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<key>

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 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.

TOP-OF-PAGE DURING LINE-SELECTION :top of page event for secondary list.

MAX we can go for 20 SECONDARY LIST AND ONE BASIC LIST TOTAL 21

sy-lsind EQ 5.

sy-lsind = 9.

endif.

Ex:

REPORT demo_list_interactive_2 .

START-OF-SELECTION.

WRITE: 'Basic List, SY-LSIND =', sy-lsind.

AT LINE-SELECTION.

IF sy-lsind = .5

sy-lsind = 9.

ENDIF.

WRITE: 'Secondary List, SY-LSIND =', sy-lsind.

Read only

Former Member
0 Likes
2,163

hi,

Interactive report : It helps you to create easy to read lists.

you can display an overview list first that contains general information and provide the user with the possibility of choosing detailed information that you display on furtherlists.

Each program can produce up to 21 lists: one basic list and 20 secondary lists.

SY-LSIND Index of the list created during the current event (basic list = 0)