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: 

how to use a radio button in enabling/disabling a text box in report progra

Former Member
0 Kudos

Hi,

Could any please let me know, how to use a radio button in enabling/disabling a text box in report program.

6 REPLIES 6

Former Member
0 Kudos

check the following code.

just copy and paste.

and execute.

SELECTION-SCREEN: BEGIN OF BLOCK A.

PARAMETERS: C1 RADIOBUTTON GROUP G1 USER-COMMAND flag ,

C2 RADIOBUTTON GROUP G1 .

PARAMETERS: D1 TYPE I MODIF ID BL2.

PARAMETERS: D2 TYPE I.

SELECTION-SCREEN: END OF BLOCK A.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF C1 = 'X' AND C2 <> 'X' AND

screen-group1 = 'BL2'.

screen-active = '1'.

MODIFY SCREEN.

ENDIF.

IF C2 = 'X' AND C1 <> 'X' AND

screen-group1 = 'BL2'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Former Member
0 Kudos

sorry check this code.it's the correct one

SELECTION-SCREEN: BEGIN OF BLOCK A.

PARAMETERS: C1 RADIOBUTTON GROUP G1 USER-COMMAND flag ,

C2 RADIOBUTTON GROUP G1 .

PARAMETERS: D1 TYPE I MODIF ID BL2.

PARAMETERS: D2 TYPE I.

SELECTION-SCREEN: END OF BLOCK A.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF C1 = 'X' AND C2 ne 'X' AND

screen-group1 = 'BL2'.

screen-active = '1'.

MODIFY SCREEN.

ENDIF.

IF C2 = 'X' AND C1 ne 'X' AND

screen-group1 = 'BL2'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Former Member
0 Kudos

check this code this is the correct one

SELECTION-SCREEN: BEGIN OF BLOCK A.

PARAMETERS: C1 RADIOBUTTON GROUP G1 USER-COMMAND flag ,

C2 RADIOBUTTON GROUP G1 .

PARAMETERS: D1 TYPE I MODIF ID BL2.

PARAMETERS: D2 TYPE I.

SELECTION-SCREEN: END OF BLOCK A.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF C1 = 'X' AND C2 ne 'X' AND

screen-group1 = 'BL2'.

screen-active = '1'.

MODIFY SCREEN.

ENDIF.

IF C2 = 'X' AND C1 ne 'X' AND

screen-group1 = 'BL2'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Former Member
0 Kudos

&----


*& Report ZMR_RADIO_BUTTONS

*&

&----


*&

*&

&----


REPORT ZMR_RADIO_BUTTONS.

PARAMETERS : R1 RADIOBUTTON GROUP G1,

R2 RADIOBUTTON GROUP G1.

PARAMETERS : A1 TYPE I,

A2 TYPE I.

AT SELECTION-SCREEN OUTPUT.

*initialization.

IF R1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'A1'.

  • SCREEN-INPUT = 0.

SCREEN-ACTIVE = 0.

ENDIF.

IF SCREEN-NAME = 'A2'.

  • SCREEN-INPUT = 0.

SCREEN-ACTIVE = 1.

ENDIF.

ENDLOOP.

ENDIF.

IF R2 = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'A1'.

  • SCREEN-INPUT = 0.

SCREEN-ACTIVE = 1.

ENDIF.

IF SCREEN-NAME = 'A2'.

  • SCREEN-INPUT = 0.

SCREEN-ACTIVE = 0.

ENDIF.

modify screen.

ENDLOOP.

ENDIF.

START-OF-SELECTION.

*IF R1 = 'X'.

*LOOP AT SCREEN.

  • IF SCREEN-NAME = 'A1'.

  • SCREEN-INPUT = 0.

    • SCREEN-ACTIVE = 1.

  • ENDIF.

*ENDLOOP.

*ENDIF.

*IF R2 = 'X'.

*LOOP AT SCREEN.

  • IF SCREEN-NAME = 'A2'.

  • SCREEN-INPUT = 0.

    • SCREEN-ACTIVE = 0.

  • ENDIF.

*ENDLOOP.

*

*ENDIF.

Former Member
0 Kudos

Hi,

Check this 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

Former Member
0 Kudos

Hi Priyadarshini,

Try it like this:

Parameters:
  char1(5) type c modif id chr,
  char2(5) type c modif id che,
  r1 RADIOBUTTON GROUP rad default 'X' USER-COMMAND fcode,
  r2 radiobutton group rad.


at selection-screen output.

  if R1 = 'X'.
    Loop at screen.
      if screen-group1 = 'CHR'.
      screen-active = 0.
      modify screen.
      endif.
    Endloop.
  elseif R2 = 'X'.
    Loop at screen.
      if screen-group1 = 'CHE'.
      screen-active = 0.
      modify screen.
      endif.
    Endloop.
  Endif.

With luck,

Pritam.