Microservices

SAPB1

The SAPB1 component can be used to perform operations on the SAP Business One ERP solution. Using these four versions of components, operations can be performed on the corresponding version of SAP Business One. Currently SAPB1 component supports simple select, insert, update, upsert (update/insert), and delete operations for the following business objects.

  • Business Partners

  • Orders

  • Items

  • Price Lists

  • Credit notes

  • Delivery notes

  • Invoices

  • Purchase Credit Notes

  • Purchase Delivery Notes

  • Purchase Invoice

  • Purchase Orders

  • Purchase Returns

  • Quotations

  • Delivery Notes Return

  • Receipts Incoming Payments

  • Journal Entries

  • Payments to Vendors

  • Stock Transfer

  • Product Trees

  • Production Order

  • Chart of Accounts

  • Inventory General Entry

  • Inventory General Exit

  • Down Payments

  • Draft

  • Payments Draft

  • Purchase Down Payments

  • Sales Tax Invoice

  • Purchase Tax Invoice

The SAPB1 component requires the credentials of the company to be connected as part of the configuration. These details along with the chosen business object type and operation are used to connect to the company and fetch the schema which is required to perform the operation.

Points to Note

  • This component cannot be launched in-memory of the peer server.

  • This component requires a SAP Business One client environment installed on the machine where the peer server is running.

  • This component requires Microsoft .NET Framework 3.5 or above installed on the machine where the peer server is running.

Configuration

The component can be configured using the properties in the Custom Property Sheet (CPS) shown in the figure below.

Connection Configuration

worddav062f70f6e03abba3a28eb3879794b2b1.png

Use Connection Details from input: Select "yes" to use connection details provided in the input request message or "no" otherwise.

The component has to be configured with any server details to connect even when "Use Connection Details from input" is set to "yes" to populate the schema on input/output ports. But during run-time, connection details provided in the input message only will be used. 


Server: Name of the machine where SAP Business One Company server is present.
Company DB: Name of the SAP Business One company database.
UserName: SAP Business One user login name.
Password: SAP Business One user password.
DB UserName: SAP Business One company database's user name required as part of SQL server authentication.
DB Password: SAP Business One company database's password required as part of SQL server authentication.
DB Server Type: Server type of SAP Business One company database.

worddav7d5b8209d069309df7697269fcf3d9a2.png

License Server: Machine name of SAP Business One License server along with the port number of sub-license server (e.g. localhost:30000).
Language: Language of SAP Business One data.

worddav414c4cddb6172d8aefa4b3f7c3872509.png

Use Trusted:

  • yes: To use Windows authentication in the SQL server.

  • no: To use the SQL server's login credentials for authentication.

Select Object Type: Business object type on which the operation has to be performed.
Select Action: The operation which has to be performed on the selected business object type.

worddavbc6eba40e7d7c3c84edd1256e843f744.png

Error Handling Configuration

worddave271962e50dd9d196bcc5134c32dc8eb.png

Details of these configurations can be referred to in the Common Component Configurations section.

Schema Generation

The schemas are automatically generated for the ports based on the configuration.

Request Schema

The input schema is auto-generated based on operation, the business object selected, and the property "Use Connection Details from input" as shown below.

worddav417def7fcfeb3bd44ee36676b6b3f40a.png

worddavcdd2e55bdf769e33b8a2bde00d8caf0f.png

worddav8d98b7e870eaded7ef0bf0b11b875058.png

worddav761df8650935490344d5b5bc2c610c02.png

worddavad7bd3a20fe6a6d2f0a2cb85d9eee356.png

worddav1a12e157b8438325a52cc20e31c4ec4c.png

Response Schema

The output schema is auto-generated based on operation, business object is selected as shown below.

worddav9e6d884697325c015f3a722f7ab716c1.png

worddav77bdc280eda876b392c7b94fffa5687a.png

Testing

After the SAPB1 component is configured, the connection to the SAP Business One company database can be tested using the Test Connection button.

Functional Demonstration

Scenario

Add a new Price List to the SAP Business One company database and display the response.

Configure the SAPB1 component as described in Configuration section and use the Feeder component configured with the schema fetched from the connected port of SAPB1 to send input requests and use the display component to check the response.

worddav2681ff75cb0f58d90578f5b6b2f4caa7.png

Sample Input

XML
<?xml version="1.0" encoding="UTF-8"?>
<ns1:Input xmlns:ns1="http://www.fiorano.com/SAPB1">
   <ConnectionSettings>
      <Server>192.168.1.206</Server>
      <CompanyDB>SBOdemoIN</CompanyDB>
      <UserName>manager</UserName>
      <Password>manager</Password>
      <DBUserName>sa</DBUserName>
      <DBPassword>fiorano</DBPassword>
      <DBServerType>4</DBServerType>
      <LicenseServer>192.168.1.206:30000</LicenseServer>
      <Language>3</Language>
      <UseTrusted>no</UseTrusted>
   </ConnectionSettings>
   <ObjectSchema>
      <BOM>
         <BO>
            <AdmInfo>
               <Object>6</Object>
            </AdmInfo>
            <OPLN>
               <row>
                  <ListName>MARGIN Price</ListName>
                  <BASE_NUM>1</BASE_NUM>
                  <Factor>1.000000</Factor>
                  <RoundSys>0</RoundSys>
                  <GroupCode>1</GroupCode>
               </row>
            </OPLN>
         </BO>
      </BOM>
   </ObjectSchema>
</ns1:Input>

Sample Output

XML
<?xml version="1.0" encoding="UTF-8"?>
<ns1:Return xmlns:ns1="http://www.fiorano.com/SAPB1">
   <Key>9</Key>
   <Type>S</Type>
   <MessageCode />
   <Description />
</ns1:Return>

The returned response includes the key of the newly added business object, type S (Success) or E (Error) according to whether the operation is successful or not. If the operation fails, the corresponding Message code and description are returned.