Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove buttons from a selection-screen as window.

0 Kudos

Hello SAPients.

I'm using CALL SELECTION-SCREEN 100 STARTING AT 10 10 to call a previously created selection-screen. The window shows 4 buttons: Execute, Check input, Save as variant and Cancel. The user is asking to remove the Check input and Save as variant buttons. Is that possible? I've been searching and I can't find a way to remove those 2 buttons.

Thank you in advance for your help.

1 ACCEPTED SOLUTION

Simha_
Employee
Employee
0 Kudos

Hi,

Use this F.M <b> RS_SET_SELSCREEN_STATUS.</b>

Check this..

U will get some idea how to exclude standard options of the application toolbar.

Try this code..

it works..

DATA name(20) TYPE c.

DATA itab TYPE TABLE OF sy-ucomm.

AT SELECTION-SCREEN OUTPUT.

APPEND 'NONE' TO itab.

APPEND 'SPOS' TO ITAB.

p = sy-ucomm.

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

p_status = sy-pfkey

TABLES

p_exclude = itab.

cheers,

Simha.

4 REPLIES 4

former_member184569
Active Contributor
0 Kudos

Hello Ric,

The buttons must be defined in GUI status right?

So you must be calling the 'set pf-status' command?

Modify this statement.

suppose the function code for check input is 'CHECK' and save variant is 'SAVE'.

TYPES: BEGIN OF TAB_TYPE,

FCODE LIKE RSMPE-FUNC,

END OF TAB_TYPE.

DATA: TAB TYPE STANDARD TABLE OF TAB_TYPE WITH

NON-UNIQUE DEFAULT KEY INITIAL SIZE 10,

WA_TAB TYPE TAB_TYPE.

CLEAR TAB.

MOVE 'CHECK'TO WA_TAB-FCODE.

APPEND WA_TAB TO TAB.

MOVE 'SAVE' TO WA_TAB-FCODE.

APPEND WA_TAB TO TAB.

SET PF-STATUS 'STAT' EXCLUDING TAB.

Thanks,

Susmitha

Dont forget to reward points for useful answers

0 Kudos

Hello Susmitha,

In fact, I'm not creating any GUI status, hence, I'm not using the SET PF-STATUS command, I only use CALL SELECTION-SCREEN command and it automatically creates the screen with those 4 buttons (I think this is standard behaviour).

Thank you

Message was edited by: Ricardo Fernández Vázquez

Simha_
Employee
Employee
0 Kudos

Hi,

Use this F.M <b> RS_SET_SELSCREEN_STATUS.</b>

Check this..

U will get some idea how to exclude standard options of the application toolbar.

Try this code..

it works..

DATA name(20) TYPE c.

DATA itab TYPE TABLE OF sy-ucomm.

AT SELECTION-SCREEN OUTPUT.

APPEND 'NONE' TO itab.

APPEND 'SPOS' TO ITAB.

p = sy-ucomm.

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

p_status = sy-pfkey

TABLES

p_exclude = itab.

cheers,

Simha.

former_member184569
Active Contributor
0 Kudos

Hi Ric,

If you dont require those buttons, then you can delete those button in the layout through Screen painter SE51.

However, if you require those button for some cases, you can add this code in the PBO of the screen.

LOOP AT SCREEN.

IF SCREEN-NAME = 'CHECK'.

SCREEN-ACTIVE = 0.

SCREEN-INVISIBLE = 1.

MODIFY SCREEN.

ELSEIF SCREEN-NAME = 'SAVE'.

SCREEN-ACTIVE = 0.

SCREEN-INVISIBLE = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Hope that helps.

Thanks,

Susmitha