bw2:sap_business_one_integration_using_di

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
bw2:sap_business_one_integration_using_di [2021/02/10 17:42]
akoehler [Adding/Updating Business Partner Contacts & Addresses]
bw2:sap_business_one_integration_using_di [2022/08/02 16:45] (current)
akoehler
Line 1: Line 1:
 ====== Introduction (SAP Business One Integration on SQL Server) ====== ====== Introduction (SAP Business One Integration on SQL Server) ======
  
-This page discusses the Bizweaver tools used for integration with SAP Business One (SBO) on SQL Server databases.+This page discusses the Bizweaver tools used to integrate SAP Business One (SBO) on SQL Server databases.
  
 ====== Related Documents ====== ====== Related Documents ======
Line 16: Line 16:
 ====== Special Terminology ====== ====== Special Terminology ======
  
-  * **DI Server** refers to an application from SAP Business One that communicates with SAP Business One for the purposes of data manipulation. DI Server is licensed separately from the core SAP Business One application. +  * **DI Server** refers to an application from SAP Business One that communicates with SAP Business One for data manipulation purposes. DI Server is licensed separately from the core SAP Business One application. 
-  * **DI API** refers to a component of the core SAP Business One application that communicates with SAP Business One for the purposes of data manipulation.+  * **DI API** refers to a component of the core SAP Business One application that communicates with SAP Business One for data manipulation purposes.
  
 ====== Before You Begin ====== ====== Before You Begin ======
Line 25: Line 25:
 ====== Overview ====== ====== Overview ======
  
-The discussions in this document assume that you are using either DI Server or DI API to communicate with SAP Business One in a SQL Server environment. These tools can also be used in a HANA environment but with some limitations. New functionality beginning in SAP Business One v9.2 may not be supported with DI Server or DI API.+This document'discussions assume that you are using either DI Server or DI API to communicate with SAP Business One in a SQL Server environment. Mapping tools can be implemented by a user in a HANA environment but with some limitations. New mapping functionality beginning in SAP Business One v9.2 may not be supported with DI Server or DI API.
  
-For HANA environments Third Wave recommends the use of the SAP Business One Service Layer. This is a web service-based set of APIs that support integration activities. Unfortunately, **this approach is only available for HANA environments**. The Service Layer is supported in Bizweaver via the Web Service tool. Information on using the Service Layer integration will be provided in a separate document.+For HANA environmentsThird Wave recommends the use of the SAP Business One Service Layer. This is a web service-based set of APIs that support integration activities. Unfortunately, **this approach is only available for HANA environments**. The Service Layer is supported in Bizweaver via the Web Service tool. Information on using the Service Layer integration will be provided in a separate document.
  
-There are two Bizweaver tools that are used for integration with SAP Business One: **Mapper** and **SBO Update**. These tools are specific to SAP Business One and are not used for any other purpose.+Two Bizweaver tools are used for integration with SAP Business One: **Mapper** and **SBO Update**. These tools are specific to SAP Business One and are not used for any other purpose.
  
-To illustrate the SAP Business One integration process, we will use the following workflow. In this case, the source data is coming from database tables that are associated with a Versago form. (Versago is a Web/Mobile portal application from Third Wave). However, the same principles apply for any data source (e.g. flat files, etc.).+To illustrate the SAP Business One integration process, we will use the following workflow. In this case, the source data is coming from database tables associated with a Versago form. (Versago is a Web/Mobile portal application from Third Wave). However, the same principles apply to any data source (e.g.flat files, etc.).
  
-{{  :bw:sapimage.png?576x99  }}+{{ :bw2:bizweaverdi1.png |}}
  
 The basic process is: The basic process is:
  
-  - A SQL Command: Reader step gets a list of orders to be processed.+  - A SQL Command: The reader step gets a list of orders to be processed.
   - A Loop is started to process each order record.   - A Loop is started to process each order record.
-  - A SQL Command: Reader step gets the details for each order to be processed based.+  - A SQL Command: The reader step gets the details for each order to be processed based.
   - The detailed data is mapped to the corresponding fields in SAP Business One.   - The detailed data is mapped to the corresponding fields in SAP Business One.
   - The mapped data is passed through the SAP Business One DI Server to update the designated company database.   - The mapped data is passed through the SAP Business One DI Server to update the designated company database.
Line 46: Line 46:
 ====== Mapper Tool ====== ====== Mapper Tool ======
  
-The **Mapper** tool is used to connect the incoming data columns to the appropriate value in SAP Business One.+The **Mapper** tool connects the incoming data columns to the appropriate value in SAP Business One.
  
 ===== Define Connections ===== ===== Define Connections =====
  
-{{  :bw:sapimage2.png?384x81  }}+{{ :bw2:bizweaverdi2.png |}}
  
   - Select a **DI** **Connection** to an SAP Business One database from the drop-down list.   - Select a **DI** **Connection** to an SAP Business One database from the drop-down list.
Line 61: Line 61:
 ===== Select the Desired SAP Business One Object ===== ===== Select the Desired SAP Business One Object =====
  
-An SAP Business One “object” is the document or transaction to be created. In this example we will create a Sales Order.+An SAP Business One “object” is the document or transaction to be created. In this examplewe will create a Sales Order.
  
-The list of objects will be slightly different based on the DI connection being used. When DI API is being used, the object name starts with “o, where DI Server does not. Using Sales Orders as an example:+The list of objects will be slightly different based on the DI connection being used. When DI API is being used, the object name starts with “o,” where DI Server does not. Using Sales Orders as an example:
  
   * DI Server: OrdersService   * DI Server: OrdersService
Line 70: Line 70:
 Double-click on the object name to continue. Double-click on the object name to continue.
  
-{{  :bw:sapimage3.png?222x136  }}+{{ :bw2:bizweaverdi3.png |}}
  
 ===== Select the Desired Command ===== ===== Select the Desired Command =====
Line 78: Line 78:
 Double-click on the command to continue. Double-click on the command to continue.
  
-{{  :bw:sapimage4.png?328x439  }}+{{ :bw2:bizweaverdi4.png |}}
  
 ===== Select the Desired Object Components ===== ===== Select the Desired Object Components =====
  
-The “Object Components” are the elements of the document or transaction that will be used. Most SAP Business One objects have multiple components and you must know which ones are appropriate for your application. In most cases, you will need “Documents” and “Document_Lines” at a minimum. “Documents” is the header information and “Document_Lines” is the information in the rows grid in SAP Business One.+The “Object Components” are the elements of the document or transaction that will be used. Most SAP Business One objects have multiple componentsand you must know which ones are appropriate for your application. In most cases, you will need “Documents” and “Document_Lines” at a minimum. “Documents” is the header informationand “Document_Lines” is the information in the rows grid in SAP Business One.
  
-{{  :bw:sapimage5.png?359x282  }}+{{ :bw2:bizweaverdi5.png |}}
  
 Double-click on the desired object component to select it. Double-click on the desired object component to select it.
Line 92: Line 92:
 ===== Mapping ===== ===== Mapping =====
  
-“Mapping” is the process of defining which SAP Business One values are to be updated from which values are provided as input. It is accomplished by using drag-and-drop to link source data values to the corresponding SAP Business One value.+“Mapping” is the process of defining which SAP Business One values are updated from which values are provided as input. It is accomplished by using drag-and-drop to link source data values to the corresponding SAP Business One value.
  
-  - Locate the source value in the left-hand column (as shown below) and the target value in the right-hand column.+  - Locate the source value in the left-hand column (as shown below) and the right-hand column's target value.
   - Click on the source value and drag & drop it on the corresponding field in the column on the right.   - Click on the source value and drag & drop it on the corresponding field in the column on the right.
     - A line between the two values indicates that they are now mapped.     - A line between the two values indicates that they are now mapped.
