on 03-17-2023 4:20 PM
Hello All,
I have a requirement to populate row numbers in CDS View. The data for the final CDS view will be populated from four other CDS views. My final view looks something like the one below. Example: The first two rows will come from the first CDS view, the next two rows from the second CDS view, and so on.
Final View
I tried to generate the row number using virtual elements in CDS but was not able to do it as I will not be using OData. publish annotation, and I need to view the result in SE16 only, not from the metadata.
I tried using the CDS table function to populate the row number (row_number in AMDP) but was able to populate the row number as mentioned below.
I need to have the row numbers continuously for the data from all the CDS views. But the row number is starting from the initial for every CDS view.
Please suggest an approach to having continuous row numbers for all the records.
Thanks in Advance
Pallavi U
You can do:
CDS view:
DEFINE VIEW ENTITY ... SELECT ... UNION SELECT ...
CDS table function:
define table function ... implemented by method ...;
AMDP method:
RETURN
SELECT
...,
ROW_NUMBER() over (partition by ...) AS ...,
...
FROM <CDS view>
ABAP code:
SELECT ... FROM <CDS table function> ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
109 | |
15 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.