Skip to Content
avatar image
-2
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 12 at 07:15 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.