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

gui status in selection screen

Former Member
0 Likes
2,844

hi,

How to add a gui status in a selection screen

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,869

Hi,

You can use FM RS_SET_SELSCREEN_STATUS at event AT SELECTION-SCREEN OUTPUT.


AT SELECTION-SCREEN OUTPUT.
  IF SY-DYNNR = 1000.
    CALL FUNCTION 'RS_SET_SELSCREEN_STATUS' 
      EXPORTING
        P_STATUS = 'SELK           "your status
      TABLES
        P_EXCLUDE = EXCLUDE
      EXCEPTIONS
        OTHERS = 1.
   ENDIF.

Also check program DEMO_SEL_SCREEN_STATUS and this link.

https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/t...

Regards,

Ferry Lianto

hi,

How to add a gui status in a selection screen

9 REPLIES 9
Read only

Former Member
0 Likes
1,869

Please use SET PF-STATUS stmt in <b>INITIALIZATION</b> Event.

Kind Regards

Eswar

Read only

Former Member
0 Likes
1,870

Hi,

You can use FM RS_SET_SELSCREEN_STATUS at event AT SELECTION-SCREEN OUTPUT.


AT SELECTION-SCREEN OUTPUT.
  IF SY-DYNNR = 1000.
    CALL FUNCTION 'RS_SET_SELSCREEN_STATUS' 
      EXPORTING
        P_STATUS = 'SELK           "your status
      TABLES
        P_EXCLUDE = EXCLUDE
      EXCEPTIONS
        OTHERS = 1.
   ENDIF.

Also check program DEMO_SEL_SCREEN_STATUS and this link.

https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/t...

Regards,

Ferry Lianto

Read only

0 Likes
1,869

is it to keep in INITILIZATION OR AT SELECTION-SREEN OUTPUT

can you explain

thank you

Read only

0 Likes
1,869

Hi Sarath

You can use any of the above. Both are just like alternative methods of performing the task.

Ferry,

Correct me if i am wrong??? I guess we can perform the same via SET PF-STATUS in INITIALIZATION event...

Kind Regards

Eswar

Message was edited by:

Eswar Rao Boddeti

Read only

Former Member
0 Likes
1,869

Hi Sarath,

If you are trying to set a gui status in selection screen then it should be done in the event AT SELECTION-SCREEN OUTPUT.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,869

TRY THIS CODE

DATA : ITABS LIKE RSEXFCODE OCCURS 5,

WTAB1 LIKE RSEXFCODE.

  • ADD WHAT ARE THE FN CODE YOU DONT WANT IN THE SELECTION *SCREEN TO ITABS.

IF SY-DYNNR = '1000'.

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

P_STATUS = SY-PFKEY

P_PROGRAM = SY-REPID

TABLES

P_EXCLUDE = ITABS

.

ENDIF.

REGARDS

shiba dutta

Message was edited by:

SHIBA DUTTA

Read only

Former Member
0 Likes
1,869

Hi Eswar,

I never done at initialization. I usually set SET PF-STATUS at START-OF-SELECTION, AT LINE-SELECTION or AT USER-COMMAND event.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,869

hi sarath ,

i will tell u a simplest way to add gui status to selection screen ....without writing any code to ur program....

goto se 80

select 'PROGRAM' in the drop-down box..

enter your 'program name' below ...

and press enter key..

right click on ur program name (object name)

choose create option...

and then choose GUI status...

enter the gui satus name and short description..

and then finallly u can set

application toolbar

or menu bar

or function keys

as gui status for ur program on the selection screen....

Read only

Former Member
0 Likes
1,869

hi..

You can try out the following steps.

1.go to se80.

2.enter your program name.

3.right click on the program name and create a gui status.

4.Activate the gui status.

5.now in your code,

add the following statements.

SET PF-STATUS 'ZTH_GUI'.

AT USER-COMMAND.

for example consider this ..

DATA : OK_CODE TYPE SY-UCOMM.

SET PF-STATUS 'ZTH_GUI'.

AT USER-COMMAND.

CASE OK_CODE.

WHEN 'BACK'.

LEAVE PROGRAM.

WHEN 'EXIT'.

LEAVE PROGRAM.

WHEN 'CANCEL'.

LEAVE PROGRAM.

ENDCASE.

hope this helps you.