Fiori ODATA Services Tutorial

ODATA Services

OData services: OData is utilized to characterize best practices that are required to assemble and devour RESTful APIs. It causes you to discover changes, characterizing capacities for reusable techniques and sending cluster demands and so forth.

ODATA Services

  • OData gives office to expansion to satisfy any custom needs of your RESTful APIs.
  • REST remains for Representational State Transfer and it is now and then spelled as “ReST”.
  • It depends on a stateless, customer server, cacheable correspondence convention. In for all intents and purposes all cases, the HTTP convention is utilized.
  • REST is characterized as an engineering style for planning system applications.
  • OData encourages you center around your business rationale while building RESTful APIs without worrying about the ways to deal with characterize demand and reaction headers, status codes, HTTP techniques, URL traditions, media writes, payload arrangements and question alternatives and so forth.
  • OData RESTful APIs are anything but difficult to expend.

OData Services Life Cycle

The OData benefit life cycle incorporates traverse of an OData benefit. Given beneath are the key strides to be considered in an OData Service Life Cycle.

  • Initiation of OData benefit.
  • Maintaining and Keeping up OData benefit.
  • Keeping up of models and administrations, up to the cleanup of the metadata store.
  • RESTful applications utilize HTTP solicitations to present information on make or refresh, read information and erase information. REST utilizes HTTP for every one of the four CRUD (Create/Read/Update/Delete) tasks.
  • REST is a lightweight contrasting option to instruments like RPC (Remote Procedure Calls) and Web Services.

With regards to OData Service improvement with SAP NetWeaver Gateway an extremely average utilize case is to assemble an administration that depends on a RFC module (or an arrangement of RFC modules) – e.g. for a List/Detail application.

For such a situation there are many RFC modules (BAPIs) accessible in the SAP standard that can be utilized. What’s more, obviously you can likewise assemble and expend your own (Z-)RFC modules if the current modules don’t fulfill your requirements…

In this Step-by-step Guide we will make an OData Service that expends two RFC modules from the EPM (Enterprise Procurement Model) demo content. From this EPM demo content we pick two BAPIs that recover the rundown and detail of Sales Orders/Line Items.

The information demonstrate is quite straightforward. We have one substance for the Sales Order header information, and one element for the Sales Order Line Item.

The two BAPIs that we are going touse in our administration are: BAPI_EPM_SO_GET_LIST and BAPI_EPM_SO_GET_DETAIL

This guide depends on SAP NetWeaver Gateway 2.0 SP5. We will be primarily utilizing the SAP NetWeaver Gateway Service Builder for the administration creation.

The Service Builder enables us to construct our administration without composing a solitary line of code (despite the fact that regardless you can do coding – on the off chance that you need… ).

Step 1. Make a bew project as name ZGW100_XX_SO (SO remains for Sales Order). XX is only a placeholder for a gathering number and GW100 demonstrates the course number – as the screen shots were taken from the GW100 instructional class material that I have made.

Step 2.Make the primary element by bringing in a RFC interface. For this right-tap on Data Model and pick Import – > RFC/BOR Interface

Step 3. Fill the following values in the wizard and then select Next:

Entity Type Name SalesOrder
Target System Local
Data Source Type Remote Function Calls
Data Source Name BAPI_EPM_SO_GET_LIST

Step 4. Expand the SOHEADERDATA node and select the following fields:
SO_ID,  NOTE,  BUYER_ID, BUYER_NAME,  CURRENCY_CODE,  GROSS_AMOUNT, NET_AMOUNT,  TAX_AMOUNT   
Note that SOHEADERDATA is not selected. Choose Next.

Step 5. In the starting line, SO_ID, select the field Is Key and select Finish

Step 6. Make the second entity again by importing an RFC interface. Right-click Data Model and choose Import -> RFC/BOR Interface

Step 7. Again Enter the following values in the wizard and select Next

Entity Type Name SalesOrderItem
Target System Local
Data Source Type Remote Function Calls
Data Source Name BAPI_EPM_SO_GET_LIST

Step 8.  Spread the SOITEMDATA node and select the following fields:
SO_ID,  SO_ITEM_POS,  PRODUCT_ID,  NOTE,  CURRENCY_CODE,  GROSS_AMOUNT,  NET_AMOUNT,  TAX_AMOUNT,  QUANTITY,  QUANTITY_UNIT
Note that SOITEMDATA is not selected. select Next,

Step 9.  In the first and second line, SO_ID,  SO_ITEM_POS, select the field Is Key and select Finish

 

Be the first to comment on "Fiori ODATA Services Tutorial"

Leave a comment

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.