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.
Provide project details.
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,
Specify the key field NUMBER and choose finish.
For displaying (READ) 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 READ 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
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.
Click on SAP Gateway Client.
Provide the following URL, Select GET and click on EXECUTE to get the sample XML of PR.
Step 12 : Create Purchase requisition
Click on Use as Request and then select POST and EXECUTE it.
Purchase requisition got created.
Goto SE11 table and provide the Created PR number. So below screen shows that Purchase requisition is created successfully.