Line 101: Line 101:
 ==== Header Mapping Example ==== ==== Header Mapping Example ====
  
-{{  :bw:sapimage6.png?384x224  }}+{{ :bw2:bizweaverdi6.png |}}
  
-==== Row Detail Mapping Example ====+==== Search Bar ====
  
-{{  :bw:sapimage7.png?384x255  }}+A search function is available in the Mapper to assist with looking for fields if the source or target lists are too long.
  
 +{{ :bw2:sapsearch.png |}}
 +
 +==== Row Detail Mapping Example ====
 +
 +{{ :bw2:bizweaverdi7.png |}}
  
   - Tabs indicating selected object components are shown at the top of the mapping section.   - Tabs indicating selected object components are shown at the top of the mapping section.
Line 113: Line 118:
       - In general, header records will use the “Change of Value” option.       - In general, header records will use the “Change of Value” option.
           - Select the appropriate value from the drop-down list.           - Select the appropriate value from the drop-down list.
-      - Detail records (e.g. order rows) will use the “Every Row” option. +      - Detail records (e.g.order rows) will use the “Every Row” option. 
-      - See **Mapping Tips** section later in this page for more information.+      - See **Mapping Tips** section later on this page for more information.
   - Listing of values from the data source.   - Listing of values from the data source.
   - Link indicators.   - Link indicators.
Line 122: Line 127:
       - The list of values changes based on the selected object component.       - The list of values changes based on the selected object component.
   - Source-to-target mapping list.   - Source-to-target mapping list.
-      - Lists all source values that have been mappedand the value to which they are mapped.+      - Lists all source values that have been mapped and the value to which they are mapped.
       - This listing is for information only.       - This listing is for information only.
-  Use the [**Clear Links**] button to clear all links for the object component currently being displayed.+  Use the [**Clear Links**] button to clear all links for the currently displayed object component.
  
 ====== SBO Update ====== ====== SBO Update ======
Line 130: Line 135:
 The **SBO Update** tool handles the communication between Bizweaver and the SAP Business One DI. This is the step that updates SAP Business One. The **SBO Update** tool handles the communication between Bizweaver and the SAP Business One DI. This is the step that updates SAP Business One.
  
-{{  :bw:sapimage8.png?475x166  }} +{{ :bw2:bizweaverdi8.png |}}
 Select a **Mapper** workflow step from the drop-down list. Select a **Mapper** workflow step from the drop-down list.
  
 <WRAP center round tip 60%> <WRAP center round tip 60%>
 New in v2.4 New in v2.4
-Only the appropriate Mapper step must be selected.  The associated DI connection is selected automatically.+in the SBO Update step, a user must only select the appropriate Mapper step must be selected.  The associated DI connection is selected automatically.
 </WRAP> </WRAP>
  
Line 144: Line 148:
 ===== Adding Activities ===== ===== Adding Activities =====
  
-When adding activities in the mapper tool if you are using the DI API or DI Server you will choose different options to do so+When adding activities in the mapper tool, you will choose different options if you are using the DI API or DI Server. 
  
   * DI API - oContacts in Mapper tool    * DI API - oContacts in Mapper tool 
Line 155: Line 159:
 <code sql>Convert(varchar,DateFieldName,112) as [AliasName] </code> <code sql>Convert(varchar,DateFieldName,112) as [AliasName] </code>
  
-where FieldName is the column to be converted and AliasName is the name to be used on output.+FieldName is the column to be convertedand AliasName is the name to be used on output.
  
 For example: <code sql> convert(varchar,DocDate,112) as [DocDate] </code> For example: <code sql> convert(varchar,DocDate,112) as [DocDate] </code>
