‎2007 Aug 17 9:35 AM
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.
‎2007 Aug 17 9:39 AM
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
‎2007 Aug 17 9:41 AM
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
‎2007 Aug 17 9:45 AM
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>
‎2007 Aug 17 10:06 AM
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
‎2007 Aug 17 10:13 AM