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: 

Changing screen field attribute in PAI

0 Kudos

Hi,

Can we change attribute (Not Value) of any screen field in PAI event?

I need to disable one button in PAI. Is there any way of doing it?

Regards,

Umesh

5 REPLIES 5

LucianoBentiveg
Active Contributor
0 Kudos

You can´t.... only in the PBO.

0 Kudos

You must perform in PBO module.

loop at screen.

if screen-name = 'YOUR_FIELD'.

screen-input = 0.

modify screen.

endif.

endloop.

0 Kudos

HI,

My problem is, when I click an a button it calls BAPI which throws an exception. Based on this exception we give error message. When the error message is displayed that button still remains active. So user can click that and again it executes logic. In this complete cycle from click of execute button to Error message it remains in PAI. So how do I disable Execute Button just before displaying error message?

Reagrds,

Umesh

0 Kudos

Umesh,

Display your error message as an Informational message (type I)

message i000 with 'Whatever the message is...".

Then right after or before the message, set a global variable to notify the PBO module that a button should be disabled.

Then in the PBO, use an IF statement and my logic above to disable the button when the global variable is set appropriately.

Set the message as I - informational - should trigger the PBo module to fire. You might even need to use an EXIT in your PAI to stop certain processing - not sure of your prog's structuring obviously.

Former Member
0 Kudos

Hi Umesh,

You can do that... Suppose you want to make a button invisible in a button click, you can do like this.

1) you can use a variable (say <b>flag</b> with value initialised to 0)

2) In PBO, do like this.

LOOP AT SCREEN.

IF SCREEN-NAME = 'FIELD1' AND flag = 1.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

3) In PAI, for the function code corresponding to button click assign flag to 1.

case sy-ucomm.

when 'FC1'.

<b>flag = 1.</b>

endcase.

Hope this will solve your problem.

Regards,

SP.