Line 163: Line 167:
 At first glance, it might appear that header data and row data should be two separate data sets. This is not the case. Each incoming record must contain all needed columns for both the header and the row. At first glance, it might appear that header data and row data should be two separate data sets. This is not the case. Each incoming record must contain all needed columns for both the header and the row.
  
-This is where the ‘Create new record for …” options come into play. Assume you have ten records for an order, each representing an order row. This means that the source record ID, customer code, etc. are presented ten times, once on each row.+This is where the ‘Create new record for …” options come into play. Assume you have ten records for an order, each representing an order row. This means that the source record ID, customer code, etc.are presented ten times, once on each row.
  
-To avoid creating ten orders, one for each row, we use the “Change of value” option. This option ensures that a header record is created only when the specified key record value in the incoming data changes.+To avoid creating ten orders, one for each row, we use the “Change of value” option. This option ensures that a header record is created only when the specified key records value incoming data changes.
  
-At the same time, the rows typically use the “Every record” option. This means that a row record is created for each incoming rowbut within the designated header value. Note, however, that in some cases the “Change on value” option for rows may use a specific value. See Appendix D for an example of this type of usage.+At the same time, the rows typically use the “Every record” option. This means that a row record is created for each incoming row but within the designated header value. Note, however, that the “Change on value” option for rows may use a specific value in some cases. See Appendix D for an example of this type of usage.
  
 ===== Default Values ===== ===== Default Values =====
Line 178: Line 182:
   * The default numbering sequence will be used unless an alternate sequence is specified.   * The default numbering sequence will be used unless an alternate sequence is specified.
   * The salesperson associated with the Business Partner will be used on documents that have a salesperson reference.   * The salesperson associated with the Business Partner will be used on documents that have a salesperson reference.
-  * Prices (in sales and purchasing documents) will be based on the price list associated with the Business Partner. If you want to use different pricing, the best option is to pass in the LineTotal (extended) value. The DI will then use the line total and quantity to calculate the appropriate discount from the price list price. **The DI generally ignores unit price and discount information**. +  * Prices (in sales and purchasing documents) will be based on the Business Partner'price list. If you want to use different pricing, the best option is to pass in the LineTotal (extended) value. The DI will then use the line total and quantity to calculate the appropriate discount from the price list price. **The DI generally ignores unit price and discount information**. 
-  * This is not an exhaustive list of default values. In most cases the DI will follow the same logic as the user application.+  * This is not an exhaustive list of default values. In most casesthe DI will follow the same logic as the user application.
  
 ====== SAP Business One Enumerators ====== ====== SAP Business One Enumerators ======
Line 189: Line 193:
 ====== SAP Business One Data Schemas ====== ====== SAP Business One Data Schemas ======
  
-The information **DI Server** uses in the Bizweaver Mapper and SBO Update tools is obtained from SAP Business One schema files. These files contain information about the various data objects that are available, what actions can be performed on each object, and the data elements of each object. Bizweaver DI Server connections interact with SAP Business One to create its own version of these files.+The information **DI Server** uses in the Bizweaver Mapperand SBO Update tools are obtained from SAP Business One schema files. These files contain information about the various data objects available, what actions can be performed on each object, and the data elements of each object. Bizweaver DI Server connections interact with SAP Business One to create its own version of these files.
  
-From time to time it may be necessary to update these files. This generally happens automatically when a Mapper step is opened. If the files need to be updated, Bizweaver will appear to “pause” for several seconds. A progress bar is displayed while the update is executing. When the progress bar disappears, you will be able to continue working.+From time to time, when using the DI Server, it may be necessary to update these files. This generally happens automatically when a Mapper step is opened. If the files need to be updated, Bizweaver will appear to “pause” for several seconds. A progress bar is displayed while the update is executing. When the progress bar disappears, you will be able to continue working.
  
 See **//[[bw2:SBOSchemas|SBO Schemas]]//** for more information. See **//[[bw2:SBOSchemas|SBO Schemas]]//** for more information.
