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

If condition

Former Member
0 Likes
489

below is my logic

IF sa30-yygpreisbi <= hgvabbv_30-yygpreisab.

fehler_vertrag = 1.

IF xscreen = space.

syst-msgno = '442'.

syst-msgid = 'YS'.

syst-msgty = 'W'.

PERFORM protokollausgabe.

ELSE.

MESSAGE e442.

ENDIF.

Now i want that if

IF sa30-yygpreisbi conatins any value like ### it sholud not go inside to check further if condition.

what i have done is

IF sa30-yygpreisbi NS '#'.

IF sa30-yygpreisbi <= hgvabbv_30-yygpreisab.

fehler_vertrag = 1.

IF xscreen = space.

syst-msgno = '442'.

syst-msgid = 'YS'.

syst-msgty = 'W'.

PERFORM protokollausgabe.

ELSE.

MESSAGE e442.

ENDIF.

  • return_code = 4.

ENDIF.

ELSE.

EXIT.

ENDIF.

But ths is not wrkng?

PLease help

3 REPLIES 3
Read only

Former Member
0 Likes
470

try the following ...

IF sa30-yygpreisbi CA '#'.

exit.

else.

IF sa30-yygpreisbi <= hgvabbv_30-yygpreisab.

fehler_vertrag = 1.

IF xscreen = space.

syst-msgno = '442'.

syst-msgid = 'YS'.

syst-msgty = 'W'.

PERFORM protokollausgabe.

ELSE.

MESSAGE e442.

ENDIF.

return_code = 4.

ENDIF.

ENDIF.

Read only

Former Member
0 Likes
470

Hi Bhanu,

Instead of NS use NA and try.

thanks & regards

Kishore Kumar Maram

Read only

Former Member
0 Likes
470

Hi,

#is a special character. In comparision if you want to compare capital A in the string str = 'BADD'. To check the if condition for capital A following should be the condition,

If str = 'B#ADD'.

endif.

Here the condition will be true only if capital A is present in the string. # makes comparision of next symbol as it is.

For checking the condition ### you should change '###' to '######'.

This will meet your requirements.

reward if it helps.

regards,

mahantesh