To create a new OData web service you first have click New on the overview screen and select the option Creates OData specific web service in the dialog window.

WSD-OData-Example1

As an example scenario we want to design a web service that enables the user to create purchase requisitions in the SAP system. Name the webservice PurchaseRequisiton.

WSD-OData-Example2

After configuring the SAP and SharePoint connection create a new Custom Data Type. For creating purchase requisitions in SAP we use the standard BAPI BAPI_REQUISITION_CREATE. Use the import button to import the following parameters in the New Custom Data Type Dialog. These parameters are the minimum required fields for creating purchase requisitions in SAP.

From table REQUISITION_ITEMS import the following fields:

DOC_TYPE (Document Type)
MATERIAL (Material)
PLANT (Plant)
QUANTITY (Quantity)
DELIV_DATE (Delivery Date)
ACCTASSCAT (Account Assignment Category)

WSD-OData-Example3

WSD-OData-Example4

WSD-OData-Example5

WSD-OData-Example6

WSD-OData-Example7

Save the entries and manually add the item COST_CTR (Cost Center). We need this item for the account assignment.

WSD-OData-Example8

Name the data type ReqItems and save your entries with OK.

WSD-OData-Example9

After that create a new entity in the overview screen.

WSD-OData-Example10

As Custom Data Type use the above created data type ReqItems. Because we only create and don’t read data it is not necessary to use a specific primary key. Just select one of the items in the list. For Entity Set Name choose the name Items. For creating purchase requisitions we only need the CRUD operation Create. Double-click Create and you will come to the WebService Designer construction screen.

WSD-OData-Example11

WSD-OData-Example12

Search for and select BAPI_REQUISITION_CREATE in the Search Function Dialog and close the dialog window with OK. We will take a closer look on the parameter mapping in the next chapter.

WSD-OData-Example13

WSD-OData-Example14