‎2007 May 18 2:32 PM
hi experts,
my doubt is" if WRITE stata. write in initialization Event, when top-of-page can be trigger."
1) first display the selection screen or list
‎2007 May 18 2:34 PM
Top-of-page will trigger when you have start-of-select.
start-of-selection should contains ateleast one write statement
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 18 2:34 PM
Hi,
You should write the statement under TOP-OF-PAGE event.
Best regards,
Prashant
‎2007 May 18 2:35 PM
Hi
What ever you write in Initialization event that doesn't effect on output
that doesn't trigger top of page,<b> it will trigger only selection screen.</b>
initialization is processed before selection screen is displayed.
once the selection screen is displayed then if you write some write statement in top of page or start of selection the output will come.
Reward points if useful
Regards
Anji
‎2007 May 18 2:36 PM
In that case "Top_of_page" will be trigger twice.
1. First time, in the write statement in initialization. Though will not see any effect of it in your program. "Top_Of_Page" will not displayed in output.
2. Second time, the first write statement after 'Start_Of_Selection". Tou will see the effect in your program. "Top_Of_Page" will displayed in output.
you can check this by writting a sample program and debugging that.
‎2007 May 18 3:09 PM
just debug the following program, by putting a breakpoint in the first write statement in the initialization. You will understand the logic.
REPORT Z_82235_TEST4 .
parameter: p_param type c.
initialization.
WRITE: / 'initialization 1'.
WRITE: / 'initialization 2'.
WRITE: / 'initialization 3'.
START-OF-SELECTION.
WRITE: / 'line 1'.
WRITE: / 'line 2'.
WRITE: / 'line 3'.
TOP-OF-PAGE.
WRITE: / 'Heading'.
ULINE.Note: If you do not have any selection screen then system will autometically embed a start of selection in the first write statement. So in the following program the top_of_page will be called once and you will get all the write statement in the output.
REPORT Z_82235_TEST4 .
initialization.
WRITE: / 'initialization 1'.
WRITE: / 'initialization 2'.
WRITE: / 'initialization 3'.
START-OF-SELECTION.
WRITE: / 'line 1'.
WRITE: / 'line 2'.
WRITE: / 'line 3'.
TOP-OF-PAGE.
WRITE: / 'Heading'.
ULINE.
‎2007 May 18 2:44 PM
as per the SAP Events.
the out list display will be triggered by top-of-page .
if you use write statement NOT only in initalise , uyou try in the other events also like GET event or selection-screen end . then also you will get input .
then it not an even following .
so , what even write statments atre there it will give you in the output .
it means after the TOP-OF-PAGE event only the write state will be executed in the sap execute program . ........even if no top-of-page then also it will give you output because , the sap execute program will be take care of its sequence ....
Girish
‎2008 Mar 18 12:08 PM
Hi,
when write statment appears in initialization then Top of page event in called.and after that write statment executes.
after that when 1st write statment execute in start of selection then again Top of page event will be trigger.
but write statment in initialization output will not be appear on output list becouse of selection screen .