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.
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.
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)
DELIV_DATE (Delivery Date)
ACCTASSCAT (Account Assignment Category)
Save the entries and manually add the item COST_CTR (Cost Center). We need this item for the account assignment.
Name the data type ReqItems and save your entries with OK.
After that create a new entity in the overview screen.
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.
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.