2016 Oct 03 1:12 PM
When i am trying to read an internal table which has duplicate key fields it is reading the same entry again and again and not assigning anything to the second row of that internal table.
Can you please tell me how to read that second entry in that internal table.
2016 Oct 03 1:31 PM
hi,
Sort the internal table by the field .
then read the internal table table with key = field .
sample code :
LT_ITAB1[] = LT_ITAB[] .
DELETE ADJACENT DUPLICATES FROM LT_ITAB1 COMPARING FIELD1.
SORT LT_ITAB1 BY FIELD1 .
READ TABLE LT_ITAB1 INTO LW_ITAB1 WITH KEY
FIELD1 = FIELD1 BINARY SEARCH .
Regards,
Amaresh
2016 Oct 03 1:39 PM
Use a LOOP AT
LOOP AT li_table INTO l_table_line [USING KEY keyname] [WHERE xyz condition].
[...]
ENDLOOP.