‎2011 Apr 01 11:29 AM
Hi Guys,
I have a requirement.
In the selection screen on the report, I need a push button "Click".
When i "Click" First Time this it should display all the selection screen Blocks B1,B2,B3 from my selection screen.
For second "Click" it should Hide the Blocks B1,B2,B3.
I am doing the following code in my report:
But for first Click it is displaying the Blocks.And for the Second click it is not Hiding.
Please suggest on this.....
initialization.
if screen-group1 = 'A1' .
screen-active = 0.
modify screen.
endif.
endloop.
loop at screen.
if screen-group1 = 'A2' .
screen-active = 0.
modify screen.
endif.
endloop.
loop at screen.
if screen-group1 = 'A3' .
screen-active = 0.
modify screen.
endif.
endloop.
I am using " At selection screen:
at selection-screen.
if gv_flag = space.
loop at screen.
if screen-group1 = 'A1' .
screen-active = 1.
modify screen.
endif.
endloop.
loop at screen.
if screen-group1 = 'A2' .
screen-active = 1.
modify screen.
endif.
endloop.
loop at screen.
if screen-group1 = 'A3' .
screen-active = 1.
modify screen.
endif.
endloop.
gv_flag = 'X'.
elseif gv_flag = 'X'.
loop at screen.
if screen-group1 = 'A1' .
screen-active = 0.
modify screen.
endif.
endloop.
loop at screen.
if screen-group1 = 'A2' .
screen-active = 0.
modify screen.
endif.
endloop.
loop at screen.
if screen-group1 = 'A3' .
screen-active = 0.
modify screen.
endif.
endloop.
gv_flag = space.
endif.
‎2011 Apr 01 11:32 AM
You are hiding it in INITIALIZATION block which means it hides only once before PBO. If you want to show/hide it in turn simply place all your code in PAI, not just part of it.
Regards
Marcin
Sorry didn't notice part of the code in the bottom
The logic should go like
at selection-screen.
if gv_flag = space.
loop at screen.
case screen-group1.
when 'A1' or 'A2' or 'A3'
screen-active = 1.
modify screen.
when others.
endcase.
endloop.
gv_flag = 'X'.
elseif gv_flag = 'X'.
loop at screen.
case screen-group1.
when 'A1' or 'A2' or 'A3'.
screen-active = 0.
modify screen.
when others.
endcase.
endloop.
gv_flag = space.
endif.
Regards
Marcin
Edited by: Marcin Pciak on Apr 1, 2011 12:33 PM
‎2011 Apr 01 11:36 AM
‎2011 Apr 01 11:39 AM
hi
you need to create a screen using se51 and add your button there.
then do your codding in PAI module.
i hope it will work for you.
Thanks
LG
‎2011 Apr 01 1:32 PM
If this is SAP standard selection screen, check AT SELECTION-SCREEN OUTPUT event. Search the forums, been asked so many times.