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: 

dynamic screen problems

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi legend,

check these links:

http://www.sapgenie.com/abap/example_code.htm

http://www.sapgenie.com/abap/

reward if helpful.

regards,

keerthi.

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

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

0 Kudos

thanks so much! i got the point.

0 Kudos

Please make sure to award points for all helpful answers and mark the post which has helped you solve your problem the best. Thanks.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi legend,

check these links:

http://www.sapgenie.com/abap/example_code.htm

http://www.sapgenie.com/abap/

reward if helpful.

regards,

keerthi.