Publishing odata service using annotation in CDS using with Parameter
I know it very old concept now to create CDS view and use annotation Odata.publish eq true and there will be odata service available in gateway to use, and so many blogs are already there in SCN and on other sites.
But if we are using with parameters in CDS view then how Odata service will behave is going to explain in this blog.if one know about what entity type is created and what is metadata then it can be easily identify, below is the example
1.) So in First step we are creating Simple CDS view using with parameter and adding one more semantics for making CDS as ODATA using annotations called Odata.publish :true
below is screen shot :
2.) After activating the CDS view, need to maintain service using t-code /n/IWFND/MAINT_SERVICE
As mention in below screen shot choose service name and add.
3.)Once it is added and activated, open GW client and one can test byURL. URL need to use same parameter as first key and rest will remain same as below
if one is not using with parameter in CDS view then only keys are passing in URL, but in case of with parameter one additional key need to pass, and that key will comes at first.
So in case CDS view is already in place and want to use CDS view as Odata service using annotation also which is having parameter, one can use the above method.