OData Step by Step
OData Step by Step
Click on Icon Create. A pop window will appear , Fill the details as per below mention in
screen shot and click on check icon or enter.
Below screen will appear where you can see below folder in project. In Folder data
model, we can see three sub folders. Entity Type - it acts as work area, Entity Sets -It act
as internal table and associations.
Now we are going to define structure of work area and internal table, Right click on Data
model select import and select DDIC structure.
Here give the details of structure and structure name as per below screen below.
Select radio button Entity type and and click on check box entity set. fill ABAP structure
Now expand folder entity type and fill the below parameters in properties, Please don't
tick Null check box for VBELN as it is key field.
Now click on generate Icon, A pop up window will appear with class details , click on
tick icon and proceed further. It will ask for package , give details and proceed further .
These are also knowns as runtime artifacts.
Now double click on your project name . A pop up window will appear , enter the
package details and click on tick icon. An Information message will be shown where it
will confirm about the service is created and metadata loaded successfully
Now click back and go to main screen of transaction /IWFND/MAINT_SERVICE and find
your service.
A new screen will come, Execute the transaction and check the response .
Now expand the method drop down and select method for GetEntitySet for Header data
and right click and select redefine.
Write below code in method. Save and activate all related objects for classes.
Step -4
Go to transaction /IWFND/MAINT_SERVICE and find out you service , select your service
and click on load metadata.
Information message will pop up - Metadata has been loaded successfully.
Similarly, Select entity set for item and execute . You will get data for item