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 disabled a block(frame ) based on radiobutton checked?

Former Member
0 Kudos

Hi all,

how to disabled a block(frame ) based on radiobutton checked?

I am having 2 radiobutton .If I checked ist button the one block should be disable and 2nd enabled.

Please suggest?

Thanks in Advance...

5 REPLIES 5

Former Member
0 Kudos

Hi Steve,

I guess it cannot be done on block level & you have to do it in this way only that i have show below using MODIF ID:

Parameters:
  r1 radiobutton group rad default 'X' user-command aaa,
  r2 radiobutton group rad.

Selection-Screen:
  Begin of block b1 with frame.

Parameters:
  Char1(10) type c modif id efg,
  Char2(10) type c modif id efg.

Selection-Screen:
  End of block b1.

Selection-Screen:
  Begin of block b2 with frame.

Parameters:
  Char3(10) type c modif id abc,
  Char4(10) type c modif id abc.

Selection-Screen:
  End of block b2.

At Selection-screen output.

  If r1 = 'X'.
    Loop at screen.
      If screen-group1 = 'ABC'.
        Screen-input = 0.
        Modify screen.
      Endif.
    Endloop.
  Else.
    Loop at screen.
      If screen-group1 = 'EFG'.
        Screen-input = 0.
        Modify screen.
      Endif.
    Endloop.
  Endif.

With luck,

Pritam.

Former Member
0 Kudos

HI,

Check this code..

PARAMETERS p_check1 TYPE c RADIOBUTTON GROUP gr1 USER-COMMAND usd DEFAULT 'X'.
PARAMETERS p_check2 TYPE c RADIOBUTTON GROUP gr1.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS p_name1 TYPE char30 MODIF ID MF1.
PARAMETERS p_age1 TYPE i MODIF ID MF1.
SELECTION-SCREEN :END OF BLOCK b1.
SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS p_name2 TYPE char30 MODIF ID MF2.
PARAMETERS p_age2 TYPE i MODIF ID MF2 .
SELECTION-SCREEN :END OF BLOCK b2.



AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF p_check1 EQ 'X'.
      IF screen-group1 CS 'MF1'.
        screen-input = 1.
        screen-active = 1.
      ELSEIF screen-group1 CS 'MF2' .
        screen-input = 0.
        screen-active = 1.
      ENDIF.
    ELSEIF p_check2 EQ 'X'.
      IF screen-group1 CS 'MF2'.
        screen-input = 1.
        screen-active = 1.
      ELSEIF screen-group1 CS 'MF1' .
        screen-input = 0.
        screen-active = 1.
      ENDIF..
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Former Member
0 Kudos

Hi Steve,

to disable the block we need to create a block with the screen group and disable dat screen group when ur Radio Button is checked..

Eg :-

PARAMETERS: p_down radiobutton group radi USER-COMMAND set.

AT SELECTION-SCREEN OUTPUT.

*-- Carry out 'Screen Field' Modifications to make the relevant

*-- screen-fields invisible if the radio button is checked

PERFORM screen_modification.

FORM screen_modification .

LOOP AT SCREEN.

IF p_down IS INITIAL AND screen-group1 = 'GR1'.

screen-active = 1. "Activate

screen-input = 1. "Activate

ELSEIF p_down IS NOT INITIAL AND screen-group1 = 'GR1'.

screen-active = 0. "Deactivate

screen-input = 0. "Deactivate

MODIFY SCREEN.

ENDLOOP. "LOOP AT SCREEN.

ENDFORM. " screen_modification

Hopefully dis info will be helpful for u.

Regards

Karan Arya

Former Member
0 Kudos

Hi Steve,

you can do one thing


parameters: date like sy-datum,
                        division (1) type c.
parameters: r1 radiobutton group rad1,
                        r2 radiobutton group rad2.

How to change below code into ABAP/4 language
if r1 ne space.
  division = invisible.
elseif r2 ne space.
  divisio = visible.
endif.

thank you

A:

Try something like this in the even AT SELECTION-SCREEN or AT SELECTION-SCREEN

OUTPUT (whichever makes sense for what you are doing...)

LOOP AT SCREEN.

  If screen-name = division.
    if r1 ne space.
      screen-invisible = 1.
    elseif r2 ne space.
      screen-invisible = 0.
    endif.
    modify screen.
  endif.

ENDLOOP.

Regards,

Prabhudas

Former Member
0 Kudos

solved