Description
When you try to register an Odata service exposed by a CDS view in tcode /IWFND/MAINT_SERVICE, you meet with runtime error ASSERTION_FAILED as displayed in picture below.
Keywords
ASSERTION_FAILED, @OData.publish
Root cause
If you debug in the backend, you can find the exception is raised in line 9.
The field causing this exception, “STAT”, does not come from the consumption view itself but from the foreign view zorder_sys_status.
When we comment out line 22~24, the service registration could successfully be done.
Solution
在目前view上重新建立一個新的consumption view.
這樣做的目的是確定最後用于生成odata service的consumption view A, 其字段全部來自 view B.
比較correction之前的實作: consumption view A,其字段部分來自view B, 部分來自view C, 這種scenario并不被SADL 架構支援。
original view:
new created consumption view:
After correction it works with the following url:
https://jerry:44354/sap/opu/odata/sap/Z_C_SERVICE_ORDER_VIEW_CDS/Z_C_Service_Order_View(order_guid=guid’00163EA7-2000-1ED2-85EF-EFADF195A1B2’)