Check Valid line selected before
Drill Down
How to check if a valid line is selected before drill down. There are several ways to do this. Below are two examples: 1. Clearing and testing for initial
values of keyfields in the main report.
1. Clearing and testing for initial
values of keyfields in the main report.
* Clears the keyfields in the internal table of the main report, that are used to lookup data for the sub report. CLEAR itab-blart. AT LINE-SELECTION. * Check if a valid line is selected
* Write subreport
* Clear keyfield from the main report
2. Using sy-lilli to check the number of the selected line SY-LILLI contains the absolute number
of the line from which the event was triggered.
In this example the report heading uses 4 lines. It's the possible to check if the number of the selected line is greater than 4: at line-selection.
Note: This will not check if an invalid line selection have been made in the bottom of the report. *******************************************************
END-OF-SELECTION.
TOP-OF-PAGE.
AT USER-COMMAND.
AT LINE-SELECTION. * Instead of pressing a button can
perform the same actions
CASE sy-lsind WHEN
PERFORM write_reprt2.
PERFORM write_reprt3.
TOP-OF-PAGE.
TOP-OF-PAGE DURING LINE-SELECTION. * Write report header for sub reports
WHEN 1. * Write
report header for REPORT2.
* Write
report header for REPORT3.
FORM WRITE_REPORT1.
* Hide keyfields
used for the select statement of
ENDLOOP.
FORM WRITE_REPORT2. SELECT * FROM databasetable2
into itab2
LOOP at itab2. * write report2 ....... * Hide keyfields
used for the select statement of
ENDLOOP.
FORM WRITE_REPORT3. SELECT * FROM databasetable3
into itab3
LOOP at itab3. * write report3 ....... * No need
to hide keyfields, as further drill down is not
ENDLOOP.
More Function Module
Tables
ABAP Books List
Smart Forms
ABAP Menu:
Return to Index:-
(c) www.gotothings.com All material on this site is Copyright.
|