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./wp-content/uploads/2016/08/1_1017788.png

Provide project details.

/wp-content/uploads/2016/08/2_1017789.png

Step 2:Create entity by importing BOR interface. For this right click on Data Model and choose Import -> RFC/BOR Interface. /wp-content/uploads/2016/08/3_1017790.png

Provide the details.

/wp-content/uploads/2016/08/4_1017791.png

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).              

/wp-content/uploads/2016/08/5_1017792.png

Specify the key field NUMBER and choose finish.

/wp-content/uploads/2016/08/6_1017793.png

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.

/wp-content/uploads/2016/08/7_1017794.png

Step 5: In BOR select the GetDetail for displaying the Purchase requisition details.

/wp-content/uploads/2016/08/8_1017795.png

Select the type as Business object Repository and choose tick box.

/wp-content/uploads/2016/08/9_1017796.png

Step 6: Now map the fields accordingly by selecting the propose mapping button as shown in below screen.

/wp-content/uploads/2016/08/10_1017797.png

Step 7: Fields are mapped accordingly. Check the project, save and generate the project.

/wp-content/uploads/2016/08/11_1017798.png

For Creating Purchase Requisition using BOR interface.

Step 8: For creating purchase requisition similarly map the fields by importing the BOR interface.

/wp-content/uploads/2016/08/12_1017799.png

Step 9: Select the BOR method (CreateFromData) as shown in below screen.

/wp-content/uploads/2016/08/13_1017800.png

Select and proceed.

/wp-content/uploads/2016/08/14_1017803.png

Step 10: Now similarly click on propose mapping button as shown below.

/wp-content/uploads/2016/08/15_1017804.png

Mapping will be done according. Save and generate the project.

/wp-content/uploads/2016/08/16_1017805.png

Testing the Service:

Step 11: Display Purchase requisition

Case1:

Goto Tcode /N/IWFND/MANIT_SERVICE register service.

/wp-content/uploads/2016/08/17_1017807.png

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.

/wp-content/uploads/2016/08/18_1017808.png

Case 3:

Provide the following URL, Select GET and click on EXECUTE to get the sample XML of PR.

/wp-content/uploads/2016/08/19_1017809.png

Step 12 : Create Purchase requisition

Case:1

Click on Use as Request and then select POST and EXECUTE it.

/wp-content/uploads/2016/08/20_1017810.png

Purchase requisition got created.

/wp-content/uploads/2016/08/21_1017811.png

Case 2:

Goto SE11 table and provide the Created PR number. So below screen shows that Purchase requisition is created successfully.

/wp-content/uploads/2016/08/22_1017812.png


To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Matthew Vincent

    Nice guide to creating a service especially a BOR one.

    One thing, you talk about creating a “Query” under Service Implementation but what you have then shown in your screenshots is creating a “Read”.

    Which one did you mean GetEntitySet (Query) or GetEntity (Read)?

    (0) 
  2. Cristina Rodrigues

    Hello,

    I’m creating an application where I need insert purchase requisition .

    And I have one problem if the user insert many items in sapui5 I don’t know how can I send this items from sap gateway and read everyone for inserting in one request.

    Can you explain please ?

    Best Regards

    (0) 

Leave a Reply