Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

dynamic display of selection screen

Hi,

My selection screen has 2 radio buttons rb1,rb2 and 4 select options which are obligatory. now if i select rb1 i should allow be allowed to give selection values for 2 select-options. if i select rb2 i should be able to enter selection parameters for other to select options. can some one help me how to program this?

This is my selection screen.

PARAMETERS: rb1 RADIOBUTTON GROUP rb1.

PARAMETERS: rb2 RADIOBUTTON GROUP rb1.

SELECTION-SCREEN: SKIP 1.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.

SELECT-OPTIONS: s_auart FOR vbak-auart DEFAULT 'ZRE'

NO INTERVALS OBLIGATORY.

SELECT-OPTIONS: s_date FOR vbak-erdat OBLIGATORY.

SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.

SELECT-OPTIONS: s_tanum FOR ltak-tanum.

SELECT-OPTIONS: s_bdatu FOR ltak-bdatu OBLIGATORY.

SELECTION-SCREEN: END OF BLOCK b2.

Thanks,

Challa.

Tags:
Former Member
Former Member replied

Hope this helps.

TABLES: vbak, ltak.
DATA:
  err_sw.
PARAMETERS: rb1 RADIOBUTTON GROUP rb1 USER-COMMAND sel DEFAULT 'X'.
PARAMETERS: rb2 RADIOBUTTON GROUP rb1.

SELECTION-SCREEN: SKIP 1.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS: s_auart FOR vbak-auart DEFAULT 'ZRE'
NO INTERVALS MODIF ID rb1.
SELECT-OPTIONS: s_date FOR vbak-erdat MODIF ID rb1.
SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
SELECT-OPTIONS: s_tanum FOR ltak-tanum MODIF ID rb2.
SELECT-OPTIONS: s_bdatu FOR ltak-bdatu MODIF ID rb2.
SELECTION-SCREEN: END OF BLOCK b2.

*____________________________________________ Screen Actions
AT SELECTION-SCREEN OUTPUT.
  IF rb1 = 'X'.
    PERFORM hide_rb2_options.
  ELSE.
    PERFORM hide_rb1_options.
  ENDIF.

INITIALIZATION.

START-OF-SELECTION.
  CLEAR err_sw.
  IF rb1 = 'X'.
    IF s_auart IS INITIAL
    OR s_date IS INITIAL.
      MESSAGE i208(00) WITH 'Required field not entered'.
      err_sw = 'X'.
    ENDIF.
  ELSE.
    IF s_tanum IS INITIAL
    OR s_bdatu IS INITIAL.
      MESSAGE i208(00) WITH 'Required field not entered'.
      err_sw = 'X'.
    ENDIF.
  ENDIF.

  CHECK err_sw NE 'X'.

  WRITE:/ 'Hi!'.

*&---------------------------------------------------------------------*
*&      Form  hide_rb2_options
*&---------------------------------------------------------------------*
FORM hide_rb2_options.
  LOOP AT SCREEN.
    CASE screen-group1.
      WHEN 'RB1'.
        screen-active = 1.
        MODIFY SCREEN.
      WHEN 'RB2'.
        screen-active = 0.
        MODIFY SCREEN.
    ENDCASE.
  ENDLOOP.
ENDFORM.                    " hide_rb2_options
*&---------------------------------------------------------------------*
*&      Form  hide_rb1_options
*&---------------------------------------------------------------------*
FORM hide_rb1_options.
  LOOP AT SCREEN.
    CASE screen-group1.
      WHEN 'RB2'.
        screen-active = 1.
        MODIFY SCREEN.
      WHEN 'RB1'.
        screen-active = 0.
        MODIFY SCREEN.
    ENDCASE.
  ENDLOOP.

ENDFORM.                    " hide_rb1_options

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question