‎2008 May 23 6:14 AM
Hi All,
Can we hide a whole block in a selection screen dynamically.
If so, then how?
Regards,
Bhaskar Tripathi
‎2008 May 23 6:16 AM
Hi,
Refer this code
&----
*& Form sub_select_report
&----
text
----
FORM sub_select_report .
IF ( p_post EQ c_chk ).
LOOP AT SCREEN.
IF ( screen-group1 EQ 'MD1' ) OR
( screen-group1 EQ 'MD2' ) OR
( screen-group1 EQ 'MD3' ) OR
( screen-group1 EQ 'MD4' ).
screen-input = c_ok.
screen-active = c_ok.
ENDIF.
IF ( screen-group1 EQ 'MD5' ) OR
( screen-group1 EQ 'MD6' ).
screen-input = c_1.
screen-active = c_1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF p_rpt EQ c_chk.
LOOP AT SCREEN.
IF ( screen-group1 EQ 'MD5' ) OR
( screen-group1 EQ 'MD6' ).
screen-input = c_ok.
screen-active = c_ok.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDFORM. " sub_select_report
Regards,
Prashant
‎2008 May 23 6:16 AM
Hi,
Refer this code
&----
*& Form sub_select_report
&----
text
----
FORM sub_select_report .
IF ( p_post EQ c_chk ).
LOOP AT SCREEN.
IF ( screen-group1 EQ 'MD1' ) OR
( screen-group1 EQ 'MD2' ) OR
( screen-group1 EQ 'MD3' ) OR
( screen-group1 EQ 'MD4' ).
screen-input = c_ok.
screen-active = c_ok.
ENDIF.
IF ( screen-group1 EQ 'MD5' ) OR
( screen-group1 EQ 'MD6' ).
screen-input = c_1.
screen-active = c_1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ELSEIF p_rpt EQ c_chk.
LOOP AT SCREEN.
IF ( screen-group1 EQ 'MD5' ) OR
( screen-group1 EQ 'MD6' ).
screen-input = c_ok.
screen-active = c_ok.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDFORM. " sub_select_report
Regards,
Prashant
‎2008 May 23 6:17 AM
Hi,
Make sure you hide your comment lines with the MODIF ID as well.
code
selection-screen begin of block processing with frame title text-030.
selection-screen begin of line.
selection-screen position 1.
parameters pa_xmanu like rm08mrbr-manu default 'X'
radiobutton group val modif id id1.
selection-screen comment 3(30) text-040 for field pa_xmanu modif id id1. "<--- Here
selection-screen position 40.
parameters pa_xauto like rm08mrbr-auto
radiobutton group val modif id id1.
selection-screen comment 43(30) text-050
for field pa_xauto modif id id1. "<--- Here
selection-screen end of line.
selection-screen begin of line.
parameters: pa_xskto like rm08mrbr-skto as checkbox modif id id1.
selection-screen comment 3(30) text-055
for field pa_xskto modif id id1. "<--- Here
selection-screen end of line.
selection-screen end of block processing.
at selection-screen output.
loop at screen.
if screen-group1 = 'ID1'.
screen-active = 0.
modify screen.
endif.
endloop.
[/code]
OR
You can hide the block using:
In Initialization event.
Loop at screen.
if screen-name = <f1> and screen-name = <f2>.
screen-input = 0.
modify screen.
endif.
endloop.
Regards,
Raj.
‎2008 May 23 6:20 AM
Hi,
We can hide the block in the selection screen depends upon the user selection using the LOOP AT SCREEN.
Check the below sample code:
selection-screen : begin of block b1 with frame no intervals.
parameter : p_plant radiobutton group g1 user-command radio default 'X',
p_mrp radiobutton group g1.
selection-screen end of block b1.
selection-screen begin of block b2 with frame no intervals.
parameter : p_werks type marc-werks modif id sp1.
selection-screen end of block b2.
selection-screen begin of block b3 with frame no intervals.
parameter : p_berid type smdma-berid modif id sp2.
selection-screen end of block b3.
at selection-screen output.
loop at screen.
check screen-group1 = 'SP1' or
screen-group1 = 'SP2'.
if p_plant = 'X'.
if screen-group1 = 'SP2'.
screen-input = 0.
screen-active = 0.
screen-required = 1.
modify screen.
endif.
else.
if screen-group1 = 'SP1'.
screen-input = 0.
screen-active = 0.
screen-required = 1.
modify screen.
endif.
endif.
endloop.Regards,
Raghu
‎2008 May 23 6:25 AM
Lets take an example here,if u click a check box 'Check' then it should hide a block with a parameter S_Werks and select options S_Lgort should get hidden.For that u need to write this code.
select-options: s_matnr for mard-matnr modif id xyz.
parameters : s_werks like mard-werks modif id abc.
select-options: s_lgort for mard-lgort modif id abc.
parameters check as checkbox user-command check.
at selection-screen output.
if check eq 'X'.
loop at screen.
if screen-group1 = 'ABC'.
screen-input = 0.
screen-invisible = 1.
modify screen.
endif.
endloop.
endif.Replace all elements of the block u want to hide with Modif ID ABC in the above code.
Reward If found helpful.
‎2008 May 23 6:26 AM
Hi,
Loop at screen.
If screen-group3 = 'BLK'.
screen-active = 0.
modify screen.
endif.
endloop.
Thank you.
Reward points if found useful.