‎2007 Aug 13 9:37 AM
Hi ,
Suppose I have got an internal table itab with field F1,F2,F3,F4.
Suppose itab F1,F2,F3 are already filled up with data . I want to fill field F4 based on Field F3 from a different table .
Take the example of F3 containing Vendor No . I want to get the Vendor name from LFA1 .
i dont want to use the below statement in bold
<b>select lifnr name1 from lfa1 into itab_lfa1 for all entries in itab where lifnr = itab-f3.
loop at itab.
read table itab_lfa1 with key lifnr = itab-f3.
-
endloop.</b>
Is there any way to select the data other than looping the itab itself .
‎2007 Aug 13 9:38 AM
sort itab_lfa1 by lifnr.
loop at itab.
at new lifnr.
read table itab index sy-tabix
select lifnr name1 from lfa1 into itab_lfa1 for all entries in itab where lifnr = itab-f3.
endat.
endloop.
Make sure LIFNR is the first field though.