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

screen-invisible modify screen

aidan_mulcahy
Active Participant
0 Likes
2,749

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. 
ENDLOOP

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,406

With the invisible , you can also set active as 0.

Try the same.

Regards,

Baburaj

7 REPLIES 7
Read only

anversha_s
Active Contributor
0 Likes
1,406

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

Read only

Former Member
0 Likes
1,407

With the invisible , you can also set active as 0.

Try the same.

Regards,

Baburaj

Read only

0 Likes
1,406

Baburaj,

Oooops!!! That did it.

Thanks.

Anver,

Thanks, but that made no difference.

More replied while typing - thanks all.

Read only

Former Member
0 Likes
1,406

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.

Read only

Former Member
0 Likes
1,406

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

Read only

former_member283648
Participant
0 Likes
1,406

Hi,

Did u check if u have done any settings while designing this screen field? Make sure it does not affect your modifications.

Read only

Former Member
0 Likes
1,406

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