Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

A small tip on how to set a selection field as mandatory. This is useful when the query report might run on huge database or certain selection field is required in order to get meaningful results.

I show an example below.

In SQ02, click on Extras icon on top, and then go to Selections tab. Click on create button to create a new selection criterion and fill in like below. The extras field need to fill in "OBLIGATORY NO-EXTENSION NO INTERVALS".

This is what you may see in the report selection. Notice that the field is also set as a single field. If you still want multiple selection field, in the extras, put in parameter "OBLIGATORY" will do.

To add authorization check, as shown in the 1st screen shot, after you create the selection field as mandatory, click on the code icon to write below codes:  

AUTHORITY-CHECK OBJECT 'V_VBAK_VKO'
            ID 'VKORG' FIELD SALESORG-LOW
            ID 'ACTVT' FIELD '03'.
if sy-subrc ne 0.
   MESSAGE 'You are not authorized to Sales Office/Sales Area.' Type 'E'.
endif.

AUTHORITY-CHECK OBJECT 'S_TCODE'
            ID 'TCD' FIELD 'VA03'

if sy-subrc ne 0.
   MESSAGE 'You are not authorized to Tcode VA03.' Type 'E'.
endif.

11 Comments
Labels in this area