You are on page 1of 49

Data Migration Tools:

Using Data Transfer Workbench (DTW)


SAP Business One release 9.2
Objectives

On completion of this course you will be able to:


 Describe the process and steps for using Data Transfer Workbench to import
objects
 List the type of objects that can be imported using DTW
 Explain the relationship between SAP Business One objects and the provided
DTW templates
 Explain how to improve performance when importing into a SAP HANA
database
 Describe how to create a new template by customizing an existing template
 Explain how to import documents and reference other documents as a base

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 2


Overview and References
Data Transfer Workbench (DTW)

Data Transfer Workbench (DTW) is a tool provided with SAP Business One for bulk import of data
into SAP Business One objects using predefined Microsoft Excel templates
Note: DTW supports the import of master data, some setup data, and open transactions.

SAP Business
Microsoft Excel One
Import and/or update
database

DI-API
DTW ODBC

External
Database

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 4


Objects and Templates

 An object in SAP Business One can be


represented by multiple tables in the database Header
(header and child tables)
 To import an object you will use the predefined
spreadsheet templates provided with the DTW
tool
Child
 Each predefined template aligns to a table for the
object

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 5


DTW Reference Files

The DTW executable


folder contains:
 The predefined
templates and
sample templates
 Source files for DTW
online help, executable
Database Tables
Reference, and DI
API Object Source files for:
Reference
Templates • Online help
Reference files are
and • Database
also accessible
Sample Tables
directly from the DTW
Templates Reference
application
• DI API Objects
Reference

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 6


Database Tables Reference

 REFDB.chm provided in DTW


executable folder
 Also accessible from the DTW
help menu
 Includes information for each
table:
 Field name
 Description
 Size
 Default value
 Constraints
 Links to related tables

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 7


Starting DTW

Start from desktop: Start from SAP Business One implementation center: Administration >
Program Files > SAP > Data System Initialization > Implementation Center > Implementation Tasks
Transfer Workbench >
DTW.exe
If you start from the implementation
center you must provide the path to the
DTW executable in the Settings window

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 8


Connecting to the Database Server

 In the DTW logon window, enter the database server details,


the database user and password
 Choose Refresh to show list the companies
 Login to SAP Business One target company as a super user

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 9


DTW Application Window

After logging in, the DTW application


window opens showing the menu
options:
 Tools: Import wizard, log manager

 Templates: creation of new


templates

 Help: DTW online help and


Database Tables Reference

The bottom of the application window


shows the status of the connection to
the target database, including the
company

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 10


Overall Process for Import

Map data into predefined templates

Save template as delimited file*

Log in to target company database

In DTW, choose Import button to run


import wizard

*tab delimited, comma delimited, or semi-colon delimited file.


Note: the delimiter character should not appear in any field data.
© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 11
Predefined Templates
Predefined Templates

 Parent and child templates are provided for each object that can be imported
 Templates are organized to match the SAP Business One application menus
 Template names start with the relevant table name, e.g., OCRD, CRD1, OCPR

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 13


Example: OCRD Template

 Each predefined template includes a column for each field exposed to the DI API
 The two header rows should not be removed. They contain the object properties and the DI API field
names

 These fields are described in the DI API Objects Reference and the Database Tables Reference
 SAP recommends you do not remove columns from a template; instead leave a column blank, or
generate a customized template

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 14


Field Comments and Enumerated Data

 Each header field in the template includes a comment showing data type and field length
 If the type is shown as enum, then DTW expects you to use one of the valid values expected by the DI API
 If the comment shows a related table, then enter the code of the related table in the template field

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 15


Valid Values and Database Tables Reference

 If a field has valid values in the template


comment, always use these values and
do not enter the constraints shown in the
Database Tables Reference

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 16


Leaving Columns Blank

 The data entry rules for DTW are identical to manual data entry. You do not need to enter default field values
or non-required data
 Make sure that prerequisite data is created before you import the data

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 17


Importing into User-Defined Fields

 To import data into a user-defined field, add the name of the user-defined field and the
data in a column at the end of the template

 If an object has many user-defined fields, you have the option to generate a new template
for the object that includes user-defined fields

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 18


Importing Parent and Child Templates

 If there are child tables for an object, you can import the child records together with the parent records
 To relate the child and parent templates, the parent key field in the child template will link back to the primary
key (column A) in the parent template.

Parent template

Child template

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 19


Updating Child Tables for an Existing Object

 Use the child templates without the respective parent template to update or add records to the child
tables of an existing object
 For example, you can add new contact employees, or update contact information, for a business
partner using the child template OCPR
 Enter the key for the parent table in column A, and identify the row to be updated by entering the
LineNum field in column B (0, 1, 2, etc.)

 To verify the row for an object, run a query on the child table in SAP Business One
 Choose “Update Existing Data” in wizard

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 20
Customizing Templates
Business Example for Customized Templates

 You want to import item master data into a new SAP Business One system.
 The predefined template OITM contains many fields including sales and
purchasing units and properties. The products to be imported do not use many of
these template fields.
 To simplify the data entry process, you can remove unused fields and generate a
custom template. This will make the templates easier to work with.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 22


Customize Template - 1

 To create a template tailored to your


needs, choose
Templates>Customize Template
 Select the business object which
will be the basis for the new
template

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 23


Customize Template - 2

 Expand the node for the table to


see the complete list of DI API
fields
 When you select a field, the field’s
attributes display in the lower right
 You can:
 Rearrange the field order by
dragging and dropping
 Delete a field from the
template
 Add a previously removed
field

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 24


Customize Template - 3

 After you have rearranged the fields, right-


click the table node and select Create
Template for the Structure
 The new template is saved in the
