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

please correct the logic

Former Member
0 Likes
524

hello experts.

I want to write a or condition but my logic is not working .

please correct my logic.My requirement is if a not equal to se2345

or b not equal to me345 it should give the error.

If a is equal to se2345 and b is not equal to me345 then also it should

give the error , if one is satisified it should give the error.

My logic is like this please correct it.

IF a NE 'se2345'

OR

b NE 'me345'.

MESSAGE e001 WITH 'logic ok'.

ENDIF.

Thank you for all the replies

hello experts.

I want to write a or condition but my logic is not working .

please correct my logic.My requirement is if a not equal to se2345

or b not equal to me345 it should give the error.

If a is equal to se2345 and b is not equal to me345 then also it should

give the error , if one is satisified it should give the error.

My logic is like this please correct it.

IF a NE 'se2345'

OR

b NE 'me345'.

MESSAGE e001 WITH 'logic ok'.

ENDIF.

Thank you for all the replies

3 REPLIES 3
Read only

Former Member
0 Likes
501

My requirement is if a not equal to se2345

if a <> se2345

or b not equal to me345 it should give the error.

+ or b <> me345+

If a is equal to se2345 and b is not equal to me345 then also it should

give the error

+ or (a = se2345 and b <> me345)+

, if one is satisified it should give the error.

+ or (a <> se2345 and b = me345)+

So it should be :

if a <> se2345

+ or b <> me345+

+ or (a = se2345 and b <> me345)+

+ or (a <> se2345 and b = me345)+

And i think so you can delete line 3 and 4 for having the same result.

but if it doesn't work, check your rules.

Regards,

Christophe

Reward if helpful.

Read only

Former Member
0 Likes
501

hi

try this

IF a EQ 'se2345'

AND

b NE 'me345'.

MESSAGE e001 WITH 'logic ok'.

elseif

IF a NE 'se2345'

OR

b NE 'me345'.

MESSAGE e001 WITH 'logic ok'.

ENDIF.

cheers

snehi chouhan

Read only

Former Member
0 Likes
501

Hi,

In below code when both values of 'A' and 'B' are correct then success otherwise it will give always an Error message.

PARAMETERS : A(10) TYPE C,

B(10) TYPE C.

BREAK-POINT.

IF A NE 'SE2345' AND B NE 'ME345'.

WRITE : 'Erroe Message'.

ELSEIF A EQ 'SE2345' AND B NE 'ME345'.

WRITE : 'Erroe Message'.

ELSEIF A NE 'SE2345' AND B EQ 'ME345'.

WRITE : 'Erroe Message'.

ELSEIF A EQ 'SE2345' AND B EQ 'ME345'.

WRITE : 'Success'.

ENDIF.

Any other req plz revert..............

Thanks & regards.

Alok Vishnoi.