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

Dynamic Selection screen modification

Former Member
0 Likes
4,877

Hi,

I have two radio buttons R_A and R_B and 2 parameters P_A and P_B on selsection screen

When i click on R_A , P_A should be visible ---> It Works

When i click on R_B , P_B should be visible ---> It Works

But after clicking on R_B if i click on R_A, then P_B is visble and P_A is not visible.

How should i go abt this.???

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,840

HI,

Chk this:

Selection-screen begin of block b1 WITH FRAME NO INTERVALS.
Parameters: s1 radiobutton group g1 user-command u1 default 'X',
            p_name(10) MODIF ID M1,
            p_email(20) MODIF ID M1,
            s2 radiobutton group G1.
Parameters: p_name1(10) MODIF ID M2,
            p_fax(10) MODIF ID M2.
 Selection-screen end of block b1 .

AT SELECTION-SCREEN OUTPUT.
*  IF S_BOX = 'X'.
      LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'M3'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
      ELSE.
        SCREEN-ACTIVE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

*  ENDIF.

  IF S1 = 'X'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'M2'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
      ELSEIF SCREEN-GROUP1 = 'M1'.
        SCREEN-ACTIVE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF S2 = 'X'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'M1'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
      ELSEIF SCREEN-GROUP1 = 'M2'.
        SCREEN-ACTIVE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

regards,

madhumitha

6 REPLIES 6
Read only

former_member156446
Active Contributor
0 Likes
2,840

in the at selection-screen output event.. your will find a logic like..

loop at screen.

some code ".. this is responsible for these changes.. look there..

endloop.

Read only

former_member673464
Active Contributor
0 Likes
2,840

hi,

I think you have forget to write the code for the first radio button for changing the properties of the p_a.

Regards,

Veeresh

Read only

Former Member
0 Likes
2,840

hi,

when you are checking the condition of Radio Button 1 then inside that plz check for the other parameter visibility. And if that is visible plz make it invisible.

Repeat this process for both the Radio BUttons.

I think that will solve your problem.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
2,840

Hey!!

Check out this sample code.


REPORT z_sdn.
 
PARAMETERS:
  p_num RADIOBUTTON GROUP rad1 DEFAULT 'X' USER-COMMAND abc,
  p_char RADIOBUTTON GROUP rad1.
 
PARAMETERS:
  p_num1 TYPE i MODIF ID num,
  p_num2 TYPE i MODIF ID num,
  p_char1 TYPE c MODIF ID chr,
  p_char2 TYPE c MODIF ID chr.
 
 
AT SELECTION-SCREEN OUTPUT.
  IF p_num EQ 'X'.
    LOOP AT SCREEN.
      IF screen-group1 EQ 'CHR'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 EQ 'NUM'.
        screen-active = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.


Regards

Abhijeet Kulshreshtha

Read only

Former Member
0 Likes
2,841

HI,

Chk this:

Selection-screen begin of block b1 WITH FRAME NO INTERVALS.
Parameters: s1 radiobutton group g1 user-command u1 default 'X',
            p_name(10) MODIF ID M1,
            p_email(20) MODIF ID M1,
            s2 radiobutton group G1.
Parameters: p_name1(10) MODIF ID M2,
            p_fax(10) MODIF ID M2.
 Selection-screen end of block b1 .

AT SELECTION-SCREEN OUTPUT.
*  IF S_BOX = 'X'.
      LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'M3'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
      ELSE.
        SCREEN-ACTIVE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.

*  ENDIF.

  IF S1 = 'X'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'M2'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
      ELSEIF SCREEN-GROUP1 = 'M1'.
        SCREEN-ACTIVE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF S2 = 'X'.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'M1'.
        SCREEN-ACTIVE = '0'.
        MODIFY SCREEN.
      ELSEIF SCREEN-GROUP1 = 'M2'.
        SCREEN-ACTIVE = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

regards,

madhumitha

Read only

Former Member
0 Likes
2,840

Hi Sap User,

refer to the code below:

parameters:
  p_a type c modif id aaa,
  p_b type c modif id bbb,
  r_a radiobutton group rad default 'X' user-command x,
  r_b radiobutton group rad.

at selection-screen output.

if r_a = 'X'.
  loop at screen.
   if screen-group1 = 'BBB'.
    screen-active = 0.
    screen-invisible = 1.
    modify screen.
   endif.
   endloop.

elseif r_b = 'X'.

  loop at screen.
   if screen-group1 = 'AAA'.
    screen-active = 0.
    screen-invisible = 1.
    modify screen.
   endif.
   endloop.
endif.

With luck,

Pritam.