Learning Objectives:-
This unit describes:-
- How to Update a business object SAP Business Partner in SAP Business One?
Introduction: #
In this tutorial, we will learn How to update a Business partner object in SAP Business one using operation PATCH in SAP business one Adapter. As we knew already, to Update the records of the Business Partner module in the SAP Business One Client Application. Still, in the Business Partner module, we need to know the card code, and we need to using PATH Parameter to Update the record in Business Partner. For Update the record of BusinessPartner in SAP Business One, we need the request Interface. We can process data manually and scheduler to know detail about How to run the outbound interface manually or scheduler please follow this link: https://docs.skyvva-dev.com/docs/tutorial-v2-41-lightning/129-how-to-run-the-outbound-interface-through-the-manually-or-scheduler/
Pre-required: #
- Create Integration
- Create Connection destination on SAP Control Board.
- Generate SAP Business one Metadata by using Import SAP Metadata.
- Create Outbound Interface linked with Metadata SAP Business one.
- Create SAP Business one Adapter on SAP Control Board.
Step 1: Create Integration:
To know detail about Integration, please follow this tutorial. What is Integration, and How to use it?
- Here’s Integration
Step 2: Create Connection Destination SAP Control Board.
- Click SAP Control Board on Integration.
- Fill name choosing type SAP Business One and click Continue.
- Here’s an example.
- Fill Host URL, Port Forward, Username, Password, URL Path, and Company Database of SAP Business one Application.
- Click ping SAP Connection and Click Save Button.
- Here’s Example.
Step 3: Create Metadata SAP by using SAP Import Metadata.
- Go to Repository and click Import SAP Metadata.
- Choosing Direct SAP Connection
- select Connection Type,
- Select Connection Destination,
- Choose to Create Message Type to invoke SAP Business One API
- click Retrieve.
- Search Metadata Name Business Partner, choose a business partner, and click create Message Type.
After that, we will see the message type object Business Partner.
- Here’s the message type of business Partner.
- We need to create field CardCode in QUERY Parameter Message Type.
Go to Query Parameter Message Type in URL Message Type of Request Message Type and then click Query Parameter. See the example below.
- Go to Related and Create Message Type Field Entry by clicking Button New. See the example below.
- Fill Message type Entry Name and Istructure. This section wants to update the business partner record so we need to create CardCode Message Type field Entry as a PATH Parameter to use for update the business partner record.
- We need to fill in Message type Field Entry Name and Istructure and click save Button. See the example below.
Step 4: Create Outbound Interface and Linked with this message type.
- Go to Integration detail, click Interface tap, click the New Interface button.
- Here’s Outbound Interface that is linked with SAP business Partner Message Type.
- Do mapping
In this step, we can use mapping by Instance value and Dynamic Value. When salesforce records have a value of card code already, we need to map the field to field in Query Parameter. Here’s an example. We have field SAP_ID that stores the value of business partners, so we need to map that field to target fields of CardCode in Query Parameter.
- See the picture below.
Step 5: Create SAP Business One Adapter on SAP control Board.
- Go to the SAP control board and click tab Adapter.
- Click New Button.
- Fill Name, Type: SAP Business one, Deployment: On Cloud, Integration Framework: Service Layer, Protocol: Rest, Authentication: Basic, Past the API endpoint that we copy from Create Metadata in the properties API service Endpoint URL, Choosing Operation PATCH , Request and Response Format Json, and choosing connection Destination.
- We need to put (‘{!CardCode}’) in fields URL Query Parameter.
- Here we have select the non in Salesforce Id Handling. It means in the response it will not return the salesforce Id back.
- Click ping connection to make sure that the configuration adapter is successful.
- click save
- Here’s Example.
If we select “Return Salesforce Id into the response” then the Salesforce Id will come in the Response interface.
• Go to Request Interface and Linked this adapter.
• Here’s an example.
- Here’s the Record that we need to change in SAP Business One
- Here’s the salesforce record that was changing the name for Test1 to HelloSAPTest.
Step 6: Callout data by using Manual Process.
- Go to Interface Tap on SAP Control Board.
- Select Interface and click Manual Process. See the example below.
- Select Manually Select the sObjects using the Query Builder and click Next.
- Click Execute SOQL, a select record that we want to send to SAP business one, and click OK.
- Click Send
- Go to message Monitor to see the result.
- Here’s the result In SAP Business one Application.
Summary #
Finally, we have learned how to update the record from salesforce to SAP Business One Application using operation PATCH in SAP Business one Adapter. The next section will learn how to Delete Business Partner using Operation Delete in SAP Business One Adapter.