Google Search - Blog...........

HIDE Technique In ABAP Interactive Reporting

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 .

This statement stores the contents of variable in relation to the current output line (system field SY-LINNO) internally in the so-called HIDE area. The variable 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 . 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.

No comments:

Post a Comment