Introduction
This tutorial will learn How to query limit records by using $skip and $top and query all records of the Business partners Collection in SAP Business ByDesign using operation GET in SAP business Bydesign Adapter. This adapter is useful for user who want to get records from sap business ByDesign to create in salesforce.
Pre-required
- Create Integration
- Create Connection destionation of sap business bydesign.
- Generate SAP business bydesign message type
- Create request and response Interfaces.
- Create sap business bydesign adapter operation get.
How to query limit records using $skip and $top?
Step1: Create Integration
- Here’s the Integration
Step 2: Create Connection destination of sap business Bydesign
- Go to Integration detail and click sap control board. See the picture below.
- Click destination new , fill name and choosing type Sap Business Bydesign and click continue button.
Fill Host URL, Username, Password, URL path of sap business ByDesign, Company Database which is collection of sap business ByDesign that user want to use. In this case we will learn how to query Business partner.
- Click Ping Sap Connection button.
Step 3: Generate Message type business partner.
To Generate Message type, we need to have Metadata Provider and Repository. Go to Repository and click Import SAP Metadata.
- Here’s the Repository.
- Choose Direct SAP Connetion -> Select Application: SAP Business ByDesign -> Select Sap Connection Destination ->Select Template Rest and click Retrive Button. See the picture below.
We can using Search function to find Business Partner then click the BusinessPartnerCollection and click Create Message Type button.
- Here’s the Message Type that we generated.
Step4: Create Request Response Interfaces.
- Here’s the request Interface.
- Here’s the Response Interface.
- We need to do mapping on Response Interface. Here’s the example below.
- We need to linked between response interface and request interface.
To linked response interface and request interface , we need go to Request Interface detail and scroll down to find field response interface and put the response interface with that field.
- Here’s the example.
Step 5 : Create SAP Business Bydesign Adapter.
Go to Sap control board and click adapter tap->click new for create New Adapter.
- Click New button and fill the required fill such as Name, Type: SAP Business By Design, Direction: Outbound, Status: Active, Protocol: Rest, Authentication Type: Basic, Operation: Get, API Service Endpoint URL : The URL OData Business partner collection , Request format : application/json, response format: application/json , skip and top meaning that we can skip records and limit the records for query and put the connection destination.
In this case, we will learn how to get records with limit 2 records from sap business bydesign .
- Here’s the example
- Linked this adapter with request Interface. See the example below.
- Now we can callout data to get 2 records which is the first and second records.
Select the request Interface and click Manual process button
- Select Execute Anyway, for example HTTP Get Operation without a body and click send.
- Go to Message monitor to see the result.
How to query all records?
We can get all records from sap business ByDesign by tick the flag pagination. In the flag pagination meaning that we will get all data from sap business ByDesign for skip 0 meaning that we will get records from 1 and Top 20 meaning that we will get response 20 records in one response. We can using the same interfaces and adapter.
- Here’s the adapter to get all records in sap Business ByDesign.
- Let’s callout to see the result.
- Go to Message monitor to see the result.
It will get all records from sap business by design and in one response it get 20 records.
- Here’s the 20 records of one response.