Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

From OData Modelling To Service Execution using GWPA:PART-1

$
0
0

Hi SAP mates,

 

 

Before start writing my first document i would like to thank Bince Mathew and Syam Babu for providing me such a higher insight to GWPA and CREATE_DEEP_ENTITY .

 

Please refer the link for a ground preparation.

Entity Types - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library

 

Since we are going to create Model for the document posted by Syam Babu.Please refer the below link before

getting your hands dirty.

 

http://scn.sap.com/community/gateway/blog/2014/04/27/step-by-step-development-guide-for-createdeepentity-operation

 

STEP 1: Create a simple SAP UI5 Project


Right click on the Project Explore in the Eclipse IDE

 

New->Others   and Type UI5

 

Select Application Project from the Directory SAPUI5 Application Project

 

Capture.PNG

 

 

 

Click Next so that it would navigate to another view were we will enter the Project name

 

Capture2.PNG

Clicking on Next it would ask us to give a view name

 

Capture3.PNG

Click Finish which would eventually creates a sample UI5 Project.

 

STEP 2:Create a OData Model Project

 

Follow the same step us above for creating a OData Project.But instead type 'OData'

 

odatapro.JPG

 

Clicking on Next which would ask us to enter a model name and for the instance we will select Blank OData Model

 

modelname.JPG

 

Click on Finish so that it will open in an OData Perspective

 

If you havent added a OData Perspective you can easily add the same from Menu Bar

 

Window->Open Perspective->Others->OData


odatapers.JPG

 

If you are unable to find the OData Perspective that means Eclipse IDE doesnt have proper plugins installed.

 

You can check it from Install New Software Option

 

installodata.JPG

 

 

If every thing is up and running lets draw something

 

Below screenshot will show how an OData Perspective will look like.

 

 

odataperview.JPG

STEP 3:Creating Entity Type


Drag and Drop an Entity Type From the Palette window of the Eclipse IDE.



et_drag.JPG

 

After placing the Entity Type change the name of the EntityType to Header

Editing the name of the Entity Type can be done in Properties View in Eclipse IDE.

 

entityname.JPG

 

Likewise add other two entities to the Odata Workbench

 

other_et.JPG

 

STEP 4:Adding Properties to Entity Types

 

Before adding the properties to the out entities lets rename the key property.

 

Similar to above steps select the key property and rename it from the properties view of the OData Perspective.

 

keyrename.JPG

 

 

Rename the Key Properties of other entities too.

 

otherkey.JPG

Add additional properties by clicking on the highlighted button as shown in the screenshot.

 

 

addprop.JPGaddprop1.JPG

 

Similarly add remaining properties to the entities.

 

restprop.JPG

STEP 5:Creating Association and Navigation


For this Data Model the Association is established between


1)Header and ItemO

2)Header and ItemT


So the Uni Directional Association should be established between above mentioned entities.



Click the Uni Directional Association button as highlighted in the below screenshot and connect it to the required entity.


asso_bt.JPG

 

asso_bt1.JPG

 

     Edit and rename the Navigation Properties that has been created by default.

 

edit_nav_prop.JPG

 

Basic Design has been completed.So save the model and lets export the Model to a XML file so that we can import

to out Gateway Server.

 

 

STEP 6:Exporting an OData Model

 

Right Click on the Project Directory in the Project Explorer

 

Export->Export

 

Type OData Model to select export Destination.

 

exp_dest.JPG

 

      Clicking the Next Button so that we can browse the model as shown in the below screenshot.

 

browse_model.JPG

Provide a Export  Path were we will export the model in XML format.

 

xmlpath.JPG

 

Click Finish.Then you are done.

 

You can learn about importing the Model from my next Document From OData Modelling To Service Execution using GWPA:PART-2

 

 

Regards,

Vishnu


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>