美文网首页SAP札记
一个SAP S/4HANA CDS view extension

一个SAP S/4HANA CDS view extension

作者: 华山令狐冲 | 来源:发表于2020-01-25 19:20 被阅读0次

(1) create a CDS view with following source code:

Once activated, you see two fields in SQL view as expected.

(2) Create another CDS view which extends the view created in step one with additional two fields: PRODUCT_TYPE & UPNAME.

Once activated, you will find these two fields are extended via traditional ABAP append structure in SQL view.

Consumer does not know whether a field is coming from original extensible view or from extension view, it is completely transparent.

The annotation viewEnhancementCategory has following possible values:

PROJECTION_LIST:

Extensions of the SELECT list and additional associations are allowed; extensions of CDS views whose SELECT lists contain aggregate expressions or have a UNION clause must be permitted using further values

GROUP_BY:

Aggregated or non-aggregated elements are allowed to be added to a SELECT list with aggregated expressions and the associated extensions of the of the GROUP-BY clause are also permitted; can only be specified together with #PROJECTION_LIST

UNION:

Extensions of the SELECT list of a CDS view with a UNION clause are allowed; can only be specified together with #PROJECTION_LIST

NONE:

No extensions allowed; cannot be specified together with other values
If not explicitly specified, the default value #PROJECTION_LIST will be chosen.

Guideline

To avoid confusesness and potential ATC error, default value must always be specified explicitly by developer.

要获取更多Jerry的原创文章,请关注公众号"汪子熙":


相关文章

网友评论

    本文标题:一个SAP S/4HANA CDS view extension

    本文链接:https://www.haomeiwen.com/subject/wtirthtx.html