2006 Jun 20 3:04 PM
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
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
2006 Jun 20 3:06 PM
2006 Jun 20 3:09 PM
You must perform in PBO module.
loop at screen.
if screen-name = 'YOUR_FIELD'.
screen-input = 0.
modify screen.
endif.
endloop.
2006 Jun 20 3:13 PM
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
2006 Jun 20 4:09 PM
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.
2006 Jun 20 3:11 PM
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.