integration framework for sap business one · 3 in the process flow, use the call b1 object atom to...

17
Integration Framework for SAP Business One Calling B1 (SAP Business One) Object PUBLIC Global Roll-Out January 2019, Lenice Zhang Note: The example templates in this document are not officially supported by SAP.

Upload: ngoliem

Post on 16-Apr-2019

246 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

Integration Framework for SAP Business One

Calling B1 (SAP Business One) Object

PUBLIC

Global Roll-Out

January 2019, Lenice Zhang

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

Page 2: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

2

TABLE OF CONTENTS

1. PREREQUISITES .............................................................................................................................. 3

1.1. Create a Scenario Package ............................................................................................................. 3

1.2. Create a Scenario Step .................................................................................................................... 3

2. CONFIGURE THE COMPANY SLD CONNECTION ........................................................................ 3

3. INSERT – ADD AN ITEM MASTER DATA RECORD ...................................................................... 3

3.1. Add an Atom to Scenario Step Processing .................................................................................. 3

3.2. Configure the Functional Processing Atom ................................................................................. 4

3.3. Customize the XSL Transformation ............................................................................................... 4

4. RETRIEVE – GET AN ITEM MASTER DATA RECORD ................................................................. 5

4.1. Add an Atom to Scenario Step Processing .................................................................................. 5

4.2. Configure the Functional Processing Atom ................................................................................. 5

5. UPDATE – CHANGE AN ITEM MASTER DATA RECORD ............................................................ 6

5.1. Add an Atom to Scenario Step Processing .................................................................................. 6

5.2. Configure Functional Processing Atom ........................................................................................ 7

5.3. Customize the XSL Transformation ............................................................................................... 8

6. DELETE – REMOVE AN ITEM MASTER DATA ENTRY ................................................................ 9

6.1. Add an Atom to Scenario Step Processing .................................................................................. 9

6.2. Configure the Functional Processing Atom ................................................................................. 9

7. CLOSE A SALES ORDER .............................................................................................................. 10

7.1. Add an Atom to Scenario Step Processing ................................................................................ 10

7.2. Configure the Functional Processing Atom ............................................................................... 11

8. CANCEL A SALES ORDER ........................................................................................................... 11

8.1. Add an Atom to Scenario Step Processing ................................................................................ 11

8.2. Configure the Functional Processing Atom ............................................................................... 12

9. PROCESS AN SQL STATEMENT ................................................................................................. 13

9.1. Add an Atom to Scenario Step Processing ................................................................................ 13

9.2. Configure the Functional Processing Atom ............................................................................... 13

10. UPDATE ITEM MASTER DATA WITH DELETING SOME LINE ITEMS....................................... 14

10.1. Configure the Functional Processing Atom ............................................................................... 14

10.2. Add an Atom to Scenario Step Processing ................................................................................ 14

10.3. Configure the Functional Processing Atom ............................................................................... 15

10.4. Customize the XSL Transformation ............................................................................................. 16

Page 3: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

3

In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP

Business One DI API.

1. PREREQUISITES

1.1. Create a Scenario Package

To create a scenario package in the integration framework for SAP Business One, please refer to the openSAP course In Action - Integration Framework for SAP Business One.

1.2. Create a Scenario Step

To create a scenario step in the integration framework for SAP Business One, please refer to the openSAP course In Action - Integration Framework for SAP Business One.

2. CONFIGURE THE COMPANY SLD CONNECTION

The integration framework for SAP Business One uses company SLD entries to define the connection information used to send and receive data from SAP Business One company databases. To configure the company SLD entry and establish the connection from the integration framework to SAP Business One, please refer to the document Company SLD Configuration.

3. INSERT – ADD AN ITEM MASTER DATA RECORD

The chapter guides you through the procedure to insert item master data into SAP Business One using the SAP Business One DI API.

Please refer to the sample sap.B1.Add scenario step available in the sap.B1Object scenario package.

3.1. Add an Atom to Scenario Step Processing

