Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ADD push button in selection-screen

Former Member
0 Likes
711

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.

4 REPLIES 4
Read only

MarcinPciak
Active Contributor
0 Likes
650

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

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
650

This should be done in PAI .

Read only

Former Member
0 Likes
650

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

Read only

Former Member
0 Likes
650

If this is SAP standard selection screen, check AT SELECTION-SCREEN OUTPUT event. Search the forums, been asked so many times.