Hi Experts,
Sorry if I have not searched the existing threads but posting it as duplicate or repeated discussion.
I tried but I didn’t find the correct one as I expected.
My requirement is to query the FMBL table to fetch and aggregate or sum of the TVAL01 to TVAL12 to one variable by all the previous years based on Measure.
For ex: if my input year is for 2024 and the Measure is 10-12345, then the query must fetch of all the data of Measure less than the year 2024 (we can set start year as 2015).
It will collect all the TVAL01 to TVAL12 of previous 10 years of records of the Measure and sum it to a single variable lv_sum.
I tried with the EXEC SQL statement but it’s going run-time error. Instead of approaching the application team as it takes time, I need your help, is there any other way to sum of all the amount fields to a single variable.
Please let me know.
Thanks & Regards.