2023 Nov 29 10:02 PM
Hi,
I'm getting an error with the below code due to the billing month derivation. Is there any other way to do it? Tried in CDS too and didn't work.
2023 Nov 30 5:35 AM
For handling such complex aggregate functions, I highly suggest utilizing AMDP (ABAP Managed Database Procedures). In the initial query, construct 'billing_month' and gather other relevant fields into your ITAB1. In the subsequent query, execute a "SELECT SUM" statement from ITAB1.
Alternatively, you can achieve similar functionality using CDS (Core Data Services). Initially, create 'billing_month' and select additional fields in CDS1, and then perform a "SELECT SUM" operation from CDS1 in CDS2. However, based on my experience, the performance of CDS views might suffer when dealing with such nested aggregate functions.
Therefore, my recommendation leans towards AMDP.
2023 Nov 30 5:35 AM
For handling such complex aggregate functions, I highly suggest utilizing AMDP (ABAP Managed Database Procedures). In the initial query, construct 'billing_month' and gather other relevant fields into your ITAB1. In the subsequent query, execute a "SELECT SUM" statement from ITAB1.
Alternatively, you can achieve similar functionality using CDS (Core Data Services). Initially, create 'billing_month' and select additional fields in CDS1, and then perform a "SELECT SUM" operation from CDS1 in CDS2. However, based on my experience, the performance of CDS views might suffer when dealing with such nested aggregate functions.
Therefore, my recommendation leans towards AMDP.
2023 Nov 30 8:25 AM
You are "getting an error", which one?
You wanting to find "any other way to do it", to do what? What do you have? What do you want to get?
NB: Please post the code as text instead of image, so that one can easily answer by copying your code in order to complete it. Then, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!
NB: to edit your question, use the menu Actions > Edit.