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

Disabling a desired screen attribute .

Former Member
0 Likes
465

Hello Everyone!! My question goes as follows.

There are 2 radiobuttons belonging to the same group.For each radiobutton,there is a corresponding field in a seperate block on the same selection screen that needs to be enabled and simultaneously the other field needs to be disabled.How do I disable the other field, when at a time I can access only the first input field through the SCREEN table?

Thanks everyone in advance.I would highly appreciate your assistance.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
439

Something like this............



REPORT zrich_001.

selection-screen begin of block b1 with frame.
PARAMETERS p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
                  USER-COMMAND chk.
PARAMETERS p_rad2 RADIOBUTTON GROUP grp1.
selection-screen end of block b1.
selection-screen begin of block b2 with frame.
SELECT-OPTIONS s_datum1 FOR sy-datum MODIF ID dt1.
SELECT-OPTIONS s_datum2 FOR sy-datum MODIF ID dt2.
selection-screen end of block b2.

AT SELECTION-SCREEN OUTPUT.


  LOOP AT SCREEN.
    IF p_rad1 = 'X'.
      IF screen-group1 = 'DT2'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
    IF p_rad2 = 'X'.
      IF screen-group1 = 'DT1'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.

Regards,

Rich Heilman

Message was edited by:

Rich Heilman

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
440

Something like this............



REPORT zrich_001.

selection-screen begin of block b1 with frame.
PARAMETERS p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'
                  USER-COMMAND chk.
PARAMETERS p_rad2 RADIOBUTTON GROUP grp1.
selection-screen end of block b1.
selection-screen begin of block b2 with frame.
SELECT-OPTIONS s_datum1 FOR sy-datum MODIF ID dt1.
SELECT-OPTIONS s_datum2 FOR sy-datum MODIF ID dt2.
selection-screen end of block b2.

AT SELECTION-SCREEN OUTPUT.


  LOOP AT SCREEN.
    IF p_rad1 = 'X'.
      IF screen-group1 = 'DT2'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
    IF p_rad2 = 'X'.
      IF screen-group1 = 'DT1'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.

Regards,

Rich Heilman

Message was edited by:

Rich Heilman

Read only

Former Member
0 Likes
439

Hi,

You have set SCREEN-INPUT = 1 for enabling, and SCREEN-INPUT = 0 for disabling, at AT SELECTION-SCREEN OUTPUT event.

Just see this sample code:


REPORT  Z_JR04                                  .

SELECTION-SCREEN BEGIN OF BLOCK BL02 WITH FRAME TITLE TEXT-S20.
SELECTION-SCREEN BEGIN OF LINE.
  PARAMETER RB_VIEW RADIOBUTTON GROUP GRP0 USER-COMMAND RB1.
  SELECTION-SCREEN COMMENT (25) TEXT-S21.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
  SELECTION-SCREEN POSITION 4.
  SELECTION-SCREEN COMMENT (15) TEXT-S23.
  PARAMETER P_VAR LIKE DISVARIANT-VARIANT.
SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.
  PARAMETER RB_GEN RADIOBUTTON GROUP GRP0.
  SELECTION-SCREEN COMMENT (25) TEXT-S22.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK BL02.

*-----------------------------------------------------------------------
* I.N.I.T.I.A.L.I.Z.A.T.I.O.N.
*-----------------------------------------------------------------------
INITIALIZATION.
  RB_VIEW = 'X'.

*-----------------------------------------------------------------------
* A.T.  .S.E.L.L.E.C.T.I.O.N.  .S.C.R.E.E.N.
*-----------------------------------------------------------------------
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF RB_VIEW = 'X'.
      IF SCREEN-NAME CS 'P_VAR'.
        SCREEN-INPUT = 1.
        MODIFY SCREEN.
      ENDIF.
    ELSE.
      IF SCREEN-NAME CS 'P_VAR'.
        SCREEN-INPUT = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.

Regards,