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: 

logical error

Former Member
0 Kudos

Hello experts

in the select options material type is select option

it should take only two fields LH and ZV

if we give other values it should throw error.

i wrote code as

IF s_mt <> ca_lh or s_mt <> ca_zv .

MESSAGE e010(zcn_mm_msgclass).

ENDIF.

but if i enter any value even LH and ZV also it is throwing error

pls help me in this

9 REPLIES 9

Former Member
0 Kudos

I think it should be


IF s_mt NE ca_lh OR s_mt NE ca_zv .

    MESSAGE e010(zcn_mm_msgclass).

ENDIF.

0 Kudos

it is not making any difference

same error iam getting

0 Kudos

Hello

IF not ca_lh in s_mt or not ca_zv in s_mt .

MESSAGE e010(zcn_mm_msgclass).

ENDIF.

GauthamV
Active Contributor
0 Kudos

hi,

check this sample code.

select-options : s_massn for pa0000-massn no intervals.

at selection-screen.

loop at s_massn.

if ( s_massn-option = 'EQ' and ( s_massn-low = '10' or s_massn-low = '18' or s_massn-low = '19'

or s_massn-low = '20' or s_massn-low = '28' ) ).

else.

refresh s_massn.

clear s_massn.

message e002(zmsg).

endif.

endloop.

Former Member
0 Kudos

s_mt is an internal table...so you should loop at it and check value in s_mt-low

~Piyush

KK07
Contributor
0 Kudos

Hi,

i am bit confused by ur logic.

in ur code u have written message for both the values thats y u r getting the meesage.

check by giving the other values.

Former Member
0 Kudos

i think ca refers to contain any



IF s_mt  ne lh or s_mt ne zv .
MESSAGE e010(zcn_mm_msgclass).
ENDIF.

Former Member
0 Kudos

Hi

I think you have put wrong if statement

IF s_mt ca_lh or s_mt ca_zv .

MESSAGE e010(zcn_mm_msgclass).

ENDIF

You need to use 'AND' instead of 'OR' and you need to check for 'NE' condition

Is it select option or parameter ?

If it is select option, you need to loop and check

If it is parameter, you can directly check.

Regards

MD

Regards

MD

Former Member
0 Kudos

hi,

Try this

Loop at s_mat .

if s_mat-low = 'LH' or s_mat-low = 'ZV'.

continue.

else.

<Raise Error message>

endif.

endloop.