function module for opening balance?
I have created a customer outstanding report in which the balance calculation is wrong. The client wants opening balance in the top and then opening balance + debit - credit and then closing balance in the last. And I have just done the debit - credit. Is there any function module to calculate it?
The purpose of the customer outstanding report is that in standard report there is only one column for balance. Client wants to separate it in debit and credit. Please guide.
I have created a cash journal report earlier in which there was opening and closing balance. I copied RFCASH20 into a customized report and made changes according to the user.
Sijin Chandran replied
Consider your code for customer outstanding report .
Inside that there is a field for Posting date (BUDAT) and a field for Customer ( KUNNR ).
Now while filling the final internal table for that report ( i.e CUSTOMER OUTSTANDING REPORT )
just after filling the values BUDAT and KUNNR call that BAPI .
LOOP AT BSID.
WA_FINAL-BUDAT = BSID-BUDAT.
WA_FINAL-KUNNR = BSID-KUNNR.
CALL FUNCTION BAPI_AR_ACC_GETKEYDATEBALANCE.
EXPORTING COMPANYCODE = '1000'.
CUSTOMER = BSID-KUNNR
KEYDATE = BSID-BUDAT.