To add the call B1 object atom to the process flow:

• (1) Press the [Add] button on the Start atom to insert a new functional processing atom.

• (2) In the New Flow Atom field, select the Call B1 Object value.

• (3) Click Add.

• (4) Finally, press OK to generate the predecessor XSL transformation atom.

Page 4: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

4

3.2. Configure the Functional Processing Atom

To configure the processing atom:

• (1) Press the [Change Configuration] button.

• (2) In the SysId field, select the SAP Business One system entry.

• (3) In the Method field, select the Synchronous Insert value.

There is another method named Synchronous Insert with fallback to Update. Use this method, if you do not know whether the record already exists in the SAP Business One system. The function first tries to insert the record. If it fails, the function tries to update an already existing record.

• (4) In the Object Identifier field, select 4 - Items.

• (5) The Key Name property is filled automatically based on the Object Identifier.

• (6) Finally, press the [Save] button.

3.3. Customize the XSL Transformation

• Click the XSL Transformation Atom (xform). The integration framework opens the Embedded XML Editor to edit the XSL file.

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

<xsl:template name="transform">

<BOM>

<BO>

<AdmInfo>

<Object>4</Object>

<Version>2</Version>

</AdmInfo>

<Items>

<row>

<ItemCode>Item02</ItemCode>

<ItemName>Item Master Data 02</ItemName>

Page 5: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

5

</row>

</Items>

</BO>

</BOM>

</xsl:template>

4. RETRIEVE – GET AN ITEM MASTER DATA RECORD

The chapter guides you through the procedure to get item master data from SAP Business One using the SAP Business One DI API.

Please refer to the sample sap.B1.Retrieve scenario step available in the sap.B1Object scenario package.

4.1. Add an Atom to Scenario Step Processing

To add the call B1 object atom to the process flow:

• (1) Press the [Add] button on the Start atom to insert a new functional processing atom.

• (2) In the New Flow Atom field, select the Call B1 Object value.

• (3) Click Add.

• (4) Finally, press Cancel, because we do not need the predecessor XSL transformation atom.

4.2. Configure the Functional Processing Atom

To configure the processing atom:

• (1) Press the [Change Configuration] button.

• (2) In the SysId field, select the SAP Business One system entry.

• (3) In the Method field, select the Synchronous Retrieval value.

• (4) In the Retrieval Mode field, select Read/Write with Field Names (ValidNodesOnly), which means Exports to XML only valid fields that support XML import (read/write fields only) from the database.

• (5) In the Object Identifier field, select 4 - Items.

• (6) The Key Name property is filled automatically based on the Object Identifier.

• (7) In the Key Value field, enter an existing ItemCode, for example, #Item01.

Page 6: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

6

• (8) Finally, press the [Save] button.

5. UPDATE – CHANGE AN ITEM MASTER DATA RECORD

The chapter guides you through the procedure to update an Item master data in SAP Business One using the SAP Business One DI API.

Please refer to the sample sap.B1.Update scenario step available in the sap.B1Object scenario package.

Synchronous Update calls wait for the result. Asynchronous Update calls trigger the call process without waiting for the result. The default is usually a synchronous Update call, because the result is important for further processing.

5.1. Add an Atom to Scenario Step Processing

To add the call B1 object atom to the process flow:

• (1) Press the [Add] button on the Start atom to insert a new functional processing atom.

• (2) In the New Flow Atom field, select the Call B1 Object value.

• (3) Click Add.

• (4) Finally, press OK to generate the predecessor XSL transformation atom.

Page 7: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

7

5.2. Configure Functional Processing Atom

To configure the processing atom:

• (1) Press the [Change Configuration] button.

• (2) In the SysId field, select the SAP Business One system entry.

• (3) In the Method field, use the Synchronous Update value.

• (4) In the Object Identifier field, select 4 - Items.

• (5) The Key Name property is filled automatically based on the Object Identifier.

• In the Key Value field, enter an existing business partner ItemCode, for example, #Item02.

• (6) Finally, press the [Save] button.

Page 8: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

8

5.3. Customize the XSL Transformation

• Click the XSL transformation atom (xform). The integration framework opens the Embedded XML Editor to edit the XSL file.

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

<xsl:template name="transform"> <BOM> <BO> <AdmInfo> <Object>4</Object> <Version>2</Version> </AdmInfo> <QueryParams> <ItemCode>Item01</ItemCode> </QueryParams> <Items> <row> <ItemCode>Item04</ItemCode> <ItemName>My Item Master Data 04</ItemName> </row> </Items> </BO> </BOM> </xsl:template>

Page 9: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

9

6. DELETE – REMOVE AN ITEM MASTER DATA ENTRY

The chapter guides you through the procedure to update an Item master data in SAP Business One using the SAP Business One DI API.

Please refer to the sample sap.B1.Delete scenario step available in the sap.B1Object scenario package.

Synchronous Delete calls wait for the result. Asynchronous Delete calls trigger the call process without waiting for the result. The default is usually a synchronous Delete call, because the result is important for further processing.

6.1. Add an Atom to Scenario Step Processing

To add the call B1 Object atom to the process flow:

• (1) Press the [Add] button on the Start atom to insert a new functional processing atom.

• (2) In the New Flow Atom field, select the Call B1 Object value.

• (3) Click Add.

• (4) Finally, press Cancel, because we do not need the predecessor XSL transformation atom.

6.2. Configure the Functional Processing Atom

To configure the processing atom:

• (1) Press the [Change Configuration] button.

• (2) In the SysId field, select the SAP Business One system entry.

• (3) In the Method field, use the Delete value.

• (4) In the Object Identifier field, select 4 - Items.

• (5) The Key Name property is filled automatically based on the Object Identifier.

• (6) In the Key Value field, enter an existing business partner ItemCode, for example, #Item04.

• (7) Finally, press the [Save] button.

Page 10: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

10

7. CLOSE A SALES ORDER

The chapter guides you through the procedure to close a sales order document in SAP Business One using the SAP Business One DI API.

Please refer to the sample sap.B1.Close scenario step available in the sap.B1Object scenario package.

7.1. Add an Atom to Scenario Step Processing

To add the call B1 Object atom to the process flow:

• (1) Press the [Add] button on the Start atom to insert a new functional processing atom.

• (2) In the New Flow Atom field, select the Call B1 Object value.

• (3) Click Add.

• (4) Finally press Cancel, because we do not need the predecessor XSL transformation atom.

Page 11: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

11

7.2. Configure the Functional Processing Atom

To configure the processing atom:

• (1) Press the [Change Configuration] button.

• (2) In the SysId field, select the SAP Business One system entry.

• (3) In the Method field, use the Close value.

• (4) In the Object Identifier field, select Orders.

• (5) The Key Name property is filled automatically based on the Object Identifier.

• (6) In the Key Value field, enter an existing document entry for a sales order with status open.

• (7) Finally, press the [Save] button.

8. CANCEL A SALES ORDER

The chapter guides you through the procedure to cancel a sales order document in SAP Business One using the SAP Business One DI API.

Please refer to the sample sap.B1.Cancel scenario step available in the sap.B1Object scenario package.

8.1. Add an Atom to Scenario Step Processing

To add the call B1 Object atom to the process flow:

• (1) Press the [Add] button on the Start atom to insert a new functional processing atom.

• (2) In the New Flow Atom field, select the Call B1 Object value.

• (3) Click Add.

• (4) Finally, press Cancel, because we do not need the predecessor XSL transformation atom.

Page 12: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

12

8.2. Configure the Functional Processing Atom

To configure the processing atom:

• (1) Press the [Change Configuration] button.

• (2) In the SysId field, select the SAP Business One system entry.

• (4) In the Method field, select the Synchronous Cancel value.

• (1) In the Object Identifier field, select Orders.

• (5) The Key Name property is filled automatically based on the Object Identifier.

• (6) In the Key Value field, enter an existing document entry for a sales order with status open.

• (7) Finally press the [Save] button.

Page 13: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

13

9. PROCESS AN SQL STATEMENT

The chapter guides you through the procedure to process an SQL statement in SAP Business One using the

SAP Business One DI API.

Please refer to the sample sap.B1.RecordSet scenario step available in the sap.B1Object scenario package.

9.1. Add an Atom to Scenario Step Processing

To add the call B1 Object atom to the process flow:

• (1) Press the [Add] button on the Start atom to insert a new functional processing atom.

• (2) In the New Flow Atom field, select the Call B1 Object value.

• (3) Click Add.

• (4) Finally, press Cancel, because we do not need the predecessor XSL transformation atom.

9.2. Configure the Functional Processing Atom

To configure the processing atom:

• (1) Press the [Change Configuration] button.

• (2) In the SysId field, select the SAP Business One system entry.

• (3) In the Method field, select the B1 RecordSet value.

• (4) In the Object Identifier field, enter the SQL statement:

#SELECT T0.[ItemCode], T0.[ItemName] FROM OITM T0 ORDER BY T0.[CreateDate] DESC

• (5) Finally press the [Save] button.

Page 14: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

14

10. UPDATE ITEM MASTER DATA WITH DELETING SOME LINE ITEMS

10.1. Configure the Functional Processing Atom

The chapter guides you through the procedure to process update an item master data with deleting some line items in SAP Business One using the SAP Business One DI API. Use the updateWithSubDeletion method only for the Business Partner objects 2, 66, and 147.

Please refer to the sample sap.B1.UpdateWithSubDel scenario step available in the sap.B1Object scenario package.

10.2. Add an Atom to Scenario Step Processing

To add the call B1 Object atom to the process flow:

• (1) Press the [Add] button on the Start atom to insert a new functional processing atom.

• (2) In the New Flow Atom field, select the Call B1 Object value.

• (3) Click Add.

• (4) Finally, press OK to generate the predecessor XSL transformation atom.

Page 15: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

15

10.3. Configure the Functional Processing Atom

To configure the processing atom:

• (1) Press the [Change Configuration] button.

• (2) In the SysId field, select the SAP Business One system entry.

• (3) In the Method field, select the updateWithSubDeletion value.

• (4) In the Object Identifier field, select 66 - ProductTrees ()

• (5) The Key Name property is filled automatically based on the Object Identifier.

• (6) In the Key Value field, enter an existing TreeCode, for example, #P10003.

• (7) Finally, press the [Save] button.

Page 16: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

16

10.4. Customize the XSL Transformation

• Click the XSL transformation atom (xform). The integration framework opens the Embedded XML Editor to edit the XSL file.

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

<xsl:template name="transform"> <BOM> <BO> <AdmInfo> <Object>66</Object> <Version>2</Version> </AdmInfo> <QueryParams> <TreeCode/> </QueryParams> <ProductTrees> <row> <TreeCode>P10003</TreeCode> <TreeType>iProductionTree</TreeType> <Quantity>1.000000</Quantity> <Project nil="true"/> <PriceList>1</PriceList> <Warehouse>01</Warehouse> <ProductDescription>PC Set 1</ProductDescription> </row> </ProductTrees> <ProductTrees_Lines> <row> <ItemCode>P10001</ItemCode> <Quantity>1.000000</Quantity> <Warehouse>01</Warehouse> <Price>730.000000</Price> <Currency>GBP</Currency> <ParentItem>P10003</ParentItem> <PriceList>1</PriceList> <ItemType>pit_Item</ItemType> </row> </ProductTrees_Lines> </BO> </BOM> </xsl:template>

Page 17: Integration Framework for SAP Business One · 3 In the process flow, use the Call B1 Object atom to call an object in SAP Business One (B1) using the SAP Business One DI API. 1. PREREQUISITES

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 liable for 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 statements accompanying 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 functionality mentioned 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 are all 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 obligation to 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 are cautioned 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 other countries. 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 trademark information and notices.