SK SKYVVA Documentation

5. How to Query a single, list, and Execute the SQL Query of business object in SAP Business One?

Learning Objectives:- This unit describes:-

Introduction:

This tutorial will learn How to Query a single record of the Business partners module in SAP Business one using operation GET in SAP business one Adapter. As we knew already, to GET  the records of the Business Partner module in the SAP Business One Client Application, we still need to know the card code, and we need to use PATH Parameter to GET the record in Business Partner. For GET the record of BusinessPartner in SAP Business One, we need the request Interface and Response Interface. We can process data manually and scheduler to know details about How to run the outbound interface or scheduler manually. Would you please follow this link: #article/129-how-to-run-the-outbound-interface-through-the-manually-or-scheduler

Pre-required:

Step 1: Create Integration: To know detail about Integration, please follow this tutorial. What is Integration, and How to use it? 

Step 2: Create Connection Destination SAP Control Board.

Step 3: Create Metadata SAP by using SAP Import Metadata. [su_box title="Note" box_color="#2a8af0" title_color="#000000"] We need to create Metadata Provider and a Repository. [/su_box] Follow this link to see detail about How to use and create Metadata Provider and Repository.

Note: Copy the URL of module order that we choose for using in API endpoint on Adapter.

After that, we will see the message type object Business Partner.

Go to Query Parameter Message Type in the URL Message Type of Request Message Type and click Query Parameter. See the example below.

Step 4:  Create Outbound Interface, Inbound Interface, and linked with Message Type that we generated.

Step 5: Linked Request and Response Interfaces.

Step 6: Create SAP Business One adapter.

• Go to Request Interface and Linked this adapter. • Here’s an example.

Step7: Callout Data by using Manual Process.

2. How to query in list of records with BusinessPartner Module.

Step1: We need to modify Message type Body of Response. We need to modify the Message type of Body response in the List value.

Step2:  Create Outbound Interface and Inbound Interface. We need to link both Interfaces with Message Type that we modify.

Step 3: Go to the SAP control board and create SAP Business One  Adapter. We put BusinesssPartners in field API service Endpoint meaning that we query all records from Sap business Partner to Salesforce.

Step4: link this Adapter with the Request Interface.

Step 5: Callout by using Manual process on sap control board.

3. Query From SQL Query. We can query From SQL Query when we already create SQL Query in SAP Business One. For example, if we have Create SQL query from a Business partner so we need to Create Outbound and Inbound Interfaces that are linked with the Business partner's message type that has response message type in the list as the Topic Query in List,  we do mapping as normal and then we just Put API service EndPoint to SQLQuery and we need to put the SQL code in SAP Business One that we have.

We do in the same way as the case query in the list.

Summary

Finally, we have learned how to Query a single record and query all records from SAP Business One Application using operation Get in SAP Business one Adapter.

Open this article in the interactive viewer →