2006 Jul 13 7:41 PM
I need to use this code, but It does not work in PAI. I want to disable a numc field when I push a button in PAI but it makes me nothing.
loop at screen.
if screen-name = ''.
screen-input = 0.
endif.
modify screen.
endloop.
What I should do?
thanks.
2006 Jul 13 7:43 PM
Write your code in PBO.
loop at screen.
if screen-name = '<name of the field you want to disable>'.
screen-input = 0.
modify screen.
endif.
endloop.
Regards,
ravi
2006 Jul 13 7:44 PM
Hi,
Are you passing screen-name = 'screenstructure-fieldname'
to this?.
and write this logic at PBO event.
<b>then change code like below:</b>
Loop at screen.
if screen-name = 'AUX'.
screen-input = 0.
modify screen.
endif.
Endloop.
<b>whenever an event is fired from PAI , the execution of the code control goes from PAI to PBO. so if you put the code in PBO , this code will execute when screen re-displayed . if you put in PAI , first object will be disabled , if you press 'ENTER' then again it will enabled.</b>
Regards
Appana
Message was edited by: L Appana
2006 Jul 13 7:45 PM
Hi,
Instead of screen-name = ' ' try using the field name of numc field you want to disable.
Cheers,
James
2006 Jul 13 7:46 PM
Ensure the field name is all caps.
screen-name = 'FIELDNAME'.
hith
Sunil achyut
2006 Jul 13 7:47 PM
It is a field whose name is 'aux'. It does not have structure associated.
2006 Jul 13 7:49 PM
As suggested by Ravi put your logic in PBO module
loop at screen.
if screen-name = 'AUX'.
screen-input = 0.
modify screen.
endif.
endloop.
hith
Sunil Achyut
2006 Jul 13 7:50 PM
It is in caps but it still does not work and I need to put a button which makes me disabled in PAI the field. Why should I do in PBO?
2006 Jul 13 7:52 PM
The code I have is
PAI.
Case sy-ucomm
when 'SAVE' -> The button
loop at screen.
if screen-name = 'AUX'.
screen-input = 0.
modify screen.
endif.
endloop.
endcase.
But still not work
2006 Jul 13 7:59 PM
You might want to read the documentation about how the screen elements work before coding.
http://help.sap.com/saphelp_erp2005/helpdata/en/e4/2adbef449911d1949c0000e8353423/frameset.htm
hith
Sunil Achyut
2006 Jul 13 8:35 PM
Hi,
You need to do it in PBO because this is the event that occurs prior to displaying the screen. When you set screen-input = 0 in the PAI, the values are taken from the screen layout definition for the field causing the screen-input to be set to 1. You can override this during PBO. One way to "connect" your PAI 'SAVE' function to the PBO "loop at screen" is to use a flag variable.
Example:
PBO module
IF my_flag = 'X'.
LOOP AT SCREEN.
IF screen-name = 'AUX'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
PAI module:
...
when 'SAVE'.
if my_flag is initial.
my_flag = 'X'.
endif.
- James