cancel
Showing results for 
Search instead for 
Did you mean: 

How to do Calculations in CDS View While creating Reports on SAP S4 HANA Cloud?

shreshtha_pareek
Explorer
0 Kudos

Hi All, Hope you are doing great.

I am Creating Reports by using CDS View on SAP S4 HANA Public Cloud. I wanted to create Credit Exposure Report, Standard one is available but My client wants 3 more columns that is Open Order amount, Account balance amount and Exposure Times. For that I have added Total Receivables as a associated Data Source Now I wanted to Subtract element Total Overdue from element Total amount to get Account balance Tab , but I am facing multiple errors. For Exposure Times Tab also I have to divide element credit limit amount with element Exposure amount to get the data but for that also I am facing error. I am adding calculation , selecting functions and applying Division and Subtraction formula but still getting errors.

Please advise how can I successfully apply Formula in Calculations for my CDS View Report on S4 HANA Cloud.

Your Help is valuable, Thanks in Advance.

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Changed tag to Extensibility.

View Entire Topic
Amith_Nair
Advisor
Advisor
0 Kudos

Hello,

You achieve this in two steps:

1. Create a Calculation field( say AccBal) and then have the following calculation( based on your description)

Calculation:

(I_TotalAccountsReceivables.TotalAmountInDisplayCrcy-I_TotalAccountsReceivables.TotalOverdueAmtInDspCrcy )

2. Follow the screenShot under Element Properties:

Hope this helps, if yes, please close the thread. Thank you! Amith Nair

shreshtha_pareek
Explorer
0 Kudos

Hey Thanks,

But while doing this process, I am getting this error "The table name I_TotalAccountsReceivables is unknown or obscured by an alias'. Can you Please advise what should i do to resolve this error. In comments i am attaching screenshot also.

Amith_Nair
Advisor
Advisor
0 Kudos

Well, Obviously, the failure is expected because you're using I_CreditLimitUtilization as your Datasource versus in the calculation you're using I_TotalAccountsReceivables. In your Problem statement, you mentioned, you're using I_TotalAccountsReceivables as your Datasource.