I think I have finally thought my way through this. The ultimate goal was to find invoices that were in SAP but not in our imaging system by Perceptive Software. I realized that the field that I was looking for wasn't BELNR but rather AWKEY. BELNR is the doc_id for all documents and AWKEY is the doc_ID BELNR is related to concatenated with year and sometimes company. Anyway, I think this is it...I will go test.
Here is the SAP query that I believe is correct.
select distinct substring(AWKEY,0,11) from cp1.BKPF
where MANDT = (CoCd)
and substring(AWKEY, 0, 3) in ('51', '19')
Please close the ticket
Main Topics
Browse All Topics





by: mwvisa1Posted on 2009-11-03 at 20:55:40ID: 25736511
Can you provide a little sample of the data and data structure unless that is part of your question?
Just trying to determine if you have a designator for invoices. Typically that is what I do when joining to tables with multiple value types represented by one docid field in say AR_Ledger, but can typically look for type = 'invoice' to remove any records that coincidentally match an invoice id but are unrelated like a cash entry for a different customer.
Anyway, if you need help with the table structure, try posting your version (e.g., SAP R/3 or SAP business one) and maybe we can find an expert around that can help on the data structure as I no longer have access to SAP R/3 to remember the structure myself.
--M-1