Show TOC

END CodeLocate this document in the navigation structure

Use

The END-OF-SELECTION code consists of two parts (Before list output and After list output). The first part is processed before the list is output and the second part afterwards. Choose the pushbutton Code and, with the aid of F4 help, END-OF-SELECTION (before list output) or (after list output).

This division means that you can make your own additions to the list created by the query both before and after the list is output. Since your own additions are always output on a separate page, you can use this to generate a first and a last page that are output independently of the query definition. You should, however, note that these special additions to the output cannot be displayed by the layout display in the query maintenance component.

The difference between the code for START-OF-SELECTION and that for END-OF-SELECTION (before the list is output) is that whilst the START-OF-SELECTION code is processed before the first database access, the END-OF-SELECTION code (before the list is output) is processed after the last database access, but before the list is output.

If a first page is to be generated via code, this should not be done in the START-OF-SELECTION code. In this case the page initially would be created when the query is executed, but it would not be created in interactive functions that rebuild the list (printing, reduction and compression of basic lists). If the first page is created in END-OF-SELECTION code (before the list is output), this error does not occur.

Any ABAP statements may be used in the code. Any data objects may be accessed. However, it is better to restrict to the following objects:

  • Parameters from the InfoSet and the logical database

  • Selection criteria for the InfoSet and the logical database

  • Global data from the DATA code

Fields in logical database tables or additional tables and additional fields do not have a defined value at this point.