Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Non active vendors

Former Member
0 Likes
628

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.

4 REPLIES 4
Read only

GuyF
Active Participant
0 Likes
603

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

Read only

Former Member
0 Likes
603

Thnks for reply Guy.

The main idea is to delete common records from 2 tables.

Will that statements work?

Regards.

Read only

GuyF
Active Participant
0 Likes
603

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.

Read only

Former Member
0 Likes
603

Thanks Guy.