Find table of Invoice History

来源:互联网 发布:皮鞋销售软件 编辑:程序博客网 时间:2024/05/21 09:06
 

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'.

原创粉丝点击