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

SSCRFIELDS-UCOMM

Former Member
0 Likes
6,474

Hi abap experts,

I have set a button on the toolbar, however I could not code it.

When clicked on I want to redirect the user to another screen with , for example,call screen 100.

How can I code the function.

Should I use case endcase.

Sample code please.

Thanks.

5 REPLIES 5
Read only

Former Member
0 Likes
2,684

Hi

You need to code the same logic as follows: assuming ok_code of type sy-ucomm.

case ok_code.

when < function code for the button>

call screen <screen which you want to call>

endcase.

Hope this helps

reward if useful

regards

swati

Read only

Former Member
0 Likes
2,684

Hi,

try this

if it is a module pool then

write the following in pai event of the particular scrrren.

case sy-ucomm.

when 'your function code ' in caps

CALL SCREEN 100.

when 'OTHERS'.

endcase.

if it is an alv then

FORM USER_COMMAND USING PV_UCOMM LIKE SY-UCOMM "#EC NEEDED

SELFIELD TYPE SLIS_SELFIELD. "#EC NEEDED

CASE PV_UCOMM.

when ' your code'.

call screen 100.

endcase.

you have to use the user_command in you alv functiion module

endform.

thanks & regards,

Venkatesh

Read only

varma_narayana
Active Contributor
0 Likes
2,684

Hi...

This is the Code that works for u.

REPORT zselfile1 .

TABLES:sscrfields.

**Create the Additional Selection screen to input filename

SELECTION-SCREEN: BEGIN OF SCREEN 10.

PARAMETERS: p_file TYPE rlgrap-filename.

SELECTION-SCREEN: END OF SCREEN 10.

**Create Application Toolbar Button on the Standard selection Screen

SELECTION-SCREEN FUNCTION KEY 1. "Its fcode will be FC01

PARAMETERS : p_werks TYPE marc-werks.

INITIALIZATION.

sscrfields-functxt_01 = 'Enter File'. "Assign the Text to the Button

AT SELECTION-SCREEN.

CASE sscrfields-ucomm. "Check the Fcode

WHEN 'FC01'.

CALL SELECTION-SCREEN 10 STARTING AT 5 8 ENDING AT 85 20.

ENDCASE.

<b>Reward if Helpful</b>

Read only

Former Member
0 Likes
2,684

hi,

try this way out...

[code]

TABLES SSCRFIELDS.

CASE SSCRFIELDS-UCOMM.

WHEN 'CLI1'. " code for display.

CLEAR SSCRFIELDS-UCOMM.

CALL SCREEN 0100.

WHEN 'CLI2'. " code for maintain.

CLEAR SSCRFIELDS-UCOMM.

CALL SCREEN 0100.

when others.

ENDCASE.

/code]

reward if useful.

Thanks,

Madhura

Read only

Former Member