Application Development 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: 

Hide a push button on a module pool screen

ankit_doshi
Participant
0 Kudos

1. I have created a function module in which i am calling screen 0100.

2. The FM has two import parameters Flag1 and Flag2

3. This screen 0100 has 3 PushButtons on it(say Button1 , Button2 and Button3)

4. Depending upon the parameter passed to the Flag1 and Flag2 field i have to hide or display the PushButtons

How do i achieve this?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

this depends a lot how you have done your buttons.

Did you add them to your screen by PF-Status or are it real pushbuttons on the screen done with the screen editor?

5 REPLIES 5

Former Member
0 Kudos

this depends a lot how you have done your buttons.

Did you add them to your screen by PF-Status or are it real pushbuttons on the screen done with the screen editor?

0 Kudos

i have used the real pushbutton and not the pf-status ones

Former Member
0 Kudos

Hi,

If it is a push button created using screen painter do this,

Write a code in PBO,


 if flag1 = 'X'.
   loop at screen where name = 'BUTTON1'.
     screen-active = ' '.
     modify screen.
   endloop.
  endif.

else,

get the fcode for that button to hide and add this to a exclude table and then set the PF-STATUS excluding this fcode.


SET PF-STATUS 'PF01' EXCUDING EXTTAB.

Hope this will solve your problem.

THanks,

Anmol.

Former Member
0 Kudos

Hi ,

try this way...


"If it is on the screen designed then try to assign group1 to the button by double click the Push button 
"and write the code in PBO..
    LOOP AT SCREEN .
        IF screen-group1 = 'ID1' .    "Modi ground assigned by double click the push button on the layout at
             screen-active = 0.
             MODIFY SCREEN.
         ENDIF.
   ENDLOOP.

Prabhudas

Edited by: Prabhu Das on Sep 7, 2010 7:37 PM

phantombmt
Member
0 Kudos

If the button you created has name( ex: 'button_1') so you can hide this button by the condition field NAME.
ex :
LOOP AT SCREEN.
CASE ABAP_ON.
WHEN 'Create_mode'.
IF SCREEN-NAME = 'button_1'.

SCREEN-ACTIVE = 0.
MODIFY SCREEN.

ENDIF.
WHEN OTHERS.
ENDCASE.