Error in CDS syntax in one system but its fine in another system?

Hello,

The Eclipse (version June 2023 release) is showing an error on the below CDS syntax, unable to save/activate it in our ECC_System_1, but same code is saving/activating fine in S/4_System_2. The error red mark I am seeing at LEFT and RIGHT syntax in CASE statement, if I remove the whole CASE statement then its saving/activating fine

 

@AbapCatalog.sqlViewName: ‘YSD_SHP’
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: ‘SHP data extract’
define view ZSD_SHP_EXTRACT as select from prps
inner join proj as proj on proj.pspnr = prps.psphi
{
key prps.pspnr as pspnr,
prps.objnr as OBJNR,
case left( prps.objnr, 2 )
when ‘PR’ then right( prps.objnr, 8 )
else ”
end as WBS,
prps.prart as prart,
prps.psphi as psphi,
proj.pspid as pspid
}

 

Thanks

 

Scroll to Top