‎2007 Feb 03 5:42 AM
Hi All,
Is there any chance for using events in Classical Report.
Thanks.
‎2007 Feb 03 5:45 AM
Hi,
Yes..You can use the event AT LINE SELECTION...AT USER-COMMAND.
<b>Example for AT LINE-SELECTION.</b>
WRITE: / 'Display record'.
AT LINE-SELECTION.
Write: / 'Secondary list triggered'.
<b>Example for AT USER-COMMAND.</b>
DATA: BEGIN OF itab OCCURS 0,
check,
value(20),
END OF itab.
SET PF-STATUS 'TEST1'.
itab-value = 'ETSAT'.
APPEND itab.
itab-value = 'ETSATADSF'.
APPEND itab.
itab-value = 'ETSAT'.
APPEND itab.
LOOP AT itab.
WRITE: / itab-check AS CHECKBOX,
itab-value.
ENDLOOP.
<b>AT USER-COMMAND.</b>
DATA: wa LIKE itab.
DATA: itab_download LIKE itab OCCURS 0 WITH HEADER LINE.
IF sy-ucomm = 'DOWNLOAD'.
DESCRIBE TABLE itab.
DO sy-tfill TIMES.
READ LINE sy-index FIELD VALUE itab-check.
IF sy-subrc <> 0.
EXIT.
ENDIF.
CHECK itab-check = 'X'.
itab_download-value = itab-value.
APPEND itab_download.
ENDDO.
download
call function 'WS_DOWNLOAD'
exporting
filename = 'C:\TEST.XLS '
tables
data_tab = itab_download.
ENDIF.
Thanks,
Naren
‎2007 Feb 03 5:45 AM
Hi,
Yes..You can use the event AT LINE SELECTION...AT USER-COMMAND.
<b>Example for AT LINE-SELECTION.</b>
WRITE: / 'Display record'.
AT LINE-SELECTION.
Write: / 'Secondary list triggered'.
<b>Example for AT USER-COMMAND.</b>
DATA: BEGIN OF itab OCCURS 0,
check,
value(20),
END OF itab.
SET PF-STATUS 'TEST1'.
itab-value = 'ETSAT'.
APPEND itab.
itab-value = 'ETSATADSF'.
APPEND itab.
itab-value = 'ETSAT'.
APPEND itab.
LOOP AT itab.
WRITE: / itab-check AS CHECKBOX,
itab-value.
ENDLOOP.
<b>AT USER-COMMAND.</b>
DATA: wa LIKE itab.
DATA: itab_download LIKE itab OCCURS 0 WITH HEADER LINE.
IF sy-ucomm = 'DOWNLOAD'.
DESCRIBE TABLE itab.
DO sy-tfill TIMES.
READ LINE sy-index FIELD VALUE itab-check.
IF sy-subrc <> 0.
EXIT.
ENDIF.
CHECK itab-check = 'X'.
itab_download-value = itab-value.
APPEND itab_download.
ENDDO.
download
call function 'WS_DOWNLOAD'
exporting
filename = 'C:\TEST.XLS '
tables
data_tab = itab_download.
ENDIF.
Thanks,
Naren
‎2007 Feb 03 5:45 AM
yes ramesh, you have to use events in classical report.
even u can write with out events but it is not good practice.
regards.
santhosh
‎2007 Feb 03 5:47 AM
yes you can use
initialization.
at selection-screen output.
at selection-screen.
start-of-selection.
at user-command.
at line-selction.
at line-selection.
top-of-page. like this there are remainning events also.
regards
shiba dutta
‎2007 Feb 03 5:50 AM
top-of-page, end-of-page, at line-selection,at user-command, at pf <2 digit number>
‎2007 Feb 03 5:51 AM
hi,
First event -
Initialization : triggered when the report is loaded in memory.
At selection-screen output : triggered when the selection screen is loaded in memory before being displayed.
At selection-screen : before leaving the selection screen.
start-of-selection : the first event for displaying the report.
This event keyword defines an event block whose event is triggered by the ABAP runtime environment
when calling the executable program selection screen processing of a selection screen.
In an executable program, all statements that are not declarations,
and are listed before the first explicit processing block, are assigned to this event block.
If the program does not contain an explicitly defined event block START-OF-SELECTION,
these statements form the complete event block START-OF-SELECTION.
If a program contains an explicitly defined event block START-OF-SELECTION,
these statements are added to the beginning of the event block.
If the program contains no explicitly defined event blocks,
these statements form the entire event block START-OF-SELECTION.
end-of-selection : after the start-of-selection is completed.
classiscal report events.
top-of-page : every time a new page is started in the list.
end-of-page : every time the list data reaches the footer region of the page.
interactive report events.
top of page during line selection : top of page event for secondary list.
at line-selection : evey time user dbl-clicks(F2) on the list data.
at pF<key> : function key from F5 to F12 to perform interactive action on the list.
at user-command
http://help.sap.com/saphelp_47x200/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
Thanks,
Shankar