on 07-01-2022 2:05 PM
I want to add all the columns and rows for this table PMCO
e.g : add all 16 fields in this table for single order. How can i achieve it. I thought the below way sum all the columns first and then use temporary variable saying add( w + w1). but it says that variables are not available till runtime. MAy if i can achieve it in single query. IF not then i will fetch the required data and use business logic to add it.
Hi Madhuri,
I can think of 2 possible ways for your requirement:
1) You can build a CDS in a way similar to how you are you are building your query now in above screenshot. And you can build another CDS/select query on top of first CDS to sum up the summed columns.
2) You could create a CDS Custom entity and write your business logic in the respective query implementation class. Although you can not use cds custom entity as a data source in other CDS/select queries, so you can go with this way if you want to expose this calculation as an oData entity.
Hope this helps.
Thanks,
Aman Garg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.