前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用CDS view获得CRM订单的状态值和描述信息

使用CDS view获得CRM订单的状态值和描述信息

作者头像
Jerry Wang
发布2019-05-30 20:52:04
5240
发布2019-05-30 20:52:04
举报

The final achievement would look like below:

clipboard1
clipboard1

Here below are detail steps

(1) Copy a new CDS view by copying the following source code. This view will return all order’s guid together with their process type and status CODE.

代码语言:javascript
复制
@AbapCatalog.sqlViewName: 'zallstatus'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'all status'
define view Z_C_All_Status as select from crmd_orderadm_h
inner join crm_jest as _jest on crmd_orderadm_h.guid = _jest.objnr and _jest.inact = ''
{
key crmd_orderadm_h.guid,
key _jest.stat,
crmd_orderadm_h.process_type
}

(2) Get the description of system status CODE by creating this CDS view:

代码语言:javascript
复制
@AbapCatalog.sqlViewName: 'zsystatus'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'system status'
define view Zorder_Sys_Status as select from Z_C_All_Status
/_association [0..1] to tj02t as _tj02t on $projection.stat = _tj02t.istat
and tj02t.spras = 'E'/
inner join tj02t as _tj02t on Z_C_All_Status.stat = _tj02t.istat
and _tj02t.spras = 'E'
{
key Z_C_All_Status.guid,
key Z_C_All_Status.stat,
_tj02t.txt04,
_tj02t.txt30
}

(3) Get the description of user status CODE by creating this CDS view:

代码语言:javascript
复制
@AbapCatalog.sqlViewName: 'zusestatus'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'user status'
define view Zorder_use_Status as select from Z_C_All_Status
join crmc_proc_type as _proc_type on Z_C_All_Status.process_type = _proc_type.process_type
inner join tj30t as _tj30t on Z_C_All_Status.stat = _tj30t.estat
and _proc_type.user_stat_proc = _tj30t.stsma
and _tj30t.spras = 'E'
{
key Z_C_All_Status.guid,
key Z_C_All_Status.stat,
_tj30t.txt04,
_tj30t.txt30
}

(4) perform an UNION on view created by step 2 and 3, and that’s done.

代码语言:javascript
复制
@AbapCatalog.sqlViewName: 'zstatustxt'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'status with text'
define view Z_C_All_Status_Txt as select from Zorder_Sys_Status {
key Zorder_Sys_Status.guid,
key Zorder_Sys_Status.stat,
Zorder_Sys_Status.txt04,
Zorder_Sys_Status.txt30
} union select from Zorder_use_Status {
key Zorder_use_Status.guid,
key Zorder_use_Status.stat,
Zorder_use_Status.txt04,
Zorder_use_Status.txt30
}
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年05月01日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档