This blog shows how to display and create PR using gateway services(BOR interface) in detail.
Business Object Repository(BOR) in Gateway Service:
It generally used to reduce the time required to create entity types in your data model, SAP Gateway Service Builder provideImport RFC/BOR Interface function with which you can import an existing data source and reuse this data to create new entity types with ease.
Step 1:Open Tcode SEGW and create project as shown below.
Provide project details.
Step 2:Create entity by importing BOR interface. For this right click on Data Model and choose Import -> RFC/BOR Interface.
Provide the details.
Step 3:Expand and select the following fields for creating the Purchase requisition and choose next.
Fields selected RequisitionItems(PREQ_ITEM, DOC_TYPE, MATERIAL, PLANT, QUANTITY, UNIT,
DELIV_DATE),Number,Return(TYPE,MESSAGE,LOGMSGNO).
Specify the key field NUMBER and choose finish.
For displaying (QUERY) Purchase Requisition using BOR interface.
Step 4: Now basic definition of data model is done successfully. As a next step we need to map the fields.
Navigate to service implementation and create the QUERY to display the Purchase requisition.
Step 5: In BOR select the GetDetail for displaying the Purchase requisition details.
Select the type as Business object Repository and choose tick box.
Step 6: Now map the fields accordingly by selecting the propose mapping button as shown in below screen.
Step 7:Fields are mapped accordingly. Check the project, save and generate the project.
For Creating Purchase Requisition using BOR interface.
Step 8:For creating purchase requisition similarly map the fields by importing the BOR interface.
Step 9: Select the BOR method (CreateFromData) as shown in below screen.
Select and proceed.
Step 10:Now similarly click on propose mapping button as shown below.
Mapping will be done according. Save and generate the project.
Testing the Service:
Step 11: Display Purchase requisition
Case1:
Goto Tcode /N/IWFND/MANIT_SERVICE register service.
Provide System Alias and Click on Get Service. Select Our Created Service and click on Add Selected Service.
Case 2:
Click on SAP Gateway Client.
Case 3:
Provide the following URL, Select GET and click on EXECUTE to get the sample XML of PR.
Step 12 :Create Purchase requisition
Case:1
Click on Use as Request and then select POST and EXECUTE it.
Purchase requisition got created.
Case 2:
Goto SE11 table and provide the Created PR number. So below screen shows that Purchase requisition is created successfully.