Professional Documents
Culture Documents
My CDS View Self Study Tutorial - Part 4 How Does Annotation @OData Publish Work
My CDS View Self Study Tutorial - Part 4 How Does Annotation @OData Publish Work
My CDS View Self Study Tutorial - Part 4 How Does Annotation @OData Publish Work
In part1 of this tutorial, the old way to create OData service on top of CDS view is
introduced.
In SAP Help Generate Service Artifacts From a CDS View a new annotation is
1 of 8 25/03/2022, 18:37
My CDS view self study tutorial – Part 4 how does annotation @ODat... https://blogs.sap.com/2016/03/12/my-cds-view-self-study-tutorial-part...
described:
@OData.publish: true
Just add this annotation to your CDS view and the odata service is automatically
created, no need for you to go to code SEGW any more.
Once activated, the odata service with naming convention “<your CDS view
name>_CDS” is available for registration in tcode /IWFND/MAINT_SERVICE:
So the question here is: How does this annotation work? How can we research
the service generation process through debugging?
First check what objects have been generated: three additional artifacts are
highlighted below.
2 of 8 25/03/2022, 18:37
My CDS view self study tutorial – Part 4 how does annotation @ODat... https://blogs.sap.com/2016/03/12/my-cds-view-self-study-tutorial-part...
So it means the annotation @OData.publish: true will trigger table entry insertion
for type IWMO, IWSV and CLAS during view activation. Then again I switch on
ST05 trace and easily find the ABAP code where the table insertion is done.
Set breakpoint on the code and observe the callstack in the runtime.
The highlighted callstack frames are essential for odata service generation.
3 of 8 25/03/2022, 18:37
My CDS view self study tutorial – Part 4 how does annotation @ODat... https://blogs.sap.com/2016/03/12/my-cds-view-self-study-tutorial-part...
CL_WB_DDLS_SECOBJ_HNDLR_SINGLE->IF_DDIC_WB_DDLS_SECOBJ_HA
NDLER~ON_ACTIVATION
It will first identify which objects must be created based on delta state.
For example, if I add @OData.publish: true to an existing CDS view and activate
it, the corresponding entry will have flag N ( New ) while other existing annotation
has type “U” ( Unchanged ).
and the annotation value is true, then it is considered that the odata service must
be created.
4 of 8 25/03/2022, 18:37
My CDS view self study tutorial – Part 4 how does annotation @ODat... https://blogs.sap.com/2016/03/12/my-cds-view-self-study-tutorial-part...
Complete callstack:
5 of 8 25/03/2022, 18:37
My CDS view self study tutorial – Part 4 how does annotation @ODat... https://blogs.sap.com/2016/03/12/my-cds-view-self-study-tutorial-part...
6 of 8 25/03/2022, 18:37
My CDS view self study tutorial – Part 4 how does annotation @ODat... https://blogs.sap.com/2016/03/12/my-cds-view-self-study-tutorial-part...
7 of 8 25/03/2022, 18:37
My CDS view self study tutorial – Part 4 how does annotation @ODat... https://blogs.sap.com/2016/03/12/my-cds-view-self-study-tutorial-part...
8 of 8 25/03/2022, 18:37