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’)