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 Selection Screen

former_member355937
Participant
0 Kudos

Hello everyone,

In my Report program I have two option buttons and two field parameters. The fields for my field parameter will correspond with the two option button I created. Meaning, when I choose option one, the reference fields for my field parameters will be from table1 else it will be from table2. Is this possible?

Thanks a lot,

Jeff

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos

I dont think its possible. but you have have two set of parameters and based on option hide or unhide the selection-screen blocks .

Regards

Raja

5 REPLIES 5

athavanraja
Active Contributor
0 Kudos

I dont think its possible. but you have have two set of parameters and based on option hide or unhide the selection-screen blocks .

Regards

Raja

0 Kudos

Hi Jeffrey,

I think this is possible. This is a small code snippet. Try out and let me know, if I am way tangent here.



SELECTION-SCREEN BEGIN OF BLOCK blk.
PARAMETERS : p_rb1 TYPE c RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND FC,
             p_rb2 TYPE c RADIOBUTTON GROUP rad1.
SELECTION-SCREEN END OF BLOCK blk.

SELECTION-SCREEN BEGIN OF BLOCK blk_1 WITH FRAME.
PARAMETERS : p_werks1 TYPE werks_d MODIF ID bk1.
SELECTION-SCREEN END OF BLOCK blk_1.

SELECTION-SCREEN BEGIN OF BLOCK blk_2 WITH FRAME.
PARAMETERS : p_werks2 TYPE werks_d MODIF ID bk2,
             p_matnr2 TYPE matnr   MODIF ID bk2.
SELECTION-SCREEN END OF BLOCK blk_2.


AT SELECTION-SCREEN OUTPUT.
  IF p_rb1 = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'BK1'.
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        screen-active = 1.
        MODIFY SCREEN.
      ENDIF.

    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'BK2'.
        screen-active = 0.
        MODIFY SCREEN.
      ELSE.
        screen-active = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Regards,

Subramanian V.

0 Kudos

Let me re-phrase my answer.

You cannot change the reference of a parameter at runtime.

But you can have two set of parameters with different references and hide/unhide them based on the option selected.

Regards

Raja

0 Kudos

Hello Subramanian,

The code you gave is totally Awesome!!!

Thanks a lot for the info.

You guys are a real GURU!

It's been a pleasure being a member in

this community!

Thanks,

Jeff

Former Member
0 Kudos

I agree with that.

Regards,

Subramanian V.