Skip to Content
0

How to hide all block in selection screen?

Oct 27, 2016 at 09:09 AM

135

avatar image
Former Member

Hi,

I want to hide all blocks of Selection-Screen.

Addition to that I am having Radio Buttons.

As I am having 2 blocks, both of them should be hidden after execution of my t-code,

and after selecting Radio Button it should show either Block 1 or Block 2.

According to that I have written logic.

But I am unable to display according to my requirement. Logic is given in CODE.

Please Help,

Regards,

Abhishek S.

SPAN {font-family: "Courier New";font-size: 10pt;color: #000000;background: #FFFFFF;}.L0S31 {font-style: italic;color: #808080;}.L0S32 {color: #3399FF;}.L0S33 {color: #4DA619;}.L0S52 {color: #0000FF;}.L0S55 {color: #800080;}.L0S70 {color: #808080;}

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE T2.
PARAMETERS : S_RADIO1 RADIOBUTTON GROUP RG1 USER-COMMAND UC DEFAULT 'X',
S_RADIO2 RADIOBUTTON GROUP RG1,
S_RADIO3 RADIOBUTTON GROUP RG1.
SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE t1.
SELECT-OPTIONS : S_WERKS FOR J_1IRG23D-WERKS OBLIGATORY MODIF ID SC1,
S_MATNR FOR J_1IRG23D-MATNR MODIF ID SC1,
S_LIFNR FOR J_1IRG23D-LIFNR MODIF ID SC1,
S_DOCNO FOR J_1IRG23D-DOCNO MODIF ID SC1,
S_CPUDT FOR J_1IRG23D-CPUDT MODIF ID SC1.
SELECTION-SCREEN : END OF BLOCK b1.

SELECTION-SCREEN : BEGIN OF BLOCK B3 WITH FRAME TITLE T3.
SELECT-OPTIONS : S_WERKS2 FOR V_EQUI_EQBS_SML-WERK OBLIGATORY MODIF ID SC2,
S_LGORT FOR V_EQUI_EQBS_SML-LAGER MODIF ID SC2,
S_MATNR2 FOR V_EQUI_EQBS_SML-MATNR MODIF ID SC2,
S_MTART FOR MARA-MTART MODIF ID SC2.
SELECTION-SCREEN : END OF BLOCK B3.

AT SELECTION-SCREEN OUTPUT.

* LOOP AT SCREEN.
* CASE screen-group1.
* WHEN 'SC1'.
* screen-active = 0.
* screen-input = 0.
* MODIFY SCREEN.
* WHEN 'SC1'.
* screen-active = 0.
* screen-input = 0.
* MODIFY SCREEN.
* ENDCASE.
* ENDLOOP.

IF S_RADIO1 = 'X'.
PERFORM HIDE_OPTION.
ELSEIF S_RADIO2 = 'X'.
PERFORM HIDE_OPTION.
ELSEIF S_RADIO3 = 'X'.
PERFORM UNHIDE_OPTION.
ENDIF.

* &---------------------------------------------------------------------*
* & Form HIDE_OPTION
* &---------------------------------------------------------------------*
* text
* ----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
* ----------------------------------------------------------------------*
FORM HIDE_OPTION .
LOOP AT SCREEN.
CASE screen-group1.
WHEN 'SC1'.
screen-active = 1.
screen-input = 1.
MODIFY SCREEN.
WHEN 'SC2'.
screen-active = 0.
screen-input = 0.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
ENDFORM. " HIDE_OPTION

* &---------------------------------------------------------------------*
* & Form UNHIDE_OPTION
* &---------------------------------------------------------------------*
* text
* ----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
* ----------------------------------------------------------------------*
FORM UNHIDE_OPTION .
LOOP AT SCREEN.
CASE screen-group1.
WHEN 'SC1'.
screen-active = 0.
screen-input = 0.
MODIFY SCREEN.
WHEN 'SC2'.
screen-active = 1.
screen-input = 1.
MODIFY SCREEN.
ENDCASE.
ENDLOOP.
ENDFORM. " UNHIDE_OPTION

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Nov 01, 2016 at 05:17 PM
0
TABLES:
  j_1irg23d,
  v_equi_eqbs_sml,
  mara.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE t2.
PARAMETERS : s_radio1 RADIOBUTTON GROUP rg1 USER-COMMAND uc DEFAULT 'X',
             s_radio2 RADIOBUTTON GROUP rg1,
             s_radio3 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE t1.
SELECT-OPTIONS : s_werks FOR j_1irg23d-werks OBLIGATORY MODIF ID sc1,
s_matnr FOR j_1irg23d-matnr MODIF ID sc1,
s_lifnr FOR j_1irg23d-lifnr MODIF ID sc1,
s_docno FOR j_1irg23d-docno MODIF ID sc1,
s_cpudt FOR j_1irg23d-cpudt MODIF ID sc1.
SELECTION-SCREEN : END OF BLOCK b1.

SELECTION-SCREEN : BEGIN OF BLOCK b3 WITH FRAME TITLE t3.
SELECT-OPTIONS : s_werks2 FOR v_equi_eqbs_sml-werk OBLIGATORY MODIF ID sc2,
s_lgort FOR v_equi_eqbs_sml-lager MODIF ID sc2,
s_matnr2 FOR v_equi_eqbs_sml-matnr MODIF ID sc2,
s_mtart FOR mara-mtart MODIF ID sc2.
SELECTION-SCREEN : END OF BLOCK b3.

INITIALIZATION.
  PERFORM hide_option USING 'ALL'.

AT SELECTION-SCREEN OUTPUT.
  CASE abap_true.
    WHEN s_radio1.
      PERFORM hide_option USING 'ALL'.
    WHEN s_radio2.
      PERFORM hide_option USING 'SC1'.
    WHEN s_radio3.
      PERFORM hide_option USING 'SC2'.
  ENDCASE.

START-OF-SELECTION.

* &---------------------------------------------------------------------*
* & Form HIDE_OPTION
* &---------------------------------------------------------------------*
* text
* ----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
* ----------------------------------------------------------------------*
FORM hide_option USING ic_modif_id.

  LOOP AT SCREEN.
    CASE screen-group1.
      WHEN ic_modif_id.
        screen-active = 0.
        screen-input = 0.
        screen-invisible = 1.
        MODIFY SCREEN.
      WHEN OTHERS.
        IF ic_modif_id EQ 'ALL' AND
           ( screen-group1 EQ 'SC1' OR
             screen-group1 EQ 'SC2' ).
          screen-active = 0.
          screen-input = 0.
          screen-invisible = 1.
        ENDIF.
    ENDCASE.
    MODIFY SCREEN.
  ENDLOOP.

ENDFORM. " HIDE_OPTION

The OBLIGATORY plant parameter should be better checked in START-OF-SELECTION, because is blocks switching.

The is no need to unhide, LOOP AT SCREEN starts always with default 'visible' in your case, so only hide is required.

Share
10 |10000 characters needed characters left characters exceeded