Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Monthly Customer Statements for open AR Items

Former Member
0 Kudos

Hi Gurus,

I am working on creating monthly customer statements for open AR Items.

The detailed statement contians the following line items:

1. Invoice No. BSID-VBELN

2. Invoice date: BSID-BLDAT

3. Sales Order number

4. Customer Purchase Order: VBRK-BSTNK_VF

5. Due Date:

6. Original Invoice Amount: VBRK-NETWR

7. Discount Date: BSID-(ZFBDT+ZBD1T)

8. Discount Amount: BSID-WSKTO

9. Invoice Balance

Please let me know how can I find

1. Sales Order number

2. Customer Purchase Order & Original Invoice Amount: I believe it will be based on where BSID-VBELN = VBRK-VBELN but I am not that confident as I am not sure whether this VBELN link is correct

3. Due Date: I am aware of a FM DETERMINE_DUE_DATE... do i need to use that one?

4. Invoice Balance

Also, in the statement the customer payer's number & address needs to get printed in place of the customer's number & address.

Is customer payer by definiton the alternate payer that exists in KNA1-KNRZA ?

Please help me out.

4 REPLIES 4

madhu_vadlamani
Active Contributor
0 Kudos

Hi Viki,

Please check with these bapis BAPI_AR_ACC_GETKEYDATEBALANCE,BAPI_AR_ACC_GETSTATEMENT.Use these and fm and check.

Regards,

Madhu.

Former Member
0 Kudos

Hi,

I guess you need to create a Customer Ledger Report.

You can make use of the below function module in which you pass Company Code, Customer, From and To Date.



  CALL FUNCTION 'BAPI_AR_ACC_GETSTATEMENT'
    EXPORTING
      companycode       = '1000'
      customer          = wa_kna1-kunnr
      date_from         = fr_date
      date_to           = to_date
    TABLES
      lineitems         = it_lineitems.

As you need all open items, delete all records from it_lineitems where clr_doc_no is not blank.

This Function module will give you all the details which you require.

Regards,

Danish.

Former Member
0 Kudos

I had gone through both the BAPI's but they do not return the values I need:

Below values would not need any calculation but I would need to know how to fetch it

1. Sales Order number

2. Customer Purchase Order & Original Invoice Amount: I believe it will be based on where BSID-VBELN = VBRK-VBELN but I am not that confident as I am not sure whether this VBELN link is correct

Below values would need some calculation based on the fields fetched but I am not aware of the calculations involved

1. Due Date: I am aware of a FM DETERMINE_DUE_DATE... do i need to use that one?

2. Invoice Balance

0 Kudos

Hi,

The above function module gives you the Billing Document. You can get the Sales Order number from VBFA table. There can be many sales orders for a single billing document. Pass the Billing Document to VBFA-VBELN to get the Sales Order number VBFA-VBELV.

Regards,

Danish.