‎2006 Nov 14 12:16 PM
Hi,
I am trying to use screen-invisible but some sections work and some don't. I have debugged it and the screen-invisible changes everytime but sometimes when the 'modify screen' line is executed the 'invisible' value reverts to the original value? Any ideas?
This is the code from the PBO:
LOOP AT SCREEN.
IF screen-name = 'SLOCSCAN'.
screen-invisible = '1'. "this one works
ENDIF.
IF screen-name = 'ZRFSCREEN-LGORT'.
screen-invisible = '1'. "this one works
screen-input = '0'. "this one works
ENDIF.
IF screen-name = 'MATSCAN'.
screen-invisible = '0'. "this one does NOT work. Changes at modify Screen
ENDIF.
IF screen-name = 'ZRFSCREEN-MATNR'.
screen-invisible = '0'. "this one works
screen-input = '1'. "this one works
ENDIF.
IF screen-name = 'SLOC_OK'.
screen-invisible = '0'. "this one does NOT work. Changes at modify Screen
ENDIF.
modify screen.
ENDLOOPThanks.
‎2006 Nov 14 12:25 PM
With the invisible , you can also set active as 0.
Try the same.
Regards,
Baburaj
‎2006 Nov 14 12:24 PM
hi,
try this.
remove the quotes and try this.
LOOP AT SCREEN.
IF screen-name = 'SLOCSCAN'.
screen-invisible = 1. "this one works
ENDIF.
IF screen-name = 'ZRFSCREEN-LGORT'.
screen-invisible = 1. "this one works
screen-input = 0. "this one works
ENDIF.
IF screen-name = 'MATSCAN'.
screen-invisible = 0. "this one does NOT work. Changes at modify Screen
ENDIF.
IF screen-name = 'ZRFSCREEN-MATNR'.
screen-invisible = 0. "this one works
screen-input = 1. "this one works
ENDIF.
IF screen-name = 'SLOC_OK'.
screen-invisible = 0.
ENDIF.
modify screen.
ENDLOOP
Rgds
Anver
‎2006 Nov 14 12:25 PM
With the invisible , you can also set active as 0.
Try the same.
Regards,
Baburaj
‎2006 Nov 14 12:32 PM
Baburaj,
Oooops!!! That did it.
Thanks.
Anver,
Thanks, but that made no difference.
More replied while typing - thanks all.
‎2006 Nov 14 12:28 PM
hi,
Along with setting the invisible to 0, you also need to set the input field or the active field. Try out the combination of two.
Regards,
Richa.
‎2006 Nov 14 12:30 PM
Hi
Try out like this
LOOP AT SCREEN.
IF screen-name = 'SLOCSCAN'.
screen-invisible = '1'. "this one works
ENDIF.
IF screen-name = 'ZRFSCREEN-LGORT'.
screen-invisible = '1'. "this one works
screen-input = '0'. "this one works
ENDIF.
IF screen-name = 'MATSCAN'.
screen-invisible = '0'. "this one does NOT work. Changes at modify Screen
screen-input = '0'.
ENDIF.
IF screen-name = 'ZRFSCREEN-MATNR'.
screen-invisible = '0'. "this one works
screen-input = '1'. "this one works
ENDIF.
IF screen-name = 'SLOC_OK'.
screen-invisible = '0'. "this one does NOT work. Changes at modify Screen
screen-input = '0'.
ENDIF.
modify screen.
ENDLOOP
Bcoz when u r making the screen fields invisible,u have to make screen-input as 0 also.
Rega
Manas Ranjan Panda
‎2006 Nov 14 12:33 PM
Hi,
Did u check if u have done any settings while designing this screen field? Make sure it does not affect your modifications.
‎2006 Nov 14 12:43 PM
hi Aidan,
<b>ACTIVE, INPUT, OUTPUT, and INVISIBLE</b>
There are certain hierarchy rules between the components ACTIVE, INPUT, OUTPUT, and INVISIBLE. They also have different effects depending on their respective static settings.
The ACTIVE component has no equivalent in the element attributes. Instead, it changes the components INPUT, OUTPUT, and INVISIBLE.
At the beginning of the PBO, ACTIVE is always set to 1, regardless of the static attribute settings. Setting ACTIVE to 0 automatically sets INPUT = 0, OUTPUT = 0, and INVISIBLE = 1. Any other changes to the settings of INPUT; OUTPUT, and INVISIBLE to the current screen element are ignored. Conversely, setting INPUT = 0, OUTPUT = 0, and INVISIBLE = 1 automatically sets ACTIVE to 0, and any further assignment to ACTIVE for the current screen element will be ignored. The setting ACTIVE = 1 has no other effect on the attributes. The only purpose of the ACTIVE component is to allow you to make a screen field inactive through a single assignment. You should particularly note that a module call linked to a FIELD statement in the screen flow logic is always executed, even when SCREEN-ACTIVE = 0 for the field in question. If you want to prevent a module from being processed for an inactive field, you must specify the FIELD- and MODULE statements separately.
go through this link
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/loop_a03.htm
Hope this helps.
Regards,
Richa