2008 Dec 20 1:14 PM
Hi all
I have to find to find the vendors which are not having any PO/PR on the dates that are specified according to criteria.
I'm fetching data from lfa1 & ekko
& using this statement->
DELETE it_lfa WHERE lifnr = it_ekko-lifnr. but it is showing me all te vendors.
Please help!
Regards.
2008 Dec 20 2:28 PM
Hi,
You have to do a loop of your IT_EKKO table, and then delete the records from IT_LFA.
Try this:
DATA: ls_ekko LIKE LINE OF it_ekko.
SORT it_ekko BY lifnr.
LOOP AT it_ekko INTO ls_ekko.
AT NEW lifnr.
DELETE it_lfa WHERE lifnr = ls_ekko-lifnr.
ENDAT.
ENDLOOP.Best Regards,
Guy.
Edited by: Guy F. on Dec 20, 2008 3:28 PM
2008 Dec 21 7:40 AM
Thnks for reply Guy.
The main idea is to delete common records from 2 tables.
Will that statements work?
Regards.
2008 Dec 23 8:58 PM
Yes.
The idea is that you select entries from EKKO, and then delete all entries from LFA1 that have the same vendor.
The sort and "AT NEW lifnr" statements are meant to minimize the times you delete records from IT_LFA1.
Guy.
2008 Dec 26 8:43 AM