How Do I Add Multiple Objects with the SAPB1 Connector? (Magic xpi 3.x)
The SAPB1 Data Interface (DI) API handles a single object at a time. Magic xpi’s Data Mapper service, on the other hand, lets you add multiple objects in a single step. When configuring the step, Magic xpi turns to the DI to add the multiple objects as necessary.
When you add multiple SAPB1 objects, first configure Magic xpi’s SAPB1 connector using the XML interface. Then connect the Source compound to the SAPB1 BO compound. This will let you add several records simultaneously. The process is explained in the example below.
This example describes how to add multiple Business Partners when the list of Business Partners is in a text file. For this example, create a sample text file using the information below.
The Business Partner file template is:
BPName,CardCode,CardType,Tel1,Tel2,Contact,email
The data in the text file is:
Test 00001,M00001,cCustomer,111-00001,222-00001,Contact 00001,1@mail.com
Test 00002,M00002,cCustomer,111-00002,222-00002,Contact 00002,2@mail.com
Test 00003,M00003,cCustomer,111-00003,222-00003,Contact 00003,3@mail.com
Test 00004,M00004,cCustomer,111-00004,222-00004,Contact 00004,4@mail.com
Test 00005,M00005,cCustomer,111-00005,222-00005,Contact 00005,5@mail.com
The steps below show how to add multiple Business Partners when the list of Business Partners is in a text file:
-
Define an SAPB1 resource in the Resource Repository.
-
Drag the SAPB1 connector to your flow.
-
In the Component Properties dialog box, select XML as your interface.
-
In the Settings tab, select the SAPB1 resource that you previously defined in the Resource Repository. If you have not yet defined an SAPB1 resource, you cannot proceed to configure the SAPB1 connector.
-
Click Configuration.
-
From the Operation drop-down list, select Add.
-
Click to open the Data Object List, select Business Partners, and then click OK.
-
The Source/Destination Management dialog box opens. Click New, and set the source type to Flat File.
-
Click Properties, and then use the text file given above as your source path.
-
Click OK.
-
When the Source/Destination Management window opens, click Map.
-
When the Data Mapper screen opens, create the relevant connections. To add multiple objects, connect the Record element to the BO element.
Note:
|
Magic xpi creates a single XML file that holds the multiple objects’ data and updates the UserXML. Magic xpi then uses this file to add the objects to SAPB1’s DI. If you save the UserXML content to your computer, you will be able to see the XML file. This information is useful when you debug your project.
|
|
Click here to view a sample of the XML code.