其他分享
首页 > 其他分享> > CDS view里的case when else语句的一个例子

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
}

标签:case,mara,when,t134,else,AbapCatalog,type,mtart
来源: https://blog.csdn.net/i042416/article/details/91351415