Register Login

In Read table Can I Use Not Equal to ?

Updated Jun 14, 2019

In Read table can I use not equal to? Normally by comparing two internal table, we using like 

loop it_tab1 into wa_table1
read table it_table2 with key col1 eq 'one'

In the above statement in place of eq can I use <>

SOLUTION

No, you can use Not Equal To (NE) in Read table, instead, you can loop with Where Clause and Exit after a single record is read because you will get only single entry of your key fetched with the read statement.

Note: You will have to sort the table according to your key so that you get all those entries which satisfy your need.

For Example

SORT ...........

LOOP at it_itab1 into wa_itable1 where field NE field.

Write you your code here.

EXIT. //since only one record of your keys will be fetched therefore write an exit after your code.

ENDLOOP


×