Selection Screen – Disable Standard Toolbar Button

By | Last Updated on July 17, 2014 | 10,284

Many times you would need to disable the standard toolbar buttons to make sure unexpected behavior doesn’t occur. This code snippet will help you to achieve that.

Disable Standard Toolbar Button on Selection Screen

 
PARAMETERS: p_test AS CHECKBOX.
 
INITIALIZATION.
 
* Exclude Buttons from the PF-KEY
  DATA: t_rsexfcode        TYPE TABLE OF rsexfcode,
        ls_rsexfcode       LIKE LINE OF t_rsexfcode.
 
  ls_rsexfcode-fcode = 'PRIN'.          "Execute and Print
  APPEND ls_rsexfcode TO t_rsexfcode.
 
  ls_rsexfcode-fcode = 'SJOB'.          "Execute in Background
  APPEND ls_rsexfcode TO t_rsexfcode.
 
  ls_rsexfcode-fcode = 'VDEL'.          "Variant Delete
  APPEND ls_rsexfcode TO t_rsexfcode.
 
  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
    EXPORTING
      p_status  = sy-pfkey
    TABLES
      p_exclude = t_rsexfcode.
 

Function Codes

You can get the function codes SJOB, PRIN, etc from GUI STATUS %_00 in the program RSSYSTDB. Or using the System > Status and drill down to the GUI status.

In Action

Before the code, You would have the buttons

After the code, buttons are disabled

Do you have a Code Snippet which you want to share, Submit Code Snippet here

Share It!

Don't miss an Update

Get notified of the new post, right into your inbox

Naimesh Patel{274 articles}

I'm SAP ABAP Consultant for more than a decade. I like to experiment with ABAP especially OO. I have been SDN Top Contributor.
Follow :

Explore all of his 274 articles.

Load comments

2 Comments

  • Sílvio Miranda

    Good tip… I´ll try this…

  • Gokul

    nice once…

Comments on this Post are now closed. If you have something important to share, you can always contact me.