Line 197: Line 201:
 ===== User Defined Objects (UDO) ===== ===== User Defined Objects (UDO) =====
  
-Bizweaver will create DI Server schemas for SAP Business One User Defined Objects (UDO). For this process to work the UDO **name** assigned in the registration process cannot contain any spaces. If you have followed the instructions above and still don’t see the UDO, this is the first place to check.+Bizweaver will create DI Server schemas for SAP Business One User Defined Objects (UDO). For this process to workthe UDO **name** assigned in the registration process cannot contain any spaces. If you have followed the instructions above and still don’t see the UDO, this is the first place to check.
  
 {{  :bw:sapimage10.png?384x259  }} {{  :bw:sapimage10.png?384x259  }}
Line 209: Line 213:
 ===== Adding/Updating Business Partner Contacts & Addresses ===== ===== Adding/Updating Business Partner Contacts & Addresses =====
  
-The SAP Business One DI handles Business Partner Contacts and Addresses in a rather odd manner. It is not possible to simply add a new contact or address. Nor is it possible to simply update a single existing contact or address record. Instead, you must retrieve ALL appropriate records for the Business Partner. This can be done with a UNION statement in the source SQL.+The SAP Business One DI handles Business Partner Contacts and Addresses in a rather odd manner. It is not possible to add a new contact or address. Nor is it possible to update a single existing contact or address record. Instead, you must retrieve ALL appropriate records for the Business Partner. This can be done with a UNION statement in the source SQL.
  
-Note that in both cases the function is an UPDATE, not an Add. This is a bit confusing since you are adding a new record. But you are updating the master record. The DI process takes care of figuring out which child records are additionsand which are updates.+Note that in both casesthe function is an UPDATE, not an Add. This is a bit confusing since you are adding a new record. But you are updating the master record. The DI process takes care of figuring out which child records are additions and which are updated.
  
   * **[[bw2:Adding and Updating Business Partner Addresses]]**   * **[[bw2:Adding and Updating Business Partner Addresses]]**
Line 217: Line 221:
  
 ===== Inventory Transfers with Bins ===== ===== Inventory Transfers with Bins =====
-  * [[bw2:Inventory Transfers with Bins]]+  * **[[bw2:Inventory Transfers with Bins]]**
  
 ===== Using SAP Business One Messages ===== ===== Using SAP Business One Messages =====
-  * [[bw2:B1 Messages]]+  * **[[bw2:B1 Messages]]**
  
 ====== Error Handling Using File Writer ====== ====== Error Handling Using File Writer ======
  
-The Bizweaver File Writer tool can be used to create a file to be used for transaction processing tracking. A common use of this type of file is to capture error information when a transaction in SAP Business One is being created.+The Bizweaver File Writer tool can create a file to be used for the transaction processing track. A common use of this type of file is to capture error information when an SAP Business One transaction is created.
  
 The Custom Output File Writer option must be used to create this type of file. In this example, we are using all three sections of the custom output. The Body section of the file contains the response from the SAP Business One DI. The Custom Output File Writer option must be used to create this type of file. In this example, we are using all three sections of the custom output. The Body section of the file contains the response from the SAP Business One DI.
  
-{{  :bw:sapimage14.png?346x360  }}+{{ :bw2:bizweaverdi9.png |}}
  
 The values that are used in the Body section are shown below. Press F4 to get a list of all available variables. The values that are used in the Body section are shown below. Press F4 to get a list of all available variables.
Line 238: Line 242:
 Message: WorkFlow(DI_ServiceCall).Get({MESSAGE}) Message: WorkFlow(DI_ServiceCall).Get({MESSAGE})
 </code> </code>
