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: 

Modify Screen

ak_upadhyay
Contributor
0 Kudos

Hi All,

I am facing a problem in screen. I add some fields to screen.


Loop at Screen.
if sy-tcode = 'PB30' AND ( SY-UCOMM = 'DIS' ) .

IF SCREEN-NAME = 'P9001-WERKS'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME = 'P9001-PSAREA1'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME = 'P9001-JDATE'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME = 'P9001-DEPRT'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.

ENDIF.
ENDLOOP.

Now i want to grey these fields when the sy-ucomm eq Display. For the first three fields it's working fine but for the fourth field P9001-DEPRT it is not working. What could be the problem, Please Help me.

Thanks in advance.

AK

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

check the field name whether its correct or not...

give the if statement outside the loop.

Why are u checking the statemnt inside the loop.

5 REPLIES 5

Former Member
0 Kudos

Try it this way:

if sy-tcode = 'PB30' AND ( SY-UCOMM = 'DIS' ) .
 Loop at Screen.
IF SCREEN-NAME = 'P9001-WERKS'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
endloop.
Loop at Screen.
IF SCREEN-NAME = 'P9001-PSAREA1'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
endloop.
Loop at Screen.
IF SCREEN-NAME = 'P9001-JDATE'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
endloop.
Loop at Screen.
IF SCREEN-NAME = 'P9001-DEPRT'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
endloop.
ENDIF.

With luck,

Pritam.

Former Member
0 Kudos

Hi,

Check this code-


AT SELECTION-SCREEN OUTPUT.
If sy-tcode = 'PB30' AND ( SY-UCOMM = 'DIS' ) .

Loop at Screen.
 
IF SCREEN-NAME CS 'P9001-WERKS'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME CS 'P9001-PSAREA1'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME CS 'P9001-JDATE'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
IF SCREEN-NAME CS 'P9001-DEPRT'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
 
ENDLOOP.


ENDIF.

Regards,

Sujit

kesavadas_thekkillath
Active Contributor
0 Kudos

check the field name whether its correct or not...

give the if statement outside the loop.

Why are u checking the statemnt inside the loop.

former_member188685
Active Contributor
0 Kudos
IF SCREEN-NAME = 'P9001-DEPRT'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.

may be the field name DEPRT is not there. is that DEPRT or some thing else..

you can try this also..

IF SCREEN-NAME CS 'P9001-DEP'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.

just check it

Former Member
0 Kudos

Hi AK,

You can check out in debugging wheather the screen name is corrrect or not.

Best regards,

raam