on 10-12-2008 11:08 PM
I have a requirement to get the list of all unpaid invoices and then cancel billing documents. For this, what is the link between SD tables and FI tables to get the information of all unpaid invoices? Any help is appreciated.
By invoice you can check to table BKPF with invoice number is store in BKPF-AWKEY and System ID store in BKPF-AWSYS. with this you'll have no performance issue.
With selection result, check whether the document is in BSAD table, If yes, it's mean the invoice is paid(cleared document).
check payment document to BSID table with BKPF-belnr and bkpfp-gjahr. for detail getting payment.
WHERE BUKRS EQ BKPF-BUKRS
AND KUNNR EQ Custno
AND UMSKS EQ SPACE AND UMSKZ EQ SPACE
AND GSBER EQ BKPF-GSBER
AND REBZZ EQ BSEG-BUZEI AND REBZG EQ BKPF-BELNR AND BLART =(doc type of payment doc)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
in the table BSEG, there are fields VBEL2 and POSN2. These two fields should point to item of the sales document. So you need to select all your unpaid invoices from the tables BKPF - header and BSEG - items. Then use these two fields to find corresponding sales documents. A reading from the tables BKPF and BSEG is usually very slow, so maybe it will be better to use secondary index tables such as BSIS/BSAS.
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.