‎2008 Feb 07 5:47 AM
Hi All,
Can anyone please tell me the process that happens behind the following code.
*& Report ZMY_TEST_PROGRAM
*&
&----
*&
*&
&----
REPORT ZMY_TEST_PROGRAM.
TABLES : KNA1,
MARA.
SELECTION-SCREEN :BEGIN OF BLOCK SC1 WITH FRAME TITLE TEXT-001.
PARAMETERS : RD1 RADIOBUTTON GROUP RD1 DEFAULT 'X' USER-COMMAND ONLI,
RD2 RADIOBUTTON GROUP RD1.
SELECTION-SCREEN END OF BLOCK SC1.
data : itab type standard table of mara initial size 10 with header line.
write 'i am fine'.
start-of-selection.
select * from mara into table itab where matnr = '0000001000'.
loop at itab.
write 😕 itab-matnr.
endloop.
top-of-page.
write 'this is the header'.
start-of-selection.
select * from mara into table itab where matnr = '0000001001'.
loop at itab.
write 😕 itab-matnr.
endloop.
In the above code the write statement "i am fine" falls under which event.
TOP-OF-PAGE is the output event.so how is the control going back to the Start-of-selection once it encounters the write statement.ie.if a write statement is encountered control goes to TOP_OF-PAGE.so how is it able to go back to Start-of-selection
Also how is the ABAP processor able to process both the Start-of-selection events.
i am able to get the output of all the write statements.
so can anyone tell me how the ABAP processor does that work internally.
‎2008 Feb 07 6:03 AM
Hi,
flow of events
load of program
INITIALIZATION. Before the selection screen is displayed.
AT SELECTION-SCREEN OUTPUT. Before painting the screen.
AT SELECTION-SCREEN. Used for validations..
START-OF-SELECTION. When pressed execute button in the selection-screen. If no selection-screen then executes automatically
END-OF-SELECTION. Generally used in the logical database. But in normal reporting triggers after start-of-selection. and is the last event triggered before displaying the report.
AT USER-COMMAND. when user presses button in the list. then this event is triggered
AT LINE-SELECTION. when double clicked on the list.
TOP-OF-PAGE. when first write statement is triggered in the program.
END-OF-PAGE. triggered at the end of the page..
In whatever order u give events flow in the above order processor checks and processes them accordingly
write statement "i am fine" falls under start-of-selection event.
a start-of-selection event is automatically inserted before write statement
Regards
‎2008 Feb 07 6:41 AM
hi
when first write/skip/newpage statement is encounted ,then the event triggered is top-of-page.
so when the control comes to
write 'i am fine'.
then it goes 2 top-of-page and
write 'this is the header'.
this is exceuted.
then it goes back 2 write:'i am fine'.
then start-of-selection is triggered.
output will be:
this is the header
i am fine
‎2008 Feb 07 6:47 AM
hi,
top-of-page will be triggered in when its sees first write or new-page or skip statement after start-of-selection
output will be in this format i m fine ,this is the header, and then material no
‎2008 Feb 07 6:56 AM
Whenever you write top-of-page, on the output screen it will be triggered first. The sequence of triggering event is exactly as given by KPN irrespective of your sequence written in ABAP editor. If you do not use top-of-page event then first write statement on editor will be first in output.
You can refer..
http://help.sap.com/erp2005_ehp_03/helpdata/EN/9f/db9a9635c111d1829f0000e829fbfe/frameset.htm
‎2008 Feb 07 8:20 AM