I am new to CDS view technology and I am working on a project to build Account Receivable Turnover report.
Here is the logic which needs to be implemented.
Calculation Logic for KPI:
1.Input from User:
All should be ranges not single fields
a.Company Code (BUKRS)
b.Customer ( KUNNR )
c.Type of Accounting Doc to be included (BLART)
d.Fiscal Year – (GJAHR)
2.First Calculate the Average Customer Receivable
a)Calculated on Average of Customer Receivable at beginning of Fiscal and Customer receivable at end of the fiscal
b)Get the customer receivable carried forward to current fiscal (from selection screen), and the one carried forward to last fiscal(current-1). Average the two- this will be the average customer receivable for last fiscal.
c)Go to KNC1 table, and provide the Company Code(KNC1-BUKRS), Customer(KNC1-KUNNR) and Fiscal(KNC1-GJAHR) and get the sum of all positive Balances carried forward(KNC1-UMSAV)
d)Now repeat the same for last fiscal (Fiscal-1) and get the sum of Balances carried forward (KNC1-UMSAV)
e)Average_Receivable = (c+d)/2
Request you to please help me build the logic.