How to get Service Order item detail by directly query from Database table
Requirement
Create a CDS view to return highlighted information below. ( In the past we can use CRM_ORDER_READ to get them in ABAP code )
First we can get order guid from order id by this table:
(1). 根据order id得到order guid:00163EA720001ED285EFEFADF195A1B2
将order guid传入header field得到item信息:
同时拿到该item的guid: 00163EA720001ED285EFF4706041A1B5
Mockup里的Item No. 10维护在NUMBER_INT field里:
Product description在DESCRIPTION field里,因为只有这个field区分大小写。
(2). 取item的quantity
将step1得到的item_guid传入下表:
得到quantity:
(3). 取quantity unit
将step1拿到的item guid传入下表拿到quantity unit:
(4). 取product 的status
将step1取得的item guid 00163EA720001ED285EFF4706041A1B5传入下表:
得到status code: