Skip to Content

The Problem

Reports and Queries using the “Sap List Viewer” format are a huge improvement from the old “ABAP List” format. Columns can be moved by drag and drop, export options are better, looks are nicer and it has many other advantages.

fig 1.png

The END-OF-SELECTION section is very handy. It runs after the records have been processed by the query but before the report is displayed. It is the right section to do aggregated calculations and actions that can only be done when data from all the selected records has been extracted.

However, there is a problem when queries use code in the END-OF-SELECTION section in combination with the Sap List Viewer format. In short, the code is never reached.

Here is a trick to make the combination work.

The Trick

When defining the query change the output format option to ABAP List. This will trigger the old source code generation that includes the code in the END-OF-SELECTION section.

fig 2.png

Run the query and in the selection screen change the option to SAP List Viewer.

fig 3.png

Save a default variant 

/wp-content/uploads/2014/01/save_icon_368159.png

Include any other default values that you may need for the selection fields in the query.

fig 4.png

Change the query and add the default variant as the standard variant of the query.

fig 5.png

In this way, the query is generated internally for an “ABAP List” report and it will include the END-OF-SELECTION code. When the query is executed, the default variant will change the option and the query will display with a flexible “SAP List Viewer” format.

Enjoy.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply