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

push button disabling

Former Member
0 Likes
888

hi experts..

I am working in module pool programming,

I want to disable one push button on the screen depending upon some condition.

how to do that?

thanks in advance

7 REPLIES 7
Read only

Former Member
0 Likes
810

Please search before posting your questions

Regards,

Ravi

Read only

Former Member
0 Likes
810

Try something like this in PBO SECTION OF YOUR SCREEN

LOOP AT SCREEN.

IF YOUR CONTITION.

IF SCREEN-NAME = PUSHBUTTON NAME.

SCREEN-ACTIVE = 0.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Read only

Former Member
0 Likes
810

Hi,

Try this if it on the tool bar

DATA: BEGIN OF I_PF_STATUS_TAB OCCURS 10,

FCODE(4),

END OF I_PF_STATUS_TAB.

FORM SET_PF_STATUS_POSTER.

REFRESH I_PF_STATUS_TAB.

MOVE 'PST' TO I_PF_STATUS_TAB.

APPEND I_PF_STATUS_TAB.

MOVE 'ART' TO I_PF_STATUS_TAB.

APPEND I_PF_STATUS_TAB.

SET PF-STATUS 'ZZBILSTA' EXCLUDING I_PF_STATUS_TAB.

ENDFORM.

Regards

Krishna

Edited by: Krishna Gowrneni on May 5, 2009 5:47 PM

Read only

Former Member
0 Likes
810

hi

try this

say for example u have 2 push buttons ( PB1,PB2 )on ur screen and u want to disable one

based on some condition.

in SE51

PB0

Module status_0800.

Module hide_button.

PAI

Module user_command_0800.

Module hide_button.

if some condition = 'X'.

loop at screen.

if screen-name = 'PB1'.

SCREEN-ACTIVE = '0'.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

endif.

endloop..

endif.

Endmodule.

Regards

Read only

0 Likes
810

thanks Murali..

its working

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
810

Hi,

Refer:

Take the group1 for the screen fields that you have taken on screen as ABC and then follow code to disable fields, in PBO:-


IF <condition>. "as per your condition
  IF screen-group1 = 'ABC'.
    LOOP AT SCREEN.
      screen-input = 0. "to disable screen fields
      screen-active = 0.
    ENDLOOP.
    MODIFY SCREEN.
  ENDIF.
ENDIF.

Now say if you want to enable fields on some condition then you may use:-


IF <condition>. "as per your condition
  IF screen-group1 = 'ABC'.
    LOOP AT SCREEN.
      screen-input = 1. "to enable screen fields
      screen-active = 1.
    ENDLOOP.
    MODIFY SCREEN.
  ENDIF.
ENDIF.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
810

Tarun,

the first part is working for me but the one which u have mentioned under PAI is not working.

Can u please suggest , why it is happening so

Thanks

Chandan