templates folder as a .xlt file

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 25


UDF and UDO Templates

User-defined fields (UDFs) added to an object do not You can also generate new templates for user-
appear by default in the predefined templates, but you can defined objects (UDOs) by choosing Generate
generate a new template with the UDFs added at the end: UDO Templates
 Choose Generate UDF Templates  The window shows all user-defined objects
 The window shows a list of all objects that contain UDFs  The system will generate templates for selected
 The system will generate templates for selected objects user-defined objects

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 26


Import Process
DTW Import Wizard

Select the type of data


to be imported:
 Setup data
 Master data
 Transactional data

Note: You can only


import data for one
object type at a time.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 28


DTW Import Wizard

Select the operation to be performed:


 Add
 Update
 Add and Update

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 29


DTW Import Wizard

Navigate to the business object by


expanding the list

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 30


DTW Import Wizard

Select the file type for the saved template:


 Comma separated
 Semicolon separated
 Tab delimited
 ODBC

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 31


DTW Import Wizard

For each table to be imported for the object,


select the browse button and locate the saved
template file (comma, semi-colon or tab
delimited)
After selection, the path to the template is
shown

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 32


DTW Import Wizard

Use the Mapping Rules tab to visually check


the mapping between the template source data
fields and the DI API fields

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 33


DTW Import Wizard

Use the Source Data tab to visually scan the


template data to make sure each field is
interpreted correctly

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 34


DTW Import Wizard

Use the Target Data tab to visually scan the


expected target data fields based on the
mapping
Expand the object structure to see the
expected data for each field

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 35


DTW Import Wizard

You can define how the wizard will


handle any errors during the import:
 Cancel the import after the first
error is encountered
 Ignore all errors and import valid
records
 Ignore a set number of errors and
import valid records

Option to run a simulation before


actual import of records

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 36


DTW Import Wizard

Log entry produced for each record imported


into the database

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 37


DTW Errors

 If any errors are detected with


the template data, the Key
and Description of the failing
record is shown
 Drill-down to the row in the
template by clicking the Error
File button

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 38


HANA Performance

 With an SAP HANA database, you can run


the import using multiple, parallel processes
 Select the Enable Faster Import checkbox,
and select the number of processes (default
is 4)

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 39


Importing Documents
Basic Template Structure for Documents

Most marketing documents are based on the same


business object but there is a different set of tables
for each document type
In DTW, the predefined templates for marketing
documents follow the same structure:
 Documents template for the document header
 Document_Lines child template for the
document rows
 Document_SpecialLines child template for text
and subtotal rows
 Other child templates for importing additional
expenses (freight, insurance, etc.), taxes, and
serial number/batch information for the
document

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 41


Document Numbering

 If the HandWritten field is


blank, SAP Business
One will assign
document numbers from
the current numbering
series

 To retain legacy
document numbers,
enter the actual
document number and
‘tYES’ in the
HandWritten field

 You can optionally


specify a numbering
series in the template

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 42


Relating Parent and Child Templates for a Document

 Each row in the parent template


represents a separate document

 Each document in the parent


template can have one or more
rows in the child template

 The rows in the child template


Document_Lines tie back to a row
in the parent template using the
same value in the
Docnum/ParentKey (column A)

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 43


Importing Related Transactions

Sales Order Delivery A/R Invoice Incoming Payment

Copy to/from

Purchase Order Goods Receipt PO A/P Invoice Outgoing Payment

Copy to/from

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 44


Base and Target Document Links

 When you import a document that is based on another document, you must provide details about the
base document in the DTW template
Sales Order Delivery A/R Invoice Incoming Payment

Sales Order Delivery A/R Invoice


Document Number 281 300 350
Base Document Number - 281 300
Base Document Type - Sales Order Delivery
Base Row – 1st row - 0 0
Base Row – 2nd row 1 1

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 45


Specifying Base Document References in the Template

 The references to the base document are


specified in the child template on each row
 The child template rows reference a base
document using the fields:
 BaseType (document type)
 BaseEntry (internal document number)
 BaseLine (row in base document)

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 46


Base Document Types

 Base document types are documented in the DI BaseType Document Type


API Objects Reference
23 Sales Quotation
17 Sales Order
15 Delivery
13 A/R invoice
16 Return
22 Purchase order
20 Goods Receipt PO
18 A/P invoice
14 Sales Credit Memo
19 Purchase Credit Memo
21 Goods Return
© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 47
Effects of Importing Marketing Documents

 When you import marketing documents using DTW, postings are made depending on the document type, to
inventory and to various accounts in the general ledger
 Postings are identical to manually created documents

Inventory BP balance Revenue Inventory accounts


Sales Order 
Delivery  
A/R Invoice  

A/R Invoice (with    


no preceding
documents)

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 48


Key Points

Key points from this course:


• Data Transfer Workbench (DTW) makes it possible to import setup data, master data, and open
transactions in bulk.
• DTW provides predefined templates for the objects in SAP Business One, based on the DI API
interface. The Database Tables Reference provides documentation for the templates.
• When you use a SAP HANA database you can increasing performance by checking the Enable
Faster Import checkbox. DTW will import the data using multiple parallel threads.
• After you have entered the data in the template, save the templates as a tab, comma, or semi-
colon delimited file before you run the import wizard. SAP recommends that you run a simulation
first, or import the data into a test database so you can validate the results.
• You can create custom templates for ease of use. For example, a template with just the columns
you need for the data. You can also generate templates for an object that include user-defined
fields. And you can generate templates for user-defined objects.
• You can import documents that are linked to other base documents by specifying the base
document information in the child row template.

© 2017 SAP SE or an SAP affiliate company. All rights reserved. Internal 49

You might also like