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: 

If condition

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi Bhanu,

Instead of NS use NA and try.

thanks & regards

Kishore Kumar Maram

Former Member
0 Kudos

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