-  * **RetKey** is the key value returned from SAP Business One when a document is posted successfully. +  * **RetKey** is the key-value returned from SAP Business One when a document is posted successfully. 
-  * **Value** indicates whether the SAP Business One posting was successful. Values returned will be either “Y” for success or “N” for fail. In most cases this variable will be used in a decision step.+  * **Value** indicates whether the SAP Business One posting was successful. Values returned will be either “Y” for success or “N” for fail. In most casesthis variable will be used in a decision step.
   * **RetType** is the SAP Business One object ID for the document that was created.   * **RetType** is the SAP Business One object ID for the document that was created.
-  * **Message** is the response returned from the SAP Business One ID if the posting was not successful. This will general provide some information as to the problem. No message information is returned if the posting was successful.+  * **Message** The response returned from the SAP Business One ID if the posting was unsuccessful. This will generally provide some information as to the problem. No message information is returned if the posting was successful.
  
 Following is the output to the file based on the setup described here. The mapping was deliberately done incorrectly to illustrate the output from SAP Business One. Note that {RetKey} is blank, {Value} is “N” and {Type} is blank since the posting failed. {Message} describes the issue as it came from the SAP Business One DI. Following is the output to the file based on the setup described here. The mapping was deliberately done incorrectly to illustrate the output from SAP Business One. Note that {RetKey} is blank, {Value} is “N” and {Type} is blank since the posting failed. {Message} describes the issue as it came from the SAP Business One DI.
  
 <code> <code>
-This is the Header section+This is the Header section.
  
-Service Call forC20000+Service Call for C20000
 File written at 2016-03-01 09:56:06.220 File written at 2016-03-01 09:56:06.220
  
  
-This is the Body section+This is the Body section.
 ===== =====
  
Line 262: Line 266:
 This is the Footer section This is the Footer section
 </code> </code>
-An additional workflow step could also be added to email this file to someone as an alert that a problem occurred.+An additional workflow step could also be added to email this file to someone alert that a problem occurred.
  
 ====== Versago Uploaded Files to SAP Business One Attachments ====== ====== Versago Uploaded Files to SAP Business One Attachments ======
Line 277: Line 281:
 ===== Database Information ===== ===== Database Information =====
  
-Uploaded files are stored in a table named TWBS_VGO_FormAttachments. This table is automatically created by the Versago process in whatever database is referenced by the form. The name of the table is fixedand cannot be changed.+Uploaded files are stored in a table named TWBS_VGO_FormAttachments. This table is automatically created by the Versago process in whatever database is referenced by the form. The name of the table is fixed and cannot be changed.
  
 There are three columns in the table that are key to retrieving the file data and passing it to SAP Business One. These columns are: FormId, RecordId, FileName, and FileContent. There are three columns in the table that are key to retrieving the file data and passing it to SAP Business One. These columns are: FormId, RecordId, FileName, and FileContent.
  
-**FileName** is the name of the file when it was uploaded. No references to the source folder are captured since they are not relevant.+**FileName** was the name of the file when it was uploaded. No references to the source folder are captured since they are not relevant.
  
-**FileContent** is the actual data from the file, stored as a binary record. The information in this field cannot be used without some process to convert it back to its original format.+**FileContent** is the actual data from the file, stored as a binary record. This field's information cannot be used without some process to convert it back to its original format.
  
 FileName and FileContent are used in the mapping into SAP Business One. FileName and FileContent are used in the mapping into SAP Business One.
  
-**FormId** is the identifying number of the Versago form. You can find this information on the “Form Creation”tab on the from maintenance function is Versago.+**FormId** is the identifying number of the Versago form. You can find this information on the “Form Creation” tab on the form maintenance function is Versago.
  
-**RecordId** is the primary key value (record ID) of the record in Versago that was created when the file was uploaded. There may be multiple records in TWBS_VGO_FormAttachments for each RecordId.+**RecordId** is the primary key value (record ID) of the record in Versago created when the file was uploaded. There may be multiple records in TWBS_VGO_FormAttachments for each RecordId.
  
 ===== Versago Record Information ===== ===== Versago Record Information =====
