Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

if write stat. write in initialization

Former Member
0 Likes
1,589

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

7 REPLIES 7
Read only

Former Member
0 Likes
1,061

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

Read only

Former Member
0 Likes
1,061

Hi,

You should write the statement under TOP-OF-PAGE event.

Best regards,

Prashant

Read only

Former Member
0 Likes
1,061

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

Read only

Former Member
0 Likes
1,061

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.

Read only

0 Likes
1,061

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.

Read only

Former Member
0 Likes
1,061

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

Read only

Former Member
0 Likes
1,061

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 .