Skip to Content
-2

WRITE statement in the beginning and TOP-OF-PAGE event has SELECT query. Does not work.

Mar 12 at 05:12 AM

21

avatar image
Former Member

I have learned that TOP-OF-PAGE event is triggered when abap run-time environment first encounters WRITE statement in the program. The code below TOP-OF-PAGE is executed and then the control will execute the WRITE statement .

Below is the code which does not give the output despite the rules are followed :

************************

Loop at it into wa

write:/ wa-matnr , wa-mtart.

Endloop.

Top-of-page.

Select matnr mtart from mara into corresponding fields of table it up to 10 rows.

*************************

The list screen is not displayed. No output.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sandra Rossi Mar 12 at 07:15 AM
1

As you say, WRITE may trigger TOP-OF-PAGE (at top of page), but in your code WRITE is not triggered because your internal table IT is empty.

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hello,

Nice observation. I will try populating the table with merely required values and then try to execute.

0
Former Member

Yes, the WRITE statement could not trigger TOP-OF-PAGE as the internal table was empty.

Once I initialized it TOP-OF-PAGE was properly triggered executing the code below.

Thank you.

1