You are on page 1of 3

REPORT ZDEMO_PRG2.

parameters abc(15) as LISTBOX VISIBLE LENGTH 10.

data lv_flag type i.

data : lt_values type vrm_values,


ls_values like line of lt_values.

selection-SCREEN begin of BLOCK bk1 with frame


title t1.
PARAMETERS : c1 as checkbox,
c2 as CHECKBOX,
c3 as CHECKBOX.
selection-screen end of block bk1.

selection-SCREEN begin of BLOCK bk2 with frame


title t2.
PARAMETERS : r1 RADIOBUTTON GROUP g1,
r2 RADIOBUTTON GROUP g1,
r3 RADIOBUTTON GROUP g1.
SELECTION-SCREEN end of BLOCK bk2.

INITIALIZATION.
t1 = 'Companies'.
t2 = 'Locations'.
perform preparevalues.

at SELECTION-SCREEN OUTPUT.
if lv_flag = 0.
perform invisibleblocks.
elseif lv_flag = 1.
perform visibleblock1.
elseif lv_flag = 2.
perform visibleblock2.
endif.

at SELECTION-SCREEN.
if abc = 'K1'.
lv_flag = 1.
elseif abc = 'K2'.
lv_flag = 2.
elseif abc = 'K3'.
lv_flag = 3.
endif.

FORM PREPAREVALUES .
clear ls_values.
ls_values-key = 'K1'.
ls_values-text = 'Companies'.
append ls_values to lt_values.

clear ls_values.
ls_values-key = 'K2'.
ls_values-text = 'Locations'.
append ls_values to lt_values.

clear ls_values.
ls_values-key = 'K3'.
ls_values-text = 'Projects'.
append ls_values to lt_values.

CALL FUNCTION 'VRM_SET_VALUES'


EXPORTING
ID = 'ABC'
VALUES = lt_values[].

ENDFORM. " PREPAREVALUES

FORM INVISIBLEBLOCKS .
loop at SCREEN.
if screen-name = 'BK1' or
screen-name = 'T1' or
screen-name = 'C1' or
screen-name = 'C2' or
screen-name = 'C3' or
screen-name = 'BK2' or
screen-name = 'T2' or
screen-name = 'R1' or
screen-name = 'R2' or
screen-name = 'R3'.

screen-invisible = '1'.
modify SCREEN.
endif.
endloop.
ENDFORM. " INVISIBLEBLOCKS

FORM VISIBLEBLOCK1 .
loop at SCREEN.
if screen-name = 'BK1' or
screen-name = 'T1' or
screen-name = 'C1' or
screen-name = 'C2' or
screen-name = 'C3'.

screen-invisible = '0'.
modify SCREEN.
endif.
if screen-name = 'BK2' or
screen-name = 'T2' or
screen-name = 'R1' or
screen-name = 'R2' or
screen-name = 'R3'.

screen-invisible = '1'.
modify SCREEN.
endif.

endloop.
ENDFORM. " VISIBLEBLOCK1

FORM VISIBLEBLOCK2 .
loop at SCREEN.
if screen-name = 'BK1' or
screen-name = 'T1' or
screen-name = 'C1' or
screen-name = 'C2' or
screen-name = 'C3'.

screen-invisible = '1'.
modify SCREEN.
endif.
if screen-name = 'BK2' or
screen-name = 'T2' or
screen-name = 'R1' or
screen-name = 'R2' or
screen-name = 'R3'.

screen-invisible = '0'.
modify SCREEN.
endif.

endloop.

ENDFORM. " VISIBLEBLOCK2

You might also like