Find table of Invoice History


Posted By Ralph Klassen On Monday, January 19, 2004 at 11:03 AM from IT-Toolbox http://sap.ittoolbox.com


Q:

Does anyone know of a table holding logistics invoice documents other than the BSEG? I need to extract all invoices against purchase orders and am trying to find the most efficient way. Any help would be greatly appreciated.


A:


Start by selecting from EKBE where EBELN = your PO and EBELP = your PO item (if you have it). This will give you the PO history that you see in ME23N.

The field EKBE-VGABE identifies the type of document. I think you want to look for a '1' in this field for a goods receipt and a '2' for invoice receipts. Verify this by browsing EKBE using SE1/SE16 at the same time you are looking at a PO in ME23N. If all you are concerned with are the vendor postings then you can limit yourself to the invoice receipts. If you need to retrieve the expense side of the G/L coding then you need the goods receipts as well.

For each record that you retrieve from EKBE:

concatenate EKBE-BELNR and EKBE-GJAHR

if EKBE-VGABE = '1'
select from BKPF where AWTYP = 'MKPF' and AWKEY = (EKBE-BELNR and
EKBE-GJAHR)

if EKBE-VGABE = '2'
select from BKPF where AWTYP = 'RMRP' and AWKEY = (EKBE-BELNR and
EKBE-GJAHR)


I'm not sure if this will work for parked documents but my guess is 'yes it will'.

Converted from CHM to HTML with chm2web Standard 2.7 (unicode)