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

Modify Screen

ak_upadhyay
Contributor
0 Likes
721

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
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
672

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
Read only

Former Member
0 Likes
672

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.

Read only

Former Member
0 Likes
672

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

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
673

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.

Read only

Former Member
0 Likes
672
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

Read only

Former Member
0 Likes
672

Hi AK,

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

Best regards,

raam