2008 Sep 17 6:41 AM
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
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
2008 Sep 17 6:44 AM
I think it should be
IF s_mt NE ca_lh OR s_mt NE ca_zv .
MESSAGE e010(zcn_mm_msgclass).
ENDIF.
2008 Sep 17 6:48 AM
2008 Sep 17 6:53 AM
Hello
IF not ca_lh in s_mt or not ca_zv in s_mt .
MESSAGE e010(zcn_mm_msgclass).
ENDIF.
2008 Sep 17 6:47 AM
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.
2008 Sep 17 6:47 AM
s_mt is an internal table...so you should loop at it and check value in s_mt-low
~Piyush
2008 Sep 17 6:49 AM
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.
2008 Sep 17 6:50 AM
i think ca refers to contain any
IF s_mt ne lh or s_mt ne zv .
MESSAGE e010(zcn_mm_msgclass).
ENDIF.
2008 Sep 17 6:51 AM
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
2008 Sep 17 1:34 PM
hi,
Try this
Loop at s_mat .
if s_mat-low = 'LH' or s_mat-low = 'ZV'.
continue.
else.
<Raise Error message>
endif.
endloop.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |