2015 Aug 13 10:28 AM
Hi,
I am working on a prototype where i have to compare few fields of a DB table to see if there is any different value in any one of them. The fields to be compared comes from another table and could differ at times. How do i achieve this in CDS views ?
For e.g.
I get 2 fields named dispo and dispr from t130f DB table. After this i have to make a select on marc by comparing these 2 fields to see if the value differs. Something like this:
SELECT A~*
from MARC as A
INNER JOIN MARC as B
on A~matnr = B~matnr
WHERE A~matnr = 'W10_000_0000000057'
and ( A~dispo <> B~dispo
OR A~dispr <> B~dispr ).
The condition in brackets would be kind of dynamic. Thanks a lot in advance.
Regards,
Ashish
2015 Aug 17 10:19 AM
Hi Ashish,
ABAP CDS does not support dynamic SQL. You'd rather want to use dynamic Open SQL.
Another alternative are the programatical creation of CDS views or AMDPs - I mention it but I don't recommend it :-).
Cheers,
Jasmin
2015 Aug 17 10:19 AM
Hi Ashish,
ABAP CDS does not support dynamic SQL. You'd rather want to use dynamic Open SQL.
Another alternative are the programatical creation of CDS views or AMDPs - I mention it but I don't recommend it :-).
Cheers,
Jasmin
2015 Aug 17 10:25 AM
Hi Jasmin,
Thats already very helpul. As i mentioned i am doing the prototyping and now when i know atleast this is not possible, it clarifies lot of things . Now i do not spent unnecessary time on this. Thanks again.
Regards,
Ashish