Search on this Website

Sunday, June 17, 2007

System fields used in interactive Reporting

The SY-LSIND system field contains the index of the list currently created. While
creating a basic list, SY-LSIND equals 0.
With each interactive event, the system automatically sets the following system fields:

System field Information
SY-LINCT total line count of a list
SY-LINNO current line no where cursor is placed.
SY-LSIND Index of the list currently created during the current event (basic list = 0)
SY-LISTI Index of the list level from which the event was triggered
SY-LILLI Absolute number of the line from which the event was triggered
SY-LISEL Contents of the line from which the event was triggered
SY-CUROW Position of the line in the window from which the event was triggered
(counting starts with 1)
SY-CUCOL Position of the column in the window from which the event was triggered
(counting starts with 2)
SY-UCOMM Function code that triggered the event
SY-PFKEY Always contains the status of the current list.

TOP-OF-PAGE DURING LINE-SELECTION.

The system triggers this event for each secondary list. If you want to create different
page headers for different list levels, you must program the processing block of this
event accordingly, for example by using system fields such as SY-LSIND or SY-PFKEY
in control statements (IF, CASE).

Data from System Fields of Interactive Lists

From system fields, you retrieve the following information: the index of a list, the position
of the list in the output window, and the location of the cursor. The only system field that
contains the contents of the selected line is SY-LISEL.


Passing Data by Program Statements

To pass individual output fields or additional information from a line to the corresponding
processing block during an interactive event, use these statements:

HIDE
The HIDE statement is one of the fundamental statements for interactive reporting.
Using the HIDE technique, you can at the moment you create a list level define, which
information later to pass to the subsequent secondary lists.

Syntax
HIDE .
Eg
HIDE: SPFLI-CARRID, SPFLI-CONNID, NUM.

READ LINE
Use the statements READ LINE and READ CURRENT LINE to explicitly read data from
the lines of existing list levels. These statements are tightly connected to the HIDE
technique.

Syntax :
READ LINE [INDEX ]
[FIELD VALUE [INTO ]... [INTO ]]
[OF CURRENT PAGEOF PAGE

].

Eg :
READ LINE SY-INDEX FIELD VALUE BOX.

GET CURSOR
Use the statements GET CURSOR FIELD and GET CURSOR LINE to pass the output
field or output line on which the cursor was positioned during the interactive event to the
processing block.

Syntax
GET CURSOR FIELD [OFFSET ] [LINE ]
[VALUE ] [LENGTH ].

SET CURSOR
To set the cursor, use the SET CURSOR statement. This statement sets the cursor in
the most recently created list. While creating the basic list, this is always the basic list
itself. While creating a secondary list, this is the previous list.

SET CURSOR .
This statement sets the cursor to column of line of the output window.

Calling Programs

If you need to program an extensive application, one single program will become very
complex. To make the program easier to read, it is often reasonable to divide the
required functions among several programs.

ABAP allows you to call reports as well as transactions using these statements:

Report
Transaction
Call without return
SUBMIT
LEAVE TO TRANSACTION
Call and return
SUBMIT AND RETURN
CALL TRANSACTION

No comments: