integration framework for sap business one

39
Integration Framework for SAP Business One Flat File Inbound Adapter PUBLIC Global Roll-Out December 2018, Krisztián Pápai Note: The example templates in this document are not officially supported by SAP.

Upload: others

Post on 09-Dec-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Integration Framework for SAP Business One

Flat File Inbound Adapter

PUBLIC

Global Roll-Out

December 2018, Krisztián Pápai

Note: The example templates in this document are not officially supported by SAP.

2

TABLE OF CONTENTS1. PREREQUISITES ........................................................................................................................ 41.1. Create a Scenario Package ........................................................................................................ 42. PREPARE FILE SYSTEM ENTRY ............................................................................................... 43. INBOUND USING THE ROOT TAG METHOD ............................................................................. 53.1. Create a Scenario Step ............................................................................................................... 53.2. Define the Inbound Channel....................................................................................................... 53.3. Generate the Default Processing Structure ............................................................................... 63.4. Define the Outbound Channel .................................................................................................... 63.5. Work with SAP Business One Data ........................................................................................... 73.6. Set Up and Activate the Scenario Package ............................................................................... 83.7. Scenario Execution .................................................................................................................... 94. INBOUND USING THE XPATH METHOD ...................................................................................104.1. Create a Scenario Step ..............................................................................................................104.2. Define the Inbound Channel......................................................................................................104.3. Generate the Default Processing Structure ..............................................................................114.4. Define the Outbound Channel ...................................................................................................114.5. Work with SAP Business One Data ..........................................................................................114.6. Set Up and Activate the Scenario Package ..............................................................................134.7. Scenario Execution ...................................................................................................................145. INBOUND USING THE B1 LOGIC METHOD ..............................................................................155.1. Create a Scenario Step ..............................................................................................................155.2. Define the Inbound Channel......................................................................................................155.3. Generate the Default Processing Structure ..............................................................................165.4. Define the Outbound Channel ...................................................................................................165.5. Work with SAP Business One Data ..........................................................................................165.6. Set Up and Activate the Scenario Package ..............................................................................185.7. Scenario Execution ...................................................................................................................196. INBOUND USING THE FIRST LINE METHOD ............................................................................206.1. Create a Scenario Step ..............................................................................................................206.2. Define the Inbound Channel......................................................................................................206.3. Generate the Default Processing Structure ..............................................................................216.4. Define the Outbound Channel ...................................................................................................216.5. Work with SAP Business One Data ..........................................................................................216.6. Setup and Activate the Scenario Package................................................................................236.7. Scenario Execution ...................................................................................................................247. INBOUND USING THE FILE NAME METHOD ............................................................................257.1. Create a Scenario Step ..............................................................................................................257.2. Define the Inbound Channel......................................................................................................25

3

7.3. Generate the Default Processing Structure ..............................................................................267.4. Define the Outbound Channel ...................................................................................................267.5. Work with SAP Business One Data ..........................................................................................267.6. Set Up and Activate the Scenario Package ..............................................................................287.7. Scenario Execution ...................................................................................................................298. INBOUND USING THE FIXED VALUE METHOD ........................................................................308.1. Create a Scenario Step ..............................................................................................................308.2. Define the Inbound Channel......................................................................................................308.3. Define the Inbound Formatting .................................................................................................318.4. Generate the Default Processing Structure ..............................................................................328.5. Define the Outbound Channel ...................................................................................................328.6. Work with SAP Business One Data ..........................................................................................328.7. Set Up and Activate the Scenario Package ..............................................................................348.8. Scenario Execution ...................................................................................................................359. APPENDIX ..................................................................................................................................369.1. Import DSV File to XML .............................................................................................................369.2. Import DSV file to XML with Formatting ...................................................................................37

4

The document describes how you can use the “Flat File” inbound adapter type in the integration frameworkfor SAP Business One.

1. PREREQUISITES

1.1. Create a Scenario PackageTo create a scenario package in the integration framework for SAP Business One, please refer to theopenSAP course In Action - Integration Framework for SAP Business One.

In the Week 2 and Unit 1 chapter, you learn how to create a scenario package.

2. PREPARE FILE SYSTEM ENTRY

Navigate to integration framework for SAP Business One → SLD

· Right click B1i Server → Create System

· Define F.AnySystem value for the System Type property· Define MyFileSystem value for System Name property· Press the Create button

· In the filePattern (FILI) property, enter the directory with the complete path, for example c:\temp\in\*(The setting considers all files located in the specific directory.)

· Select the Encoding value, for example, the value 24 (UTF-8)· For the Delimiter property, define the value , (comma)· For the WrapChar property, define the value ‘ (apostrophe)· For the PayloadType property, define the value 1 (automatic detection)

5

3. INBOUND USING THE ROOT TAG METHOD

This chapter shows you how to use the Root Tag identification method to identify the incoming flat file.

The function creates a new Business Partner Master Data entry.

Please refer to the sample sap.file.rootTag scenario step, available in the sap.in.File scenario package.

3.1. Create a Scenario Step

Create a new scenario step in integration framework for SAP Business One → Scenarios → Step Design.

3.2. Define the Inbound Channel

Navigate to integration framework for SAP Business One → Scenarios → Step Design → Inbound →Channel and specify the following properties:

Name ValueInbound Type Flat FileProcess Mode AsynchronousProcess Trigger File existIdentification Method Root TagIdentification Parameter n.a.Identifier BusinessPartners

6

3.3. Generate the Default Processing Structure

By opening the processing part in the integration framework for SAP Business One → Scenarios → StepDesign → Processing the default structure is automatically generated. It means, the integration frameworkadds the atom0.xsl (final atom).

3.4. Define the Outbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Outbound andspecify the following properties:

Name ValueOutbound Channel VoidOutbound Format Void

7

3.5. Work with SAP Business One Data

3.5.1. Add Call B1 Object Atom

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → selectthe Scenario Step (sap.file.rootTag) → Processing

· Press the [Add] button on the Start atom to insert a new processing atom.· In the New Flow Atom field, select the Call B1 Object value.· Click Add.· Finally, press OK, to create the predecessor XSL transformation atom.

3.5.2. Customize the XSL Transformation

· Click the XSL transformation atom (xform – atom2). The integration framework opens theEmbedded XML Editor to edit the XSL file.

· In the XSL file, change the transform template accordingly:

<xsl:template name="transform"><xsl:copy-of select="$msg/*"/>

</xsl:template>

3.5.3. Specify the Call B1 Object Atom

· For the SysId property, select the value of the company database.· For Method property, set the value #Synchronous Insert.· For the Object Identifier property, set the value #2.· For Key Name property, set the value #CardCode.

8

3.6. Set Up and Activate the Scenario Package

3.6.1. Activate the scenario step(s) for the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Steps and activate your currently created Scenario Step (sap.file.rootTag)

3.6.2. Assign the Sender system to the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Sender → Define Sender List and select one a HTTP system type (for example, HTTP-B1System)

9

3.6.3. Activate the Scenario Package

Navigate to integration framework for SAP Business One → Setup → select your Scenario Package→ Activate

3.7. Scenario Execution

3.7.1. Create the inbound file, for example, fileBP01.xml

3.7.2. Copy the file into the folder defined for filePattern (FILI) property (see chapter 2)

<BusinessPartners><Row>

<CardCode>fileBP01</CardCode><CardName>file BP 01</CardName>

</Row></BusinessPartners>

10

4. INBOUND USING THE XPATH METHOD

This chapter shows you how to use the xPath identification method to identify the incoming flat file.

This function creates a new Item Master Data entry.

Please refer to the sample sap.file.xPath scenario step, available in the sap.in.File scenario package.

4.1. Create a Scenario Step

Create a new scenario step in the integration framework for SAP Business One → Scenarios → StepDesign.

4.2. Define the Inbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Inbound →Channel and specify the following properties:

Name ValueInbound Type Flat FileProcess Mode AsynchronousProcess Trigger File existIdentification Method xPathIdentification Parameter $msg/B1Object/ObjectCodeIdentifier 4

11

4.3. Generate the Default Processing Structure

By opening the processing part in the integration framework for SAP Business One → Scenarios → StepDesign → Processing the default structure is generated automatically. It means, the integration frameworkadds the atom0.xsl (final atom).

4.4. Define the Outbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Outbound andspecify the following properties:

Name ValueOutbound Channel VoidOutbound Format Void

4.5. Work with SAP Business One Data

4.5.1. Add Call B1 Object Atom

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → selectthe Scenario Step (sap.file.xPath) → Processing

· Press the [Add] button on the Start atom to insert a new processing atom.· In the New Flow Atom field, select the Call B1 Object value.· Click Add.· Finally, press OK, to create the predecessor XSL transformation atom.

12

4.5.2. Customize the XSL Transformation

· Click the XSL transformation atom (xform – atom2). The integration framework opens theEmbedded XML Editor to edit the XSL file.

· In the XSL file, change the transform template accordingly:

<xsl:template name="transform"><Items>

<xsl:copy-of select="$msg/B1Object/Items/*"></xsl:copy-of></Items>

</xsl:template>

4.5.3. Specify the Call B1 Object Atom

· For the SysId property, select the value of the company database.· For the Method property, set the value #Synchronous Insert.· For the Object Identifier property, set the value #4.· For the Key Name property, set the value #ItemCode.

13

4.6. Set Up and Activate the Scenario Package

4.6.1. Deactivate all scenario step from in the Scenario Package

Navigate to integration framework for SAP Business One → Setup → select your Scenario Package→ Steps → [No Activate] → [Save]

4.6.2. Activate the scenario step(s) for the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Steps and activate your currently created Scenario Step (sap.file.rootTag)

4.6.3. Assign the Sender system to the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Sender → Define Sender List and select one a HTTP system type (for example, HTTP-B1System)

14

4.6.4. Activate the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Activate

4.7. Scenario Execution

4.7.1. Create the inbound file, for example, fileITM01.xml

4.7.2. Copy the file into the folder defined for filePattern (FILI) property (chapter 2)

<B1Object><ObjectCode>4</ObjectCode><Items>

<Row><ItemCode>fileITM01</ItemCode><ItemName>file ITM 01</ItemName>

</Row></Items>

</B1Object>

15

5. INBOUND USING THE B1 LOGIC METHOD

This chapter shows you how to use the B1 Logic identification method to identify the incoming flat file.

This function creates a new Sales Order document.

Please refer to the sample sap.file.B1Logic scenario step, available in the sap.in.File scenario package.

5.1. Create a Scenario Step

Create a new scenario step in the integration iramework for SAP Business One → Scenarios → StepDesign.

5.2. Define the Inbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Inbound →Channel and specify the following properties:

Name ValueInbound Type Flat FileProcess Mode AsynchronousProcess Trigger File existIdentification Method B1 LogicIdentification Parameter n.aIdentifier 17

16

5.3. Generate the Default Processing StructureBy opening the processing part in the integration framework for SAP Business One → Scenarios → StepDesign → Processing the default structure is generated automatically. It means, the integration frameworkadds the atom0.xsl (final atom).

5.4. Define the Outbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Outbound andspecify the following properties:

Name ValueOutbound Channel VoidOutbound Format Void

5.5. Work with SAP Business One Data

5.5.1. Add Call B1 Object Atom

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → selectthe Scenario Step (sap.file.B1Logic) → Processing

· Press the [Add] button on the Start atom to insert a new processing atom.· In the New Flow Atom field, select the Call B1 Object value.· Click Add.· Finally, press OK, to create the predecessor XSL transformation atom.

17

5.5.2. Customize the XSL Transformation

· Click the XSL transformation atom (xform – atom2). The integration framework opens theEmbedded XML Editor to edit the XSL file.

· In the XSL file, change the transform template accordingly:

<xsl:template name="transform"><Items>

<xsl:copy-of select="$msg/*"></xsl:copy-of></Items>

</xsl:template>

5.5.3. Specify the Call B1 Object Atom

· For the SysId property, select the value for the company database.· For the Method property, set the value #Synchronous Insert.· For the Object Identifier property, set the value #17.· For the Key Name property, set the value #DocEntry.

18

5.6. Set Up and Activate the Scenario Package

5.6.1. Deactivate all scenario step from in the Scenario Package

Navigate to integration framework for SAP Business One → Setup → select your Scenario Package→ Steps → [No Activate] → [Save]

5.6.2. Activate the scenario step(s) for the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Steps and activate your currently created Scenario Step (sap.file.B1Logic)

5.6.3. Assign the Sender system to the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Sender → Define Sender List and select one a HTTP system type (for example, HTTP-B1System)

5.6.4. Activate the Scenario Package

19

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Activate

5.7. Scenario Execution

5.7.1. Create the inbound file, for example, salesOrder.xml

5.7.2. Copy the file into the folder defined for filePattern (FILI) property (see chapter 2)

<BOM><BO>

<AdmInfo><Object>17</Object><Version>2</Version>

</AdmInfo><Documents>

<row><CardCode>C20000</CardCode>

<DocDueDate>20181120</DocDueDate></row>

</Documents><Document_Lines>

<row><ItemCode>A00001</ItemCode><Quantity>1.000000</Quantity>

<UnitPrice>100.000000</UnitPrice></row>

</Document_Lines></BO>

</BOM>

20

6. INBOUND USING THE FIRST LINE METHOD

This chapter shows you how to use the First Line identification method to identify the incoming flat file.

This function creates a new Sales Delivery document.

Please refer to the sample sap.file.firstLine scenario step, available in the sap.in.File scenario package.

6.1. Create a Scenario Step

Create a new scenario step in the integration framework for SAP Business One → Scenarios → StepDesign.

6.2. Define the Inbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Inbound →Channel and specify the following properties:

Name ValueInbound Type Flat FileProcess Mode AsynchronousProcess Trigger File existIdentification Method First LineIdentifier SalesDelivery

21

6.3. Generate the Default Processing StructureBy opening the Processing part in integration framework for SAP Business One → Scenarios → Step Design→ Processing the default structure is generated automatically. It means, the integration framework adds theatom0.xsl (final atom).

6.4. Define the Outbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Outbound andspecify the following properties:

Name ValueOutbound Channel VoidOutbound Format Void

6.5. Work with SAP Business One Data

6.5.1. Add Call B1 Object Atom

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → selectthe Scenario Step (sap.file.firstLine) → Processing

· Press the [Add] button on the Start atom to insert a new processing atom.· In the New Flow Atom field, select the Call B1 Object value.· Click Add.· Finally, press OK, to create the predecessor XSL transformation atom.

22

6.5.2. Customize the XSL Transformation

· Click the XSL transformation atom (xform – atom2). The integration framework opens theEmbedded XML Editor to edit the XSL file.

· In the XSL file, change the transform template accordingly:<xsl:template name="transform">

<Documents><row>

<DocDueDate><xsl:value-of select="$msg/row[2]/col[2]"></xsl:value-of></DocDueDate><CardCode><xsl:value-of select="$msg/row[2]/col[3]"></xsl:value-of></CardCode>

</row></Documents><Document_Lines>

<xsl:for-each select="$msg/row"><xsl:if test="position()!=1">

<row><ItemCode><xsl:value-of select="./col[4]"></xsl:value-of></ItemCode><UnitPrice><xsl:value-of select="./col[5]"></xsl:value-of></UnitPrice><Quantity><xsl:value-of select="./col[6]"></xsl:value-of></Quantity>

</row></xsl:if>

</xsl:for-each></Document_Lines>

</xsl:template>

6.5.3. Specify the Call B1 Object Atom

· For the SysId property, select the value for the company database.· For Method property, set the value #Synchronous Insert.· For the Object Identifier property, set the value #15.· For the Key Name property, set the value #DocEntry.

23

6.6. Setup and Activate the Scenario Package

6.6.1. Deactivate all scenario step from in the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Steps → [No Activate] → [Save]

6.6.2. Activate the scenario step sap.file.firstLine for the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Steps and activate your currently created Scenario Step (sap.file.firstLine)

6.6.3. Assign the Sender system to the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Sender → Define Sender List and select one a HTTP system type (for example, HTTP-B1System)

24

6.6.4. Activate the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Activate

6.7. Scenario Execution

6.7.1. Create the inbound file, for example, salesDelivery.csv

6.7.2. Copy the file into the folder defined for filePattern (FILI) property (see chapter 2)

SalesDelivery,DocDueDate,CardCode,ItemCode,UnitPrice,Quantity001,20181121,C20000,A00001,100,1001,20181121,C20000,A00002,200,2

25

7. INBOUND USING THE FILE NAME METHOD

This chapter shows you how to use the File Name identification method to identify the incoming flat file.

This function creates a new Sales Invoice document.

Please refer to the sample sap.file.fileName scenario step, available in the sap.in.File scenario package.

7.1. Create a Scenario Step

Create a new scenario step in the integration framework for SAP Business One → Scenarios → StepDesign.

7.2. Define the Inbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Inbound →Channel and specify the following properties:

Name ValueInbound Type Flat FileProcess Mode AsynchronousProcess Trigger File existIdentification Method First NameIdentification Parameter 1,12Identifier SalesInvoice

26

The Identification Parameter compares the file name from this position 1 on till length 12. Basically, the first12 characters in the file name must be equal to “SalesInvoice”.

7.3. Generate the Default Processing Structure

By opening the processing part in the integration framework for SAP Business One → Scenarios → StepDesign → Processing the default structure will be generated automatically. It means, the integrationframework adds the atom0.xsl (final atom).

7.4. Define the Outbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Outbound andspecify the following properties:

Name ValueOutbound Channel VoidOutbound Format Void

7.5. Work with SAP Business One Data

7.5.1. Add Call B1 Object Atom

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → selectthe Scenario Step (sap.file.firstLine) → Processing

· Press the [Add] button on the Start atom to insert a new processing atom.· In the New Flow Atom field, select the Call B1 Object value.· Click Add.· Finally, press OK, to create the predecessor XSL transformation atom.

27

7.5.2. Customize the XSL Transformation

· Click the XSL transformation atom (xform – atom2). The integration framework opens theEmbedded XML Editor to edit the XSL file.

· In the XSL file, change the transform template accordingly:

<xsl:template name="transform"><xsl:copy-of select="$msg/Invoice/*"></xsl:copy-of>

</xsl:template>

7.5.3. Specify the Call B1 Object Atom

· For SysId property, select the value of the company database.· For the Method property, set the value #Synchronous Insert.· For the Object Identifier property, set the value #13.· For Key Name property, set the value #DocEntry.

28

7.6. Set Up and Activate the Scenario Package

7.6.1. Deactivate all scenario step from in the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Steps → [No Activate] → [Save]

7.6.2. Activate the scenario step(s) for the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Steps and activate your currently created Scenario Step (sap.file.fileName)

7.6.3. Assign the Sender system to the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Sender → Define Sender List and select one a HTTP system type (for example, HTTP-B1System)

29

7.6.4. Activate the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Activate

7.7. Scenario Execution

7.7.1. Create the inbound file, for example, SalesInvoice_001.xml

7.7.2. Copy the file into the folder defined for filePattern (FILI) property (see chapter 2)

<Invoice><Documents>

<row><CardCode>C20000</CardCode><DocDueDate>20181120</DocDueDate>

</row></Documents><Document_Lines>

<row><ItemCode>A00001</ItemCode><Quantity>1</Quantity><UnitPrice>100</UnitPrice>

</row></Document_Lines>

</Invoice>

30

8. INBOUND USING THE FIXED VALUE METHOD

This chapter shows you how to use the Fixed Value identification method to identify the incoming flat file.

This function creates a new Credit Memo document.

Please refer to the sample sap.file.fixedValue scenario step, available in the sap.in.File scenario package.

8.1. Create a Scenario Step

Create a new scenario step in integration framework for SAP Business One → Scenarios → Step Design.

8.2. Define the Inbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Inbound →Channel and specify the following properties:

Name ValueInbound Type Flat FileProcess Mode AsynchronousProcess Trigger File existIdentification Method First NameIdentification Parameter AnyValue_NotConsideredIdentifier AnyValue_NotConsidered

Please note, the scenario step subscribes to all files in the directory. Enter any string in the Identifierfield. The integration framework automatically sets the same value in the Identification Parameterfield. The value is not relevant, but you cannot leave the field empty.

31

8.3. Define the Inbound Formatting

8.3.1. Create the Format Control Document

Navigate to the integration framework for SAP Business One → Scenarios → Step Design →Inbound → Formatting.

· Press the [Create Ctrl. Doc] button to create a control document.· Choose the Entry Convert Text File to XML· Press [Select] button· Enter the file name, like MyFormatDoc· Press [Select] button· Press the [Save] button

8.3.2. Customize the Format Control Document

Navigate to the integration framework for SAP Business One → Scenarios → Step Design →Inbound → Formatting → press button [Create Optional Control Document Containing DetailedFormatting Definitions]

<?xml version="1.0" encoding="UTF-8"?><TXT><field id="ItemCode" from="1" len="6" default="NULL" justify="" fillchar=" "></field><field id="UnitPrice" from="8" len="3" default="NULL" justify="" fillchar=" "></field><field id="Quantity" from="12" len="1" default="NULL" justify="" fillchar=" "></field>

</TXT>

32

8.4. Generate the Default Processing Structure

By opening the processing part in the integration framework for SAP Business One → Scenarios → StepDesign → Processing the default structure is generated automatically. The integration framework adds theatom0.xsl (final atom).

8.5. Define the Outbound Channel

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → Outbound andspecify the following properties:

Name ValueOutbound Channel VoidOutbound Format Void

8.6. Work with SAP Business One Data

8.6.1. Add Call B1 Object Atom

Navigate to the integration framework for SAP Business One → Scenarios → Step Design → selectthe Scenario Step (sap.file.fixedValue) → Processing

· Press the [Add] button on the Start atom to insert a new processing atom.· In the New Flow Atom field, select the Call B1 Object value.· Click Add.· Finally, press OK, to create the predecessor XSL transformation atom.

33

8.6.2. Customize the XSL Transformation

· Click the XSL transformation atom (xform – atom2). The integration framework opens theEmbedded XML Editor to edit the XSL file.

· In the XSL file, change the transform template accordingly:

<xsl:template name="transform"><Documents>

<row><CardCode>C20000</CardCode><DocDueDate>20181121</DocDueDate>

</row></Documents><Document_Lines>

<xsl:copy-of select="$msg/*"/></Document_Lines>

</xsl:template>

8.6.3. Specify the Call B1 Object Atom

· For the SysId property, select the value.· For the Method property, set the value #Synchronous Insert.· For the Object Identifier property, set the value #13.

34

· For the Key Name property, set the value #DocEntry.

8.7. Set Up and Activate the Scenario Package

8.7.1. Deactivate all scenario step from in the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Steps → [No Activate] → [Save]

8.7.2. Activate the scenario step(s) for the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Steps and activate your currently created Scenario Step (sap.file.fileName)

8.7.3. Assign the Sender system to the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Sender → Define Sender List and select one a HTTP system type (for example, HTTP-B1System)

35

8.7.4. Activate the Scenario Package

Navigate to the integration framework for SAP Business One → Setup → select your ScenarioPackage → Activate

8.8. Scenario Execution

8.8.1. Create the inbound file, for example, creditMemo.txt

8.8.2. Copy the file into the folder defined for filePattern (FILI) property (chapter 2)

A00001 100 1A00002 200 2A00003 300 3

36

9. APPENDIX

9.1. Import DSV File to XML

This unit demonstrates how the Comma-Separated Value file (CSV) can be imported into the scenario step.

Please refer to the sample sap.file.dsv2xml scenario step, available in the sap.in.File scenario package.

9.1.1. Design the scenario package

Navigate to the integration framework for SAP Business One → Scenarios → Step Design.

· Create a new Scenario Step (sap.file.dsv2xml)· Defined the following properties to Inbound Channel section:

Name ValueInbound Type Flat FileProcess Mode AsynchronousProcess Trigger File existIdentification Method Fixed ValueIdentification Parameter dsv2xmlIdentifier dsv2xml

· Set the Outbound Channel to Void· Open the Processing part to generate the default Processing structure

9.1.2. Activate and Run

· Deactivate all scenario steps within your Scenario Package and keep activated only the currentone (sap.file.dsv2xml).

· Create the inbound file, for example, items.csv

· Copy the file into the folder defined for filePattern (FILI) property (chapter 2)

9.1.3. Check the results

The scenario creates the following inbound xml document:

<Payload Role="S" intype="csv"><row xmlns="">

<col>A00001</col><col>my item 01</col><col>my description</col><col>11</col>

</row><row xmlns="">

A00001,my item 01,my description,11A00002,my item 02,my description,12A00003,my item 03,my description,13A00004,my item 04,my description,14

37

<col>A00002</col><col>my item 02</col><col>my description</col><col>12</col>

</row><row xmlns="">

<col>A00003</col><col>my item 03</col><col>my description</col><col>13</col>

</row><row xmlns="">

<col>A00004</col><col>my item 04</col><col>my description</col><col>14</col>

</row></Payload>

9.2. Import DSV file to XML with Formatting

This unit demonstrates how the Comma-Separated Value file (CSV) can be imported into the scenario step.We include a formatting document to change the field names into a more readable format.

Please refer to the sample sap.file.dsv2xmlFormat scenario step, available in the sap.in.File scenariopackage.

9.2.1. Design the Scenario Package

Navigate to the integration framework for SAP Business One → Scenarios → Step Design.

· Create a new Scenario Step (sap.file.dsv2xmlFormat)· Defined the following properties to Inbound Channel section:

Name ValueInbound Type Flat FileProcess Mode AsynchronousProcess Trigger File existIdentification Method Fixed ValueIdentification Parameter dsv2xmlFormattedIdentifier dsv2xmlFormatted

· Create a Format Control Document: Inbound Formatting → [Create Ctrl. Doc] button → ConvertDSV to XML → MyFormatDoc → [Save]

· Customize the Format Control Document: Inbound Formatting → press button [CreateOptional Control Document Containing Detailed Formatting Definitions]

<?xml version="1.0" encoding="UTF-8"?><DSV>

<field>ItemCode</field><field>ItemName</field><field>Description</field><field>Price</field>

38

</DSV>

· Set the Outbound Channel to Void· Open the Processing part in order to generate the default Processing structure

9.2.2. Activate and Run

· Deactivate all scenario steps in your scenario package and keep activated only the current one(sap.file.dsv2xmlFormat).

· Create the inbound file, for example, items.csv

· Copy the file into the folder defined for filePattern (FILI) property (chapter 2)

9.2.3. Check the Results

The scenario creates the following inbound xml document:

<Payload Role="S" intype="csv_ruledoc"><row xmlns="">

<ItemCode>A00001</ItemCode><ItemName>my item 01</ItemName><Description>my description</Description><Price>11</Price>

</row><row xmlns="">

<ItemCode>A00002</ItemCode><ItemName>my item 02</ItemName><Description>my description</Description><Price>12</Price>

</row><row xmlns="">

<ItemCode>A00003</ItemCode><ItemName>my item 03</ItemName><Description>my description</Description><Price>13</Price>

</row><row xmlns="">

<ItemCode>A00004</ItemCode><ItemName>my item 04</ItemName><Description>my description</Description><Price>14</Price>

</row></Payload>

A00001,my item 01,my description,11A00002,my item 02,my description,12A00003,my item 03,my description,13A00004,my item 04,my description,14

www.sap.com/contactsap

© 2018 SAP SE or an SAP affiliate company. All rights reserved.No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.

The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liablefor errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statementsaccompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionalitymentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality areall subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligationto deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers arecautioned not to place undue reliance on these forward-looking statements, and they should not be relied upon in making purchasing decisions.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and othercountries. All other product and service names mentioned are the trademarks of their respective companies. See http://www.sap.com/corporate-en/legal/copyright/index.epx for additional trademarkinformation and notices.