DTW - Extracting Data From ODBC
DTW - Extracting Data From ODBC
Note
Context
SAP Business One Data Transfer Workbench can load data from ODBC as source data.
Procedure
1. In the Step 4: Select Data Source window of the Data Import wizard, choose ODBC in the Select
File Type dropdown list.
2. Select the object and click the icon.
3. From the DSN dropdown list, select a data source name. Then specify a user ID and password.
4. If your database fields contain extremely long values that are longer than 10000 characters, select
the Maximum Data Length Is Larger Than 10000 checkbox. In the Max Length field, enter the
length of the long field.
5. In the Simple Select Statement field, enter an SQL statement to extract data from ODBC. To
preview, choose , the selection results are displayed.
6. To return to the Data Import wizard, choose .
Note
mk:@MSITStore:C:\Program%20Files\sap\Data%20Transfer%20Workbench\Help_DTW... 7/10/2023
Extracting Data from ODBC Page 2 of 2
The source data for the header is mandatory for all the objects, while the source data for the item
is optional:
¡ If the data files contain both header and item files, you must define the primary keys, such as
RecordKey.
For example, the SQL statement Select CardCode as RecordKey, * from OCRD can
be applied to BusinessPartners; the SQL statement Select CardCode as
RecordKey, * from CRD1 can be applied to BPAddresses.
¡ If the data files contain only header files, you do not need to define the primary keys.
For example, the SQL statement Select * from OACT can be applied to the
ChartOfAccounts.
Example
You have a database MyDB, and the data source name (DSN) is defined as MyDSN. If you want to load
BusinessPartners from the MyOCRD table, and BPAddress from the MyCRD1 table, proceed as
follows:
1. In step 1 of the Data Import wizard, select the data type Master Data.
2. In step 3 of the Data Import wizard, select Business Partners Business Partner Master Data .
3. In step 4 of the Data Import wizard, choose ODBC in the Select File Type dropdown list.
4. Select BusinessPartners and click the icon. The Extract by ODBC window appears.
5. In the DSN dropdown list, select MyDSN. Then enter a user ID and password.
6. In the Simple Select Statement field, enter the SQL statement Select CardCode as
RecordKey, * from MyOCRD.
7. Choose to return to the Data Import wizard.
8. Select BPAddress and click the icon. The Extract by ODBC window appears.
9. In the DSN dropdown list, select MyDSN. Then enter a user ID and password.
10. In the Simple Select Statement field, enter the SQL statement Select CardCode as
RecordKey, * from MyCRD1.
11. To return to the Data Import wizard, choose .
Related Information
Importing the Source Data
mk:@MSITStore:C:\Program%20Files\sap\Data%20Transfer%20Workbench\Help_DTW... 7/10/2023