Blogs

DTW Top Tips
Lisa Mulchinock SAP Employee
Business Card
Company: SAP
Posted on Aug. 25, 2009 11:42 PM in SAP Business One

Subscribe.Subscribe
Print. Print
Permalink Permalink

In this blog we will highlight some tips on how to use the DTW so you can ensure your import/update runs as smoothly as possible.

DI API Help File

The DI API Help File is a vital resource to use when using the DTW along with the comments in the data templates delivered with the DTW. The DI API Reference lists all exposed objects with methods and properties. For each object you can find information on the Detailed Description, Field name & length, Property type and Syntax. 

Example: Import Manual Journal Entries

  • Go to Index Tab and enter "Jou.."
  • Double click "JournalEntries Object" to display the object's details
  • Review the details of all the members including Child objects

image

 

  • View details of property AutoVat.
  • The valid value to enter in the DTW import file must be a member of "BoYesNoEnum" enumeration
  • Enter tNO or tYES in the data import file

image

So for each field if you are unsure which value (especially enumeration fields) should go into the DTW files it is important to verify it in the DI API help file. 

LineNum

If you are adding new records or updating a record to add additional information (e.g. add new Warehouse or add new contact persons) you need to leave LineNum blank. LineNum column is used only during Update mode.

LineNum must be an integer so if you want to update the first line/record you assign the value 0 to the LineNum field in the data file. If you wish to update the second line/record, you assign the value 1 to LineNum and so on. It is important to never remove this column even if no values are entered.

Example:
1. The SAP Business One database has 13 price lists defined in the system
2. You want to import an item for which you define prices for the first, the second and the eighth price list displayed in the Item Master Data.
3. Set the data file Items_Prices as follows:
RecordKey,LineNum,Currency,Price
RecordKey,LineNum,Currency,Price
1,0,USD,12
1,1,USD,24
1,7,USD,28

To import new data to an existing record you need to select the checkbox "Add all Items into Schema if can't find corresponding item when updating".

Object Names

In general, the names of objects in the DTW and SAP Business One are similar. The exceptions are as follows:

Object in DTWObject in Business One
oInventoryGenEntryGoods Receipt
oInventoryGenExitGoods Issue
BoBridgeExchange Rates
oAlternateCatNumBusiness Partner Catalog Numbers
oContactsActivity
oAttachments2Attachments linked to objects such as Messages, Activites,  Service Contracts 
oProductTrees Bill of Materials

Template Structure

Templates explained

The first row consists of the properties from the DI API. We recommend that the first line in the template is not changed as this might cause incorrect mapping. This can result in data not being imported and no error messages returned. The second row consists of the explanations of the properties. This line can be changed for a better explanation of the property. Do not use special characters or empty spaces.

Un-used columns

We strongly suggest that columns are not deleted from the templates. If a value is not required to be added or updated leave the column blank to avoid problems. Deleting columns can cause records not being imported or unexplained error messages.

RecordKey

This key identifies the header record from other records. To improve the performance, RecordKey values are sorted in order during the import. The same RecordKey for one object must be entered in both templates for the header and line templates. 

Special Characters in the template

Special characters such as double byte characters, commas, double quotation marks etc can prevent correct mapping. Microsoft excel generates a .csv/.txt file in non-unicode encoding or seperates the data in additional columns which cannot be recognised by the DTW. Its good to open a file in plain text to see if you can see any incorrect characters.

Other Tips

  • Date format is yyyymmdd
  • When using segmented Chart of Accounts the FormatCode field must be filled e.g. _SYS00000000010. For non-segmented Chart of Accounts use the Code field.
  • If you want to import a Journal Entry for a BP use ShortName (fill it with the BPCode) and leave AccountCode blank
  • Not all objects/properties are exposed in the DI - therefore they are not available also via the DTW e.g. User defined fields for batches, project codes etc. It's important to verify in the DI API Help file if the object/property is exposed.

Our next blog will cover the topic of how to send an Email with an attachment via the DI API. So catch you then :-)

 

Lisa Mulchinock is a senior SDK support consultant for SAP Business One.


Add to: del.icio.us | Digg | Reddit


Comment on this articleIf anything in unclear or if you have additional questions regarding DTW Top Tips feel free to add a comment here.
Comment on this weblog