I am working in SAP HANA Native CDS, where i want to convert a sql query into CDS format.
The current SQL Query looks like this
FIRST_VALUE(STAT) OVER(PARTITION BY OBJNR ORDER BY UDATE desc, UTIME desc) as STAT,
FIRST_VALUE(UDATE) OVER(PARTITION BY OBJNR ORDER BY UDATE desc, UTIME desc) as CHG_DATE
I now tried to convert this into HANA CDS like this
view V_MYVIEW as select from TABLE
{
OBJNR,
FIRST_VALUE(STAT) OVER(PARTITION BY OBJNR ORDER BY UDATE desc, UTIME desc) as STAT,
FIRST_VALUE(UDATE) OVER(PARTITION BY OBJNR ORDER BY UDATE desc, UTIME desc) as CHG_DATE
};
Syntax error: unexpected token "(" at line 36, column 12
but the code throws an error at (
and )
.
Is there any other way to achieve this in the CDS??
Best Regards, Gabriel.