Line 304: Line 308:
  
 <WRAP center round info> <WRAP center round info>
-This is a very simple example to illustrate the process. In most cases you will need to add additional logic to obtain the correct record set.+This is a straightforward example to illustrate the process. In most casesyou will need to add additional logic to obtain the correct record set.
 </WRAP> </WRAP>
  
  
-{{  :bw:sapimage15.png?576x87  }} +{{ :bw2:bizweaverdi10.png |}}
   - A list of unique file upload records (column “Id”) is obtained. In this example, the Versago form ID (ObjectId) is 11. \\ <code sql>select    - A list of unique file upload records (column “Id”) is obtained. In this example, the Versago form ID (ObjectId) is 11. \\ <code sql>select 
 t0.Id  t0.Id 
Line 321: Line 324:
 where t0.Id = WorkFlow(SQLCommand_getProcessList).Get({FIELD_Id})</code> where t0.Id = WorkFlow(SQLCommand_getProcessList).Get({FIELD_Id})</code>
   - The needed fields are mapped for SAP Business One.   - The needed fields are mapped for SAP Business One.
-      - In this case the SAP Business One object receiving the attachment is a Business Partner.+      - In this casethe SAP Business One object receiving the attachment is a Business Partner.
       - The transaction for attachment will always be an UPDATE.       - The transaction for attachment will always be an UPDATE.
-      - The FileName and FileContent values are both mapped to the “AttachmentEntry” (AtcEntry) value in SAP Business One. \\ {{  :bw:sapimage16.png?564x239  }}+      - The FileName and FileContent values are both mapped to the “AttachmentEntry” (AtcEntry) value in SAP Business One. \\ {{ :bw2:bizweaverdi11.png |}}
   - The mapped information is passed into the SAP Business One update tool for processing.   - The mapped information is passed into the SAP Business One update tool for processing.
  
Line 330: Line 333:
 In this example, a Versago form is used to capture information to create a Purchase Order in SAP Business One. The order is created in SAP Business One, and then the attachments are associated with the new order. In this example, a Versago form is used to capture information to create a Purchase Order in SAP Business One. The order is created in SAP Business One, and then the attachments are associated with the new order.
  
-{{  :bw:sapimage17.png?576x212  }}+{{ :bw2:bizweaverdi13.png |}}
  
   - A list of records created from the Versago form is created, and an SAP Business One purchase document is created for each one.   - A list of records created from the Versago form is created, and an SAP Business One purchase document is created for each one.
Line 344: Line 347:
 where t0.Id = WorkFlow(SQLCommand_getAttachList).Get({FIELD_ID}) </code> where t0.Id = WorkFlow(SQLCommand_getAttachList).Get({FIELD_ID}) </code>
   - The needed fields are mapped for SAP Business One.   - The needed fields are mapped for SAP Business One.
-      - In this case the SAP Business One object receiving the attachment is the purchase order created previously in the process and defined by the “DocEntry” value from step 2.+      - In this casethe SAP Business One object receiving the attachment is the purchase order created previously in the process and defined by the “DocEntry” value from step 2.
       - The transaction for attachment will always be an UPDATE.       - The transaction for attachment will always be an UPDATE.
-      - The FileName and FileContent values are both mapped to the “AttachmentEntry” (AtcEntry) value in SAP Business One. \\ {{  :bw:sapimage18.png?384x202  }}+      - The FileName and FileContent values are both mapped to the “AttachmentEntry” (AtcEntry) value in SAP Business One. \\ {{ :bw2:bizweaverdi12.png |}}
   - The mapped information is passed into the SAP Business One update tool for processing.   - The mapped information is passed into the SAP Business One update tool for processing.
  
Line 360: Line 363:
 ===== Identifying the File to be Attached ===== ===== Identifying the File to be Attached =====
  
