The menu that is presented on 99% of the reporting screens is one and the same menu. In the normal life-cycle or a report, it answers all our needs and it requires no changes. Can you think of a reason to change this menu ? If it is some extra functionality you need, simply add up to 5 dynamic buttons, or add as many buttons you like between the parameter fields. Not satisfied ? Read on...
In my example I had set up a bit of dynamic programming, where a screen with customizable fields was to be displayed as a data-entry-form. Parameter definitions can be used nicely for this, but I'ts a report selection screen that is composed with parameters (read: use of the PARAMETER
statement). Having the menu options "Execute in the background" was not useful here.
The way to influence the menu of a selection screen is through function module RS_SET_SELSCREEN_STATUS
as was nicely pointed out in thread 747332.
Disable menu options
To disable menu options, the options will need to be listed and passed to the module. E.g. if you do not want your end user to run the report in the background (F9), first look up the menu code for the option (Double click on Status GUI in the System / Status overview and browse the menu painter). The code for background processing (F9) is SJOB
AT SELECTION-SCREEN OUTPUT. DATA: lt_excluding type standard table of sy-ucomm. append 'SJOB' to lt_excluding. CALL FUNCTION 'RS_SET_SELSCREEN_STATUS' EXPORTING p_status = '%_00' p_program = 'RSSYSTDB' TABLES p_exclude = lt_excluding.
And that should "gey out" the option.
Set an alternate menu
The whole menu can also be replaced with an other menu, which can be available in your report, or even on another report. For my setup I needed an alternate menu that was the same for many forms, so I set up my menu (PF-STATUS) in an external report.
AT SELECTION-SCREEN OUTPUT. DATA: lt_excluding type standard table of sy-ucomm. CALL FUNCTION 'RS_SET_SELSCREEN_STATUS' EXPORTING p_status = 'MAINMENU' p_program = 'Z_EXTERNAL_REPORTNAME' TABLES p_exclude = lt_excluding.
Now the selection screen no longer looks like a selection screen. It still operates lie one though - so you may want to include process codes from the all standard %_00 status (yes, this is an actual menu name) on report 'RSSYSTDB
.