Hi,
While making Odata services, I had gone through various sites post and observed that there are not many advances which are not clear as crystal and subsequently toward the finish of making an odata service we get awful HTTP reaction . This is chiefly because of missing clarification for how to stack meta information and how to test the substance set information .
In this blog entry, I will let you know bit by bit cycle to make Odata services for SAP/SAP HANA framework and how to test it.
I attempted to make sense of the entire cycle in 4 stages.
Step 1. Go to transaction code – SEGW .
Click on Symbol Make. A pop window will show up , Fill the subtleties according to beneath specify in screen shot and snap on really take a look at symbol or enter.
Underneath screen will seem where you can see beneath envelope in project. In Envelope information model, we can see three sub organizers. Entity Type – it goes about as workspace , Entity Sets – It go about as interior table and affiliations.
Presently we will characterize construction of workspace and interior table , Right snap on Information model select import and select DDIC structure .
Here give the subtleties of endlessly structure name according to beneath screen underneath.
Select radio button Substance type and click on check box element set. fill ABAP structure as VBAK and click on straightaway
Presently you will get the spring up screen with VBAK table fields name. Select fields for your construction and snap on straightaway.
project5
Other window will appear where we have to select the key field. tick on Vbeln as key field and click on finish. You may get warning message , it can be totally ignored.
Presently extend envelope element type and fill the beneath boundaries in properties , Kindly don’t tick Invalid check box for VBELN as it is key field.
Comparatively Make Design for SD Thing following same advances
click on Save button at the highest point of menu bar
Presently click on create Symbol, A spring up window will show up with class subtleties , click on tick symbol and continue further. It will request bundle , give subtleties and continue further . These are additionally knowns as runtime curios.
Step 2. Go to transaction code /IWFND/MAINT_SERVICE .
Click on push button Add services .
Next screen will show up, give the moniker name and execute , Quest you for your task .
Presently double tap on your task name . A spring up window will show up , enter the bundle subtleties and snap on tick symbol. A Data message will be shown where it will affirm about the help is made and metadata stacked effectively
Presently click back and go to fundamental screen of exchange/IWFND/MAINT_SERVICE and track down your administration.
Click on SAP Gateway Client
Another screen will come, Execute the exchange and really take a look at the reaction .
Presently we will compose code to get information.
Step 3. Go to transaction code SEGW and expand folder service Implementation .
Under assistance execution – Extend SDheaderSet. you will track down various choices. Right snap on GetEntitySet and select GO to ABAP work Seat . It will divert to the class
Presently extend the technique drop down and select strategy for GetEntitySet for Header information and right snap and select rethink.
Compose underneath code in strategy. Save and enact all connected items for classes.
Comparatively , Compose code for GetEntitySet for Thing and actuate .
Step -4
Go to transaction /IWFND/MAINT_SERVICE and find out you service , select your service and click on load metadata.
Data message will spring up – Metadata has been stacked effectively.
Presently Snap on SAP Door Client .
Now Click on Entity set.
Select entity for header and enter
Click and execute and you will get the header data in response
Likewise, Select element set for thing and execute . You will get information for thing
Here , We had finished our Odata administration creation with a Help Manufacturer Task with two substances and two element sets. We have produced the runtime relics and enlisted and enacted our OData administration. We had reclassified techniques for header and thing element set , load metadata and test the substance set with for test information.
Much obliged
Find Your Preferred Courses