-The file to be attached must be identified as a Bizweaver //Variable// in the workflow. This will typically be done using a File Operations-Get step. The results of the “get” are then identified in a subsequent Variable step.+The attached file must be identified as a Bizweaver //Variable// in the workflow. This will typically be done using a File Operations-Get step. The results of the “get” are then identified in a subsequent Variable step. 
 + 
 +  - File Operations – Get step to get file information. \\ {{ :bw2:bizweaverdi14.png |}} \\ In this example we are getting one file (TestFile.txt) from C:\Shared\Infiles. 
 +  - Set the variable to the value from the “get” step. \\ {{ :bw2:bizweaverdi15.png |}} \\ Note that the “FileName” value is used from the “get” step. This value includes the folder path, file name, and file extension. 
 +  - Map the needed information in a Mapper step. \\ {{ :bw2:bizweaverdi16.png |}} \\ In this example we are adding an attachment to a Business Partner. The only values needed are the BP Code (CardCode) and the variable set earlier with the file information. 
 +  - A subsequent SBOUpdate tool step is used to post the information to SAP Business One. \\ Any object in SAP Business One that supports attachments can be updated using the above process. You only need to provide the key value for the object and the file information. The two most common objects for attachments are Business Partners, where the key value is //CardCode//, and Marketing documents (e.g., Orders, Deliveries/Receipts, Invoices). The key value is //DocEntry//
 + 
 +====SAP Update Variables====
  
-  - File Operations – Get step to get file information. \\ {{  :bw:sapimage19.png?384x192  }} \\ In this example we are getting one file (TestFile.txt) from C:\Shared\Infiles. +^Name ^Description^ 
-  - Set variable to the value from the “get” step. \\ {{  :bw:sapimage20.png?384x338  }} \\ Note that the “FileName” value is used from the “get” step. This value includes the folder pathfile nameand file extension+|Message|This indicates the message returned from the DI API/DI Server interaction| 
-  - Map the needed information in Mapper step. \\ {{  :bw:sapimage21.png?384x197  }} \\ In this example we are adding an attachment to a Business PartnerThe only values needed are the BP Code (CardCode) and the variable set earlier with the file information. +|RetKey|This indicates the DocNum that is returned from the DI API/DI Server when a record is created| 
-  - A subsequent SBOUpdate tool step is used to post the information to SAP Business One. \\ Any object in SAP Business One that supports attachments can be updated using the above process. You only need to provide the key value for the object and the file information. The two most common objects for attachments are Business Partners where the key value is //CardCode//, and Marketing documents (e.g. Orders, Deliveries/Receipts, Invoices) where the key value is //DocEntry//.+|RetType|This indicates the Document Type returned from the DI API/DI Server| 
 +|VALUE|This indicates if addingupdatingdeleting etcThe record in SAP via the DI API/DI Server was successful with a Y = Yes and N = No| 
 +|Command|Command is type of operation, Add/Update/Delete/Getbykey etc| 
 +|FieldName|The indicates the Primary field name used for that object | 
 +|Input|This is for legacy versions of Bizweaver and no longer displays any data| 
 +|Output|This is for legacy versions of Bizweaver and no longer displays any data| 
 +|ProcessedCount|If performing bulk operations ex multiple records, then number of processed records will be this. If we are looping through records| 
 +|ProcessInput|Currently processing record.
 +|ServiceName|This indicates the service name used in the mapper tool| 
 +|ServiceType|In the case of DI Server/ DIAPI, specify whether the object currently in process is a System object or User defined object| 
 +|ThrowErrorOnFail|True or False, When bulk operations are processing if one record fails this will stop all further processing if continue on error is selected it will process all other records that are left to process| 
 +|TotalCount Total|count of all records if there is a bulk operation| 
 +|StepMessage|During a failure the reason for failure will be populated here| 
 +|StepStatus|True or False|
bw2/sap_business_one_integration_using_di.1612996928.txt.gz · Last modified: 2021/02/10 17:42 by akoehler