How to redefine a CDS based Odata Service with Annotations ?
This blog will give you details on how to link the annotations of the Odata Service created based on CDS with the redefined service.
Whenever you redefine a Odata service which was created based on CDS reference, the annotations of the redefined service will not be linked with the new Odata service .
We will now see how to eliminate this problem with one configuration technique.
- First of all lets have a look at how the SEGW project which was created based on CDS .
This Odata service has annotation model linked to this service.
The highlighted one is the Annotation model created and associated with the service in transaction /IWBEP/REG_VOCAN.
The above mapping in /IWBEP/REG_VOCAN is an automated process.
2. What will happen if there is an service assignment in transaction /IWBEP.REG_VOCAN ?
When you register the Odata service, it will check for the entry in transaction /IWBEP/REG_VOCAN if the service is mapped with any Vocabulary model.
If entry exists, an entry will be created in DB table Vocabulary Annotation File -/IWFND/I_MED_VAA
3. The annotation will be retrieved in WebIDE only if the entry exists in /IWFND/I_MED_VAA.
Now Let’s have a look , how the new SEGW project in which the above service is redefined.
4.Create a SEGW project -> Redefine->Odata Service(GW).
5. Select the required entities and generate the project.
Do not register the service.
Configuration – Important step – In Back end system where the SEGW project exists.
6. Before registering the service,
- Go to transaction /IWBEP/REG_VOCAN .
- Select the annotation model of the Original Service (which you have redefined in point 1)
7. Click Add assignment – Give the service name generated (in point 1) and click “Enter”.
8. An entry will be created as below.
9. Now register the service
10. Now in WebIDE – Lets select redefined service
11. You will get the annotations of the original service – This is because of Configuration in point 6 and point 7.
Now what could be done if you are already facing the problem for a registered Odata service ?
1. De-register the service in transaction /IWFND/MAINT_SERVICE.
2. Perform the configuration in /IWBEP/REG_VOCAN (Point 6 & 9).
In Back end system where the SEGW project exists.
3. Register the service again in transaction /IWFND/MAINT_SERVICE.
We are planning to automate this configuration steps for CDS based Odata service when redefined.
Stay tuned for updates.