Skip to Content
0
Former Member
May 31, 2013 at 02:18 AM

Modifying selection screen block using application toolbar pushbutton

240 Views

Hi Gurus,

Please help know how to modify the selection screen block on click of the application toolbar push button. I want to hide block2 and block3 on click of button1 and so on. Below is my code but for some reason its not working, i tried several options like using 'AT SELECTION-SCREEN OUTPUT" event as well. However please find my code below and let me know how can i achieve this. I tried searching ABAP forum too.

TABLES:MARA,SSCRFIELDS.

SELECTION-SCREEN begin of BLOCK b1 with FRAME TITLE text-001.
SELECT-OPTIONS:s_option1 for mara-matnr MODIF ID M1,
s_option2 for mara-matnr MODIF ID M1.
SELECTION-SCREEN end of BLOCK b1.

SELECTION-SCREEN begin of BLOCK b2 with frame TITLE text-002.
select-OPTIONS:s_option3 for mara-matnr MODIF ID M2,
s_option4 for mara-matnr MODIF ID M2.
SELECTION-SCREEN end of block b2.

SELECTION-SCREEN begin of BLOCK b3 WITH FRAME TITLE text-003.
Select-OPTIONS:s_option5 for mara-matnr MODIF ID M3,
s_option6 for mara-matnr MODIF ID M3.
SELECTION-SCREEN end of BLOCK b3.

SELECTION-SCREEN: FUNCTION KEY 1,
FUNCTION KEY 2,
FUNCTION KEY 3,
FUNCTION KEY 4.

INITIALIZATION.
Move 'Button1' to SSCRFIELDS-FUNCTXT_01.
MOVE 'Button2' to SSCRFIELDS-FUNCTXT_02.
MOVE 'Button3' to SSCRFIELDS-FUNCTXT_03.
MOVE 'Button4' to SSCRFIELDS-FUNCTXT_04.

AT SELECTION-SCREEN.
CASE SSCRFIELDS-UCOMM.
WHEN 'FC01'.
LOOP AT SCREEN.
If screen-group1 = 'M1'.
screen-invisible = 0.
screen-active = 1.
ELSE.
screen-invisible = 1.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

WHEN 'FC02'.
LOOP AT SCREEN.
If screen-group1 = 'M2'.
screen-invisible = 0.
screen-active = 1.
ELSE.
screen-invisible = 1.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

WHEN 'FC03'.
LOOP AT SCREEN.
If screen-group1 = 'M3'.
screen-invisible = 0.
screen-active = 1.
ELSE.
screen-invisible = 1.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

WHEN 'FC04'.
ENDCASE.