cancel
Showing results for 
Search instead for 
Did you mean: 

How to autogenerate columns for one whole year by month in ABAP CDS or Table Function or SQL.

mamatha_krishna
Explorer
0 Kudos

Hi All,

Could you please help me with the below scenario on how I could arrive at the one whole year data by month in ABAP CDS Using Table Function or S4HANA ABAP CDS or SQL.

Attached is the below screensh

In the DB table level I have only 3 fields Product ID, Install Date and Value and only one entry per Product ID.

Where as based on the Install Date, I will have to autogenerate data for one whole year and calculate total. Calendar Year/Month column should be an autogenerated column and dynamic in nature which needs to be generated based on Install Date.

If you notice P1 has Install Date as on Jan 2021 so autogenerated column is only till Dec 2021 ie 12 months data or one year data, where as P2 has Install Date as on Apr 2021 so if we generate for 12 months then it is going to be till April 2022 where as we need it till Dec 2022.

2022-08-24-22-23-34-clipboard.png

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Mamatha ,

Did you get a solution for this scenario. I have a similar requirement where I need to generate amounts for different months dynamically month wise as per user date range selection.