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: