12-03-2007 8:32 AM
hi,
if I use not equal to in read statemnet i an SYNTAX error
READ TABLE itab INTO itab_wa
WITH KEY MATNR NE jtab--MATNR.
AND ALSO
READ TABLE itab INTO itab_wa
WITH KEY MATNR NE ''.
HOW TO WRITE READ STATEMENT WITH NOT EQUAL TO?
Message was edited by:
venkat s
12-03-2007 8:35 AM
Hi,
U cannot use NE sign while using READ statement...
so do like this
READ TABLE itab INTO itab_wa
WITH KEY MATNR Eq jtab--MATNR.
if sy-subrc ne 0.
now do whatever u want
endif.
similarly
READ TABLE itab INTO itab_wa
WITH KEY MATNR eq jtab-matnr.
if sy-subrc ne 0.
now do whatever u want
endif.
Regards,
nagaraj
12-03-2007 8:35 AM
Hi,
U cannot use NE sign while using READ statement...
so do like this
READ TABLE itab INTO itab_wa
WITH KEY MATNR Eq jtab--MATNR.
if sy-subrc ne 0.
now do whatever u want
endif.
similarly
READ TABLE itab INTO itab_wa
WITH KEY MATNR eq jtab-matnr.
if sy-subrc ne 0.
now do whatever u want
endif.
Regards,
nagaraj
12-03-2007 8:43 AM
Hi,
You can use not equal to in read table statement.
do like this
loop at itab1 into wa1
Read table itab2 intop wa2 with key field = wa1-field
binary search.
if sy-subrc eq 0.
if field2 NE wa1-field2 " check Your not equal to condition here
statement
endif.
endif.
endloop.
Regards,
Prashant
12-03-2007 10:01 AM
Hi Venkat,
Read Statement is able to Read only one Record i.e., one line if you use NE it may contains more records so it is not possible to use NE in Read Statement.
example:
Itab Contains 1,2,3,7,8.
in that you use itab-num NE 1
you get 2,3,7,8.
Reward if useful,
Mahi.