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

report

Former Member
0 Likes
726

hi frnds,

in my requirment , in selection screen we have 2 radio buttons, if i select radio button one, two input fields will be enable and other two will be disable.

wt can i do for it?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
709

HI

At selection-screen-output.

loop at screen.

if radio1 = 'X'.

if screen-name = 'field1' or screen-name = 'field2'.

screen-output = 0.

modify screen.

endif.

if screen-name = 'field3' or screen-name = 'field4'.

screen-output = 1.

modify screen.

endif.

endif.

if radio2 = 'X'.

if screen-name = 'field1' or screen-name = 'field2'.

screen-output = 1.

modify screen.

endif.

if screen-name = 'field3' or screen-name = 'field4'.

screen-output = 0.

modify screen.

endif.

endif.

endloop.

Regards

Aditya

6 REPLIES 6
Read only

Former Member
0 Likes
710

HI

At selection-screen-output.

loop at screen.

if radio1 = 'X'.

if screen-name = 'field1' or screen-name = 'field2'.

screen-output = 0.

modify screen.

endif.

if screen-name = 'field3' or screen-name = 'field4'.

screen-output = 1.

modify screen.

endif.

endif.

if radio2 = 'X'.

if screen-name = 'field1' or screen-name = 'field2'.

screen-output = 1.

modify screen.

endif.

if screen-name = 'field3' or screen-name = 'field4'.

screen-output = 0.

modify screen.

endif.

endif.

endloop.

Regards

Aditya

Read only

Former Member
0 Likes
709

HI,

work with:

AT SELECTION-SCREEN

loop at screen.

....

modify screen.

endloop.

Regards

Nicole

Read only

former_member673464
Active Contributor
0 Likes
709

hi,

You can use the loop at screen for changing the properties of the fields. You can create radio buttons with function codes for it.

eg:

TABLES sscrfields.

PARAMETERS: rad1 RADIOBUTTON GROUP rad USER-COMMAND radio,

rad2 RADIOBUTTON GROUP rad,

rad3 RADIOBUTTON GROUP rad.

PARAMETERS check AS CHECKBOX USER-COMMAND check.

Regards,

Veeresh

Read only

Former Member
0 Likes
709

HI,

PARAMETERS: P_A1 RADIOBUTTON GROUP R1 USER-COMMAND ACD.
PARAMETERS: P_S1(10) TYPE C MODIF ID S1.
PARAMETERS: P_A2 RADIOBUTTON GROUP R1.
PARAMETERS: P_S2(10) TYPE C MODIF ID S2.
data: i_mara like mara occurs 0 .
data: fs_mara like mara.
AT SELECTION-SCREEN OUTPUT.
  IF P_A2 IS NOT INITIAL.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'S1'.
        SCREEN-INPUT = '0'.
        SCREEN-INVISIBLE = '1'.
        MODIFY SCREEN.
      ENDIF.
      IF SCREEN-GROUP1 = 'S2'.
        SCREEN-INPUT = '1'.
        SCREEN-INVISIBLE = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'S2'.
        SCREEN-INPUT = '0'.
        SCREEN-INVISIBLE = '1'.
        MODIFY SCREEN.
      ENDIF.
      IF SCREEN-GROUP1 = 'S1'.
        SCREEN-INPUT = '1'.
        SCREEN-INVISIBLE = '2'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.

Read only

sachin_mathapati
Contributor
0 Likes
709

Hi Sundeep,

Use at User-command while declaring the radio button.

Eg. PARAMETERS:

rb_r1 RADIOBUTTON GROUP gr3 USER-COMMAND cmd1 .

And at selection screen output event , loop at screen and disable/enable the fields required.

Eg :

AT SELECTION-SCREEN OUTPUT.

IF rb_r1 = 'X' .

CLEAR pa_mpc.

LOOP AT SCREEN.

IF screen-name = 'PA_MPC'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

Regards,

Sachin M M

Read only

Former Member
0 Likes
709

hey thr,

well u can do that simply as follows.

SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETER : APPLI RADIOBUTTON GROUP RAD USER-COMMAND RADIO DEFAULT 'X',

PRESENT RADIOBUTTON GROUP RAD.

SELECT-OPTIONS : APPLI2 FOR PAPPLI MODIF ID SP1 NO INTERVALS NO-EXTENSION.

PARAMETERS: PRESENT2 TYPE DYNPREAD-FIELDNAME MODIF ID SP2.

LOOP AT SCREEN.

IF APPLI = 'X'.

IF SCREEN-GROUP1 = 'SP2'.

SCREEN-INPUT = '0'.

SCREEN-INVISIBLE = '0'.

SCREEN-REQUIRED = '0'.

MODIFY SCREEN.

ENDIF.

ELSEIF PRESENT = 'X'.

IF SCREEN-GROUP1 = 'SP1'.

SCREEN-INPUT = '0'.

SCREEN-INVISIBLE = '0'.

SCREEN-REQUIRED = '0'.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

just cahnge the parameter names nd all according to ur requiremnet....

it wud do the trick for u...

hope it helps...

do reward points if useful

cheers