Skip to Content
author's profile photo Former Member
Former Member

Cancelling sales orders for unpaid invoices

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Oct 12, 2008 at 11:24 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2008 at 06:36 AM

    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)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.