‎2006 Jul 07 8:39 PM
I have looked through some posts about screen, as my understanding, 1st, define a parameter with a user command, 2nd, in at selection-screen output, use loop screen to modify the screen, but how does it know which parameter it will trigger event for? if i define param1 with user command cmd1 and param2 with user command cmd2, how to control that? I found the "at selection-screen output" only trigger the param1, but if i also want to do it use param2, how to do that? i tried to use sy-comm = 'cmd1' to check, but there is no data in sy-comm, confused.
another question, can i use "at selection-screen on param1" to make the screen dynamic? seems not, only some form or function can be added there, but not changing the screen, right?
thanks for your help.
legend
‎2006 Jul 07 9:02 PM
Hi legend,
check these links:
http://www.sapgenie.com/abap/example_code.htm
reward if helpful.
regards,
keerthi.
‎2006 Jul 07 8:46 PM
Usually the user commands tied to parameters are only used for checkboxes or radiobuttons, you can specific two different user commands for two parameters.
parameters: p_check1 as checkbox user-command ck1.
parameters: p_check2 as checkbox user-command ck2.
at selection-screen.
case sy-ucomm.
when 'CK1'.
message w001(00) with 'You have check P_CHECK1'.
when 'CK2'.
message w001(00) with 'You have check P_CHECK2'.
endcase.
Regards,
Rich Heilman
‎2006 Jul 07 8:50 PM
You can make changes to the screen in the AT SELECTION-SCREEN OUTPUT event. Please see this example.
report zrich_0001.
parameters: p_check1 as checkbox user-command ck1.
parameters: p_check2 as checkbox user-command ck2.
parameters: p_field1 type c,
p_field2 type c.
at selection-screen output.
loop at screen.
if ( screen-name = 'P_FIELD1'
and p_check1 = space )
or ( screen-name = 'P_FIELD2'
and p_check2 = space ).
screen-input = '0'.
else.
screen-input = '1'.
endif.
modify screen.
endloop.
at selection-screen.
case sy-ucomm.
when 'CK1'.
* message w001(00) with 'You have check P_CHECK1'.
when 'CK2'.
* message w001(00) with 'You have check P_CHECK2'.
endcase.
Regards,
Rich Heilman
‎2006 Jul 08 3:56 AM
‎2006 Jul 08 1:18 PM
‎2006 Jul 07 9:02 PM
Hi legend,
check these links:
http://www.sapgenie.com/abap/example_code.htm
reward if helpful.
regards,
keerthi.