Application Development and Automation 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: 
Read only

code for hiding/showing button on application toolbar

Former Member
0 Likes
10,680

Hi all,

i created one new button in gui of code ie01,02. Now requires that it should be shown under certain conditions and hidden under others kindly help...

Very urgent.

1 ACCEPTED SOLUTION
Read only

Former Member
4,021

Hi,

1) set pf-status 'XXXX' excluding 'BUTTON NAME'. --> this will remove the button,

2) even you can use Internal table to Exclude more than one button

Append 'Button names' to ITAB

SET PF-STATUS XXXXX EXCLUDING itab.

Regards

Sudheer

5 REPLIES 5
Read only

Former Member
0 Likes
4,021

DATA: BEGIN OF app_tab OCCURS 0,

fcode LIKE rsmpe-func,

END OF app_tab.

IF w_mode NE 'B'. "Display

MOVE 'SAVE' TO app_tab.

APPEND app_tab.

MOVE 'SALL' TO app_tab.

APPEND app_tab.

MOVE 'DALL' TO app_tab.

APPEND app_tab.

MOVE 'NEW' TO app_tab.

APPEND app_tab.

MOVE 'COPY' TO app_tab.

APPEND app_tab.

MOVE 'DEL' TO app_tab.

APPEND app_tab.

SET PF-STATUS '0100' EXCLUDING app_tab.

ELSE.

MOVE 'COPY' TO app_tab.

APPEND app_tab.

SET PF-STATUS '0100' EXCLUDING app_tab.

ENDIF.

If the above mentioned code is helpful please reward points.

Cheers

Read only

sridharreddy_kondam
Active Contributor
0 Likes
4,021

Hi,

Use SET PF-STATUS 'commandname' EXCLUDING itab.

So hadle this for the buttons which u want to make inactive

...

But if u want to hide then then u have to us SCREEN options..

Hope this will get u some idea...

Regards

Sridhar Reddy k

Read only

0 Likes
4,021

The other button should remain the same but onlly the new button should have the functionality of switchin on/off based on condition... further where to define the conditions

Read only

Former Member
4,022

Hi,

1) set pf-status 'XXXX' excluding 'BUTTON NAME'. --> this will remove the button,

2) even you can use Internal table to Exclude more than one button

Append 'Button names' to ITAB

SET PF-STATUS XXXXX EXCLUDING itab.

Regards

Sudheer

Read only

Former Member
0 Likes
4,021

Hi,

Check out this program. This might b helpful.

REPORT demo_list_set_pf_status_1.

DATA: fcode TYPE TABLE OF sy-ucomm,

wa_fcode TYPE sy-ucomm.

START-OF-SELECTION.

wa_fcode = 'FC1 '. APPEND wa_fcode TO fcode.

wa_fcode = 'FC2 '. APPEND wa_fcode TO fcode.

wa_fcode = 'FC3 '. APPEND wa_fcode TO fcode.

wa_fcode = 'FC4 '. APPEND wa_fcode TO fcode.

wa_fcode = 'FC5 '. APPEND wa_fcode TO fcode.

wa_fcode = 'PICK'. APPEND wa_fcode TO fcode.

SET PF-STATUS 'TEST'.

WRITE: 'PF-Status:', sy-pfkey.

AT LINE-SELECTION.

IF sy-lsind = 20.

SET PF-STATUS 'TEST' EXCLUDING fcode.

ENDIF.

WRITE: 'Line-Selection, SY-LSIND:', sy-lsind,

/ ' SY-PFKEY:', sy-pfkey.

AT USER-COMMAND.

IF sy-lsind = 20.

SET PF-STATUS 'TEST' EXCLUDING fcode.

ENDIF.

WRITE: 'User-Command, SY-LSIND:', sy-lsind,

/ ' SY-UCOMM:', sy-ucomm,

/ ' SY-PFKEY:', sy-pfkey.

Regards,

Sailaja