2017 Nov 08 4:27 PM
Hello,
How can i get run time information of the field name inside CDS. For example: Select a.matnr from mara as a .... I know the field name is Matnr but my requirement is to look the field ( Note : Field and not its value) in another table and if that exists the value should be replaced something like this
select a.matnr....from ( case when a.matnr ( select field from 'TABLE' where fieldname = a.matnr ) then ' Table value' else a.matnr
I can hardcode the fieldname as 'MATNR' in the sub select but the problem is i have more than 200 fields and then i have to do the select as many times. Is there a way to identify the field name without having to hardcode .
Thanks.
Prem
2017 Nov 08 5:21 PM
No. ABAP CDS SQL is static. And there are also no subqueries in ABAP CDS.
For things like that, try to use SQLScript in CDS table functions or use the dynamic clauses of Open SQL.
2017 Nov 08 5:21 PM
No. ABAP CDS SQL is static. And there are also no subqueries in ABAP CDS.
For things like that, try to use SQLScript in CDS table functions or use the dynamic clauses of Open SQL.
2017 Nov 10 4:34 PM