Case Expression in CDS View
Create a CDS view and use below case expression.
@AbapCatalog.sqlViewName: ‘ZFLIGHT_VW’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: ‘Use of Case Expression in CDS view’
define view Zflight_Case_Exp
as select from spfli {
key spfli.carrid,
key spfli.connid,
spfli.countryfr,
spfli.countryto,
case
when distance >= 10000 then ‘Long Way Journey’
when distance >= 5000 and distance < 10000 then ‘Medium Way Journey’
else ‘Short Way journey’
end as journey_type
}
Output- Data Preview
SPFLI Table Entries
How to translate this texts?
LikeLike
Hi , The computed field that has to be displayed on UI to be treated differently. The computed field here is simply a text but it could be an interger or something which helps in intermediate calculation. Thanks.
LikeLike