CDS view里的case when else语句的一个例子
作者:互联网
@AbapCatalog.sqlViewName: 'ZMATTYPE'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'material type'
define view Zmaterial_Type as select from mara inner join t134 on mara.mtart
= t134.mtart {
key mara.scm_matid_guid16 as product_guid,
case
when ( mara.mtart = 'SERV') or t134.prod_type_code = '2'
then '02'
else '01'
end as product_type
}
```要获取更多Jerry的原创文章,请关注公众号"汪子熙":
<img src="https://user-images.githubusercontent.com/5669954/61616089-2a87e180-ac9a-11e9-861d-c29c2cf897af.png">
标签:case,mara,when,t134,else,AbapCatalog,type,mtart 来源: https://blog.csdn.net/i042416/article/details/100048716