Application Development 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: 

New Report to be developed for Displaying Obsolete Vendors

Former Member
0 Kudos

Hi,

The requirement is to create a new ALV report to display the Vendors that is not Used for more than 2 years either in the POs or in the Invoices.

Please let me know how to handle the data from the tables:

1) (LFM1 & EKKO) for POs. The difference between these 2 tables will give the unused vendors in PO.

2) (LFB1 & RBKP) for Invoces The difference between these 2 table will give the unused vendors in Invoices.

Thanks,

Raghav.

4 REPLIES 4

Former Member
0 Kudos

Hi,

You might need to look at the following tables to find out your unused vendors list.

Get all the vendors from LFA1/LFB1 tables and loop around the following tables to get your output.

EKKO - For any new PO created

EKPO - For any existing PO details changed against the

vendor

EKBE - For any Purchase Order History related information

RBKP - For MM Invoice related information

BKPF - For FI related Invoice information

I hope this helps.

Thanks

Ramesh

Edited by: Ramakrishnan Janarthanan on Jun 2, 2008 12:59 PM

0 Kudos

Hi Ramakrishnan,

Yes this helps. But my question is like "What will be the select query(Syntax) to get the difference of vendors from the Tables LFM1 & EKKO?"

The difference between the (LFM1-LIFNR Vendor Master) & EKKO (where we will be getting the vendor list which is used in the POs EKKO-LIFNR). So the difference vendors obtained will be the UNUSED Vendor list. I understood this logic.

Kindly Let me know how can i get the difference Vendors?

Thanks,

Raghav.

0 Kudos

Hi,

If possible please let me know the piece of code for the same. It will be very helpfull for me.

Thanks,

Raghav.

0 Kudos

Hi,

Please see the sample code below.

REPORT zrj999.

Types: Begin of t_lifnr,

lifnr TYPE lifnr,

end of t_lifnr.

DATA: i_lifnr TYPE STANDARD TABLE OF t_lifnr WITH HEADER LINE.

Data: l_count TYPE i.

SELECT lifnr

INTO TABLE i_lifnr

FROM lfm1.

LOOP AT i_lifnr.

  • Initialise The Variable

l_count = 0.

SELECT COUNT(*)

INTO l_count

FROM ekko

WHERE lifnr = i_lifnr-lifnr.

IF l_count > 0.

DELETE i_lifnr.

ENDIF.

ENDLOOP.

  • Build The ALV Layout Details

Thanks

Ramesh

Edited by: Ramakrishnan Janarthanan on Jun 2, 2008 2:08 PM