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: 

selection screen

Former Member
0 Kudos
92

hai

i have put 3 button in the appliaction toolbar in selection screen.

at runtime , i want to disable any one of the button by pressing one button in application toolbar.

5 REPLIES 5

Former Member
0 Kudos
59

I guess we can give a try by using AT SELECTION-SCREEN, SY-UCOMM, MODIFY SCREEN to acheive this.

Kind Regards

Eswar

Former Member
0 Kudos
59

... EXCLUDING f

... EXCLUDING itab

Effect

Deactivates one or more of the status functions, so that they cannot be selected. Specify the appropriate function codes using one of the following:

a field f or a literal which contains a function code

an internal table itab which contains several function codes

This method allows you to modify the selectable functions of a status easily at runtime.

Example

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 'DELE' TO WA_TAB-FCODE.

APPEND WA_TAB TO TAB.

MOVE 'AUSW' TO WA_TAB-FCODE.

APPEND WA_TAB TO TAB.

SET PF-STATUS 'STA3' EXCLUDING TAB.

Sets the status STA3 which renders the functions with the function codes DELE and AUSW inactive.

-


suppose if u want to disable only one then write like...

SET PF-STATUS 'STA3' EXCLUDING 'AUSW'.

Regards,

Ramesh.

0 Kudos
59

hai

if u use excluding option in set pf-status it will remove the button from it.

i dont want to remove , i just want disable the button while at runtime.

Former Member
0 Kudos
59

suppose if r doing report selection screen

AT SELECTION-SCREEN, SY-UCOMM

loop screen.

disable required field..

MODIFY SCREEN to acheive this.

endloop.

Regards,

Ramesh.

Former Member
0 Kudos
59

Hi,

you can catch the function code in SY-UCOMM and then make the button invisible.

Have a look at this piece of code:

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'A'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'P'.

SCREEN-ACTIVE = '1'.

SCREEN-INPUT = '1'.

SCREEN-OUTPUT = '1'.

SCREEN-INVISIBLE = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Endcase.

Thus you can make the desired button invisible.

Hope this helps you,

Regards,

Pragya