cancel
Showing results for 
Search instead for 
Did you mean: 

Sum of amounts based on period range in ACDOCT(HSL01 to HSL012)

SAPSupport
Employee
Employee
0 Kudos

I have a requirement where I have to add the amounts based on period range selected through Parameters in CDS view.
For examples in the the screen selection user selects Fiscal year , Fiscal Period_From and Period_To as

year ;DIGITS

period_from: 001

period_to : 009

then logic required is to sum the amounts HSL01 - till HSL09.

if user selects different range like period_from = 004 and period_to= 007 then sum (HSL04 till HSL09). This has to be added dynamically in the CDS view based on user selects.
I am building a Analytical report and want to achieve this with CDS view.
Please suggest and let me know if you need any other information.
I have checked in SAP blogs but there is no answer by achieving this with CDS view with parameters.


------------------------------------------------------------------------------------------------------------------------------------------------
Learn more about the SAP Support user and program here.

Accepted Solutions (1)

Accepted Solutions (1)

SAPSupport
Employee
Employee
0 Kudos

Please see the following answer for details on creating a subtotal:

https://answers.sap.com/questions/13243026/how-create-a-subtotal-in-custom-cds-view.html

Please check the documentation for details on parameters for Custom CDS Views app and User Input Values for filters in the Custom Analytical Queries app:

https://help.sap.com/docs/SAP_S4HANA_CLOUD/f544846954f24b9183eddadcc41bdc3b/9331604b3bd641d19b8b0640...

https://help.sap.com/docs/SAP_S4HANA_CLOUD/f544846954f24b9183eddadcc41bdc3b/70538b07b6bb45af94f99d2f...

For details on SUM aggregation for a field in a Custom CDS View see the following documentation:

https://help.sap.com/docs/SAP_S4HANA_CLOUD/f544846954f24b9183eddadcc41bdc3b/009d8a1c15134849a207ba26...

https://help.sap.com/docs/SAP_S4HANA_CLOUD/f544846954f24b9183eddadcc41bdc3b/a366e586c2084ef491ae757c...

Note: These are links to the S/4HANA Cloud documentation but will work in on-premise environments as well

Also see the SAP Note 2540696 - Custom CDS Views – Content Rules

Answers (0)