You are on page 1of 148

BaanERP

Exchange User Guide

A publication of: Baan Development B.V. P.O.Box 143 3770 AC Barneveld The Netherlands Printed in the Netherlands Baan Development B.V. 1999. All rights reserved. The information in this document is subject to change without notice. No part of this document may be reproduced, stored or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Baan Development B.V. Baan Development B.V. assumes no liability for any damages incurred, directly or indirectly, from any errors, omissions or discrepancies between the software and the information contained in this document. Document Information Code: Group: Edition: Date: U7137A US User Documentation A September, 1999

Table of contents

Introduction Exchange compared to Database Management To design a data exchange To activate the data exchange The Exchange modules Master Data Data exchange based on audit How to set up a data exchange The Master Data sessions Exchange schemes (tuxch0501m000) ASCII files (tuxch0102m000) ASCII file fields (tuxch0503m000) Batches (tuxch0104m000) Conditions (tuxch0114m000) Parameters by Condition (tuxch0113m000) Import module Introduction Regular and non-regular data exchange To use the Data Access Layer Start and end date and time During the data exchange How to set up an import process The Import module sessions Table Relations (Import) (tuxch0521m000) Field relations (import) (tuxch0522m000) Conversion Tables (tuxch0105m000) Conversions per Field (tuxch0105m000) Create Import Program (tuxch0227m000) Import Data (on a Regular Basis) (tuxch0224m000) Import Data (Non-Regular) (tuxch0223m000) Export module To set up an export process The Export module sessions Table Relations (Export) (tuxch0531m000) Field Relations (Export) (tuxch0531m000)

1-1 1-2 1-2 1-3 1-3 2-1 2-1 2-1 2-2 2-3 2-9 2-10 2-13 2-14 2-17 3-1 3-1 3-1 3-2 3-3 3-3 3-4 3-5 3-5 3-10 3-16 3-17 3-19 3-21 3-24 4-1 4-1 4-2 4-2 4-6
Exchange User Guide i

Table of contents

Ranges (tuxch0112m000) Create Export Programs (tuxch0228m000) Export Data (on a Regular Basis) (tuxch0234m000) Export Data (Non-Regular) (tuxch0233m000) To check the results 5 Multisite control Audit trail About multisite exchange in Baan The export process The Export Done message File transport specifications The import process The Import Done message How to set up a multisite exchange The Multisite Control sessions Environments (tuxch4100m000) Exchange Links (tuxch4501m000) Activate/Deactivate Exchange Links (tuxch4201m000) Resend Rejected Messages (tuxch4203m000) Subscriptions (tuxch4502m000) Receive Remote Procedure Calls (tuxch4200m000) Generate Exchange Scheme Introduction The Generate Exchange Scheme sessions Exchange Companies (tuxch0150m000) Exchange Groups (tuxch0151m000) Table Details (tuxch0152m000) Field Details (tuxch0153m000) Import Tables (tuxch0154m000) Import Fields (tuxch0155m000) Update Field Data per Exchange Group (tuxch0255s000) Generate Exchange Scheme (tuxch0251m000) Generate Authorizations (tuxch0256m000) Miscellaneous The Logging sessions Print Log File (tuxch0215m000) Remove Log Files (tuxch0216m000) Log Table (Batch Level) (tuxch0508m000) Log Table (Batch Line Level) (tuxch0509m000) Clear Log Table (tuxch0208m000) The Tools sessions

4-9 4-11 4-12 4-15 4-18 5-1 5-1 5-2 5-2 5-3 5-3 5-3 5-4 5-5 5-5 5-5 5-6 5-9 5-12 5-16 5-18 6-1 6-1 6-4 6-4 6-6 6-7 6-8 6-10 6-12 6-13 6-14 6-15 7-1 7-1 7-2 7-4 7-5 7-7 7-9 7-10

Exchange User Guide ii

Tahle of contents

Copy Exchange Scheme (tuxch0201m000) Delete Exchange Scheme (tuxch0222m000) Rename ASCII File (tuxch1202m000) Create ASCII File Fields and Relations (tuxch0203m000) Create Definition Files (tuxch0204m000) Print ASCII File (tuxch0202m000) Remove ASCII Files (tuxch2202m000) Check Syntax of Conditions (tuxch0206m000) Predefined Functions/Variables (tuxch0510m000) Print Exception Report for Baan Fields (tuxch0423m000) The Conversion sessions The procedure for converting data Types of conversion Procedure Conversion with Customization Convert Exchange Schemes from 6.1a (tuxch9211m000) Domains Separator Convert Conditions Replace Conditions Log file Conditions from 6.1a (tuxch0511m000) 8 Generic Exchange Scheme To install the Generic Exchange Scheme Customize the Generic Exchange Scheme Run the Generic Exchange Scheme

7-10 7-12 7-13 7-14 7-16 7-18 7-19 7-20 7-21 7-24 7-25 7-25 7-25 7-26 7-27 7-29 7-29 7-30 7-30 7-32 7-32 7-36 8-1 8-1 8-3 8-3

Exchange User Guide iii

Table of contents

Exchange User Guide iv

About this document

This guide is intended to assist developers who need to transfer data in and out of Baan applications. It is assumed that users have a thorough knowledge of the data model structure of the Baan system and of the Baan application. Users should also be familiar with the basic programming concepts of 3GL programming, ASCII files, and applications such as Microsoft Excel. This guide fully describes the Exchange module in Baan and how to use it. Each module in Exchange is described in a chapter in this guide. Each chapter begins with a description of the module. Next, are sections that describe all of the sessions in each module. Each session description contains the following:
n n n n

An overview of the session The procedure for using the session A picture of the session in Baan A table of all the fields in the session and how to use them

Following is a description of the contents of each of the chapters in this book. Chapter 1, Introduction, describes what data exchange is and gives a brief overview of the Exchange module in Baan. Chapter 2, Master Data, describes how to set up an exchange scheme, which is the basis for all data exchanges. Chapter 3, Import module, describes how to set up an import of data into a Baan application. Chapter 4, Export module, describes how to set up an export of data from a Baan application to another application. Chapter 5, Multisite control, describes how to set up data exchanges between multiple companies. Chapter 6, Generate Exchange Scheme, describes how to set up an exchange of data between two or more companies. Chapter 7, Miscellaneous, describes a variety of other tools in Exchange, including tools for logging, administration, and conversion. Chapter 8, Generic Exchange Scheme, describes how you can install, customize, and run generic exchange schemes.

Exchange User Guide v

About this document

Exchange User Guide vi

Introduction

You can use the Exchange (XCH) module to import and export data to and from BaanERP. Data is imported and exported by writing to and reading from information contained in ASCII files. ASCII files can be in various formats to support exchange of data between third-party applications, databases, and spreadsheets. The exchange module has these primary purposes:
n

To import data for conversions from other systems and from prior releases of Baan To exchange data with other applications To interchange data between BaanERP companies to support multisite organizations

n n

Exchange is not recommended, however, when you are only transferring small numbers of records, or transferring whole tables where you do not need to perform any data manipulation.

BAAN

Exchange

import BAAN data export

ASCII file

ASCII file

Figure 1, The Exchange module in Baan

Exchange User Guide 1-1

Introduction

Exchange compared to Database Management


The Database Management module of Baan Tools also provides the ability to create ASCII files from Baan data and to load data from an ASCII file into BAAN. You can use these tools for basic data exchanges that do not require any special handling. These tools are contained in the Create Sequential Dump of Table (ttaad4226m000) and Create Table from Sequential Dump (ttaad4227m000) sessions. You can also activate them from the UNIX prompt (bdbpre6.1 and bdbpost6.1). If you use both tools one after the other, you can transfer data from one Baan company to another. The main difference between the Database Management and Exchange modules is that the Exchange module provides more flexibility in specifying which data must be read or written and in which format. In the Database Management module you must import or export whole tables. The advantages of using the Exchange module instead of the database tools include the ability to:
n n n

Specify the exact data to be exchanged by table and field Convert and calculate data during an exchange Export based on an audit, only the data that has changed since the last exchange Specify the order in which fields are imported Read data from other tables

n n

To design a data exchange


The way that you design your exchange scheme depends on how often you want to run the process and which data you want to have at each site. If your data changes often and needs to be kept up-to-date, you need to schedule frequent updates so that you have a near real-time environment. On the other hand, you might want to schedule less frequent updates if it is more important to keep communication costs down. If your data only needs to be updated when there are predictable changes, you can schedule the exchange accordingly. For example, if the stock data only changes when an inventory control is done at the end of the month, you only need to run an exchange after the inventory control is performed.

Exchange User Guide 1-2

Introduction

For less frequent changes, or if the changes are not predictable, you can also perform the exchange on demand instead of on a fixed schedule. Not all sites require updates of all data, and you can minimize your communication costs by exactly specifying the data to be exchanged. For example, all bank sites need to have up-to-date currency exchange rates, but all sites do not need to have all the customer data for the entire bank.

To activate the data exchange


After the exchange information is set up, you can manually activate the actual import or export process or it can be activated by the job manager. You can also create an export file based on audit information. This is typically used for data exchange in a company. Figure 2 shows the relation between the Exchange module, the job manager, and the audit manager.

Audit manager Audit files

ASCII Files

Exchange module

BAAN data

Job manager

Figure 2, Exchange module in relation to the audit and job managers

The Exchange modules


Exchange contains the following modules:
n n n n n n

Master Data Import Module Export Module Multisite Control Generate Exchange Scheme Miscellaneous
Exchange User Guide 1-3

Introduction

You can enter the general characteristics of the exchange process in the Master Data module. This information contains parameters and directories. The Master Data module also defines the layout of the ASCII file. In the Import module and the Export module, you specify the structure of the ASCII files and the relationship to the Baan tables. These modules contain the actual import and export processes as well. Use the Generation of Exchange Scheme module to specify the desired functionality of an exchange scheme. AanERP uses this information to create an exchange scheme and its related import data. The data can also be used to generate database authorizations in the Baan Tools Database Authorizations. Use the Multisite Control module to set up a batch-driven replication server. This allows you to transfer data from one system to another in one process. The Miscellaneous module provides certain utilities and informative sessions, such as utilities to copy or delete certain master data. You can use the Miscellaneous module to query the results and status of previous export and import processes.

Exchange User Guide 1-4

Master Data

You can use the Exchange module to import and export data to and from Baan, and to import and export data between Baan and other applications. The procedure consists of setting up the exchange scheme and file layout for the exchange, and then performing the actual import and/or export of data to and from ASCII files. An exchange scheme defines the general parameters used during an import or export such as the location of files, use of an audit trail, and other default settings. The exchange scheme contains all definitions of data that must be imported or exported. The ASCII files, conditions, batches, table and field relations, ranges, and conversions are grouped together in an exchange scheme. The result of an import process is the data imported into Baan tables, and the result of an export process is the Baan data exported to ASCII files. You can then use these ASCII files in different applications to import data that originated in Baan.

Data exchange based on audit


The data exchange can be based on an audit. In an export, this means that only changes in the table are exported, as opposed to the entire table. The export provides information on insertions, updates, and deletions. When import is based on an audit, the insertions, updates, and deletions are processed in the importing company. In order to export based on an audit, the audit must be turned on for the table in Baan Tools, Database Management. To set up a multisite data exchange, you must set the auditing function on.

How to set up a data exchange


Both the export and import procedures begin by setting up an exchange scheme. After the exchange scheme is ready, you set up table relations, field relations, and export or import data parameters. An exchange scheme is set up in the following steps:
1 2

Define an exchange scheme. Define an ASCII file.

Exchange User Guide 2-1

Master Data

3 4 5

Define the fields for the ASCII file. Create a batch. Add conditions if necessary.

To export or import Baan data, you begin by setting up an exchange scheme using the Exchange Schemes (tuxch0501m000) session in the Master Data module. Because other applications store data in different formats, Baan cannot always directly exchange data with them. The best way to perform a data exchange is to convert data into ASCII text, which is readable both by Baan and other applications. The Exchange module handles the conversion of data between Baan and ASCII, the selection of the data, and the sequencing of the data in the ASCII file. After you have created an exchange scheme, you define the ASCII file to which your exchange scheme will export or import data. You do this using the ASCII Files (tuxch0102m000) session. The ASCII file consists of fields. You define the fields contained in the ASCII file by using the ASCII File Fields (tuxch0503m000) session. After you have defined the ASCII file fields, you use the Batches (tuxch0104m000) session to define the batch for the export or import. Each exchange scheme can contain more than one batch. A batch is a group of related table operations. When you have defined the batches, you can run the export or import by batch, instead of running the entire exchange scheme at once. If necessary, you can write scripts to further customize the exchange, and add them to your exchange scheme as conditions.

The Master Data sessions


Following are the sessions included in the Master Data module:
n n n n n n

Exchange schemes (tuxch0501m000) ASCII files (tuxch0102m000) ASCII file fields (tuxch0503m000) Batches (tuxch0104m000) Conditions (tuxch0114m000) Parameters by Condition (tuxch0113m000)

Exchange User Guide 2-2

Master Data

Exchange schemes (tuxch0501m000)


Use the Exchange Schemes (tuxch0501m000) session to view and maintain exchange schemes. An exchange scheme is the basis for every import and export. All import procedures and export procedures are related to an exchange scheme, which is identified by a unique exchange-scheme code. Choose File New to display the Exchange Schemes (tuxch0101s000) session, which you use to create a new exchange scheme. Complete the exchange scheme by choosing the commands on the Specific menu to start the following sessions:
n

ASCII Files (Ctrl+Shift+A) Starts the ASCII Files (tuxch0102m000) session. Batches (Ctrl+Shift+B) Starts the Batches (tuxch0104m000) session. Conditions (Ctrl+Shift+C) Starts the Conditions (tuxch0114m000) session.

If you want to add more information, click the Text button on the toolbar to start the text editor. Follow this procedure to set up an exchange scheme:
1 2 3 4

Choose FileNew to display the Exchange Schemes (tuxch0101s000) details session. Enter the name and description of the exchange scheme you are creating. Enter the full path of the directories where Exchange files are to be stored. Set up the ASCII file configuration, indicating whether the exchange is to be based on audit, based on indicators, and how the fields in the ASCII file are separated. If this exchange scheme is copied from an existing exchange scheme, enter the parent exchange scheme on the Special tab. If you want to use the same directory for import and export on a regular basis, enter the names of the subdirectories that must overrule the default subdirectory. Enter the settings for text, multibyte, float, and log.

5 6

Exchange User Guide 2-3

Master Data

If you want to add more information, click the Text button on the toolbar to start the text editor.

Figure 3, Exchange Schemes, Display

Figure 4, Exchange Schemes, New, General tab

Exchange User Guide 2-4

Master Data

Figure 5, Exchange Scheme, New, Special tab

Exchange Schemes (tuxch0101s000) Field General tab Exchange Scheme Description Paths Exchange Programs Enter the absolute path name (starting from the root directory) of the directory in which to write Exchange programs. Exchange uses the path name entered here on all the fields where the path name is required. Enter the absolute path name (starting from the root directory) of the directory for error files and log files. Exchange uses the path name entered here on all the fields where the path name is required. Enter the absolute path name (starting from the root directory) of the directory for ASCII files. Exchange uses the path name entered here on all the fields where the path name is required. Enter the absolute path name (starting from the root directory) of the directory for definition files. Exchange uses the path name entered here on all the fields where the path name is required. Enter the name of the exchange scheme. Enter a description of the exchange scheme. Description

Errors / Log Files

ASCII Files

Definition Files

Exchange User Guide 2-5

Master Data

ASCII File Configuration Based on Audit Select to export only the changed data, that is, data that is imported or exported from audit files instead of BaanERP tables. This improves the performance of data exchange. Auditing the files slows system performance, however, which you must consider when setting up Baan. Select when you want to set up a multisite exchange. This option only shows that an audit is carried out on one or more tables that are imported or exported. Baan does not check whether audit is set for the tables to be exported. You can overrule the audit procedure for batches in an exchange scheme by using the Batches (tuxch0104m000) session. For example, the audit is overruled if a batch contains tables that do not use the audit procedure. Select to include an indicator to display whether the following record is an audit action code. Codes include: I = insert or add d = delete u = update or modify n = new value If Based on Audit is selected, this option is also automatically selected. You can also select this option independently, which allows Exchange to receive information from other systems that also produce net change reports. Enter a value here if you want to use variable-length fields in the ASCII file. The value you enter here is used to separate the ASCII file fields. The default is fixed-length fields. Allowed values are characters such as \, ], ^, and _, and letters in the range [A-Z] if the Control Character check box is selected. Do not use characters that are used in the data fields that have to be exchanged. If a control character is part of the separator character, enter its value here. This option is only activated if Separator Character contains a value, indicating that the ASCII file field uses variable lengths. Enter the character you want to use to enclose strings, for example, string. Define the default format for the date. The date format is defined per field in the ASCII file that is used in an exchange scheme. If no date format is defined for an ASCII file field, the Default Date Format is selected. If the ASCII file field is created by using BaanERP audit files, the Default Date Format is set to BaanERP Number.

Based on Indicators

Separator Character

Control Character

Enclosing character Default Date Format

Exchange User Guide 2-6

Master Data

Special tab Parent Exchange Scheme Enter the name of the exchange scheme that is used as the parent in a multilevel exchange scheme. A parent exchange scheme is useful if you want to make small changes to an existing exchange scheme. You only copy those parts of the scheme that you want to change. The batches and table relations that you do not copy are inherited from the parent exchange scheme. Enter the subdirectory that must overrule the default subdirectory for a data import on a regular basis. This enables you to use the same directory for import and export on a regular basis. If the run numbers of the import and export run are identical, you need not move the ASCII files. During a data export on a regular basis, if an Overrule Subdirectory is not specified, the ASCII files are placed in the default subdirectory (<exchange scheme>.<run number>.i). If an Overrule Subdirectory is specified, the specified directory is used instead. If the overruling subdirectory already contains files, they are overwritten. The subdirectory is located in the ASCII file directory. Exchange reads this parameter at run time. The subdirectory can only be overruled if the ASCII file name specified in the Table Relations (Import) (tuxch0121s000) session does not contain an absolute path. Enter the subdirectory that must overrule the default subdirectory for a data export on a regular basis. This enables you to use the same directory for import and export on a regular basis. If the run numbers of the import and export run are identical, you do not have to move the ASCII files. During a data export on a regular basis, the ASCII files are placed in the default subdirectory (<exchange scheme>.<run number>.i). If the overruling subdirectory already contains files, the ASCII file is placed in the default directory <export subdirectory>.<run number>. The subdirectory is located in the ASCII file directory. Exchange reads this parameter at run time. The subdirectory can only be overruled if the ASCII file name specified in the Table Relations (Import) (tuxch0121s000) session does not contain an absolute path.

Overrule Subdirectories Regular Import Directory

Regular Export Directory

Exchange User Guide 2-7

Master Data

Text, Multibyte, Float, and Log settings Increase Text Number Select to increase the text numbers when the text tables are imported. Otherwise the text numbers remain the same. Existing texts are overwritten if this is allowed in the table and field relations. Thus, text tables are handled like other tables. Select to convert table field datatypes from multibyte string to the local character type. The conversion is done directly after reading the characters in the ASCII file during a data import. When you export, a conversion is done just before the value is written to the ASCII file. Errors during multibyte conversions are not logged. Select to convert the values of the db.float and db.double table fields. Use this option if you have trouble exporting data based on the audit procedure in a client/server environment that combines a non-Intel application server with an Intel database server. Select to perform additional logging. During a data export based on audit, transactions performed on the database in the same second are logged. This is because Baan does not know the correct sequence in which the transactions were done on the import site. Additional logs are used to check the transactions. The additional log file is placed in the same directory as the normal log file and has the .tran extension. Do not select this check box if additional logging is not required. Logging is time-consuming and reduces performance. Indicates whether this exchange scheme includes text.

Multibyte Conversions

Convert Floats/Doubles

Do Additional Logging

Exchange Scheme Text

Exchange User Guide 2-8

Master Data

ASCII files (tuxch0102m000)


Use the ASCII Files (tuxch0102m000) session to maintain logical ASCII files in an exchange scheme. You can do this automatically or manually. If you use the name of a Baan table for the ASCII file name, Baan can automatically enter the fields for that table when you use the ASCII File Fields (tuxch0503m000) session. The Specific menu contains these options:
n

ASCII File Fields (Ctrl+Shift+1) Starts the ASCII File Fields (tuxch0503m000) session. Create ASCII Files (Ctrl+Shift+G) Starts the Create ASCII File Fields and Relations (tuxch0203m000) session. Use this option to create ASCII files automatically.

Follow this procedure to create an ASCII file manually:


1 2 3

Define a unique logical ASCII file name with a description. In the Definition File field, define a definition file from which used to copy the ASCII file fields. If you want to add more information, click the Text button on the toolbar to start the text editor.

Figure 6, ASCII Files

Exchange User Guide 2-9

Master Data

ASCII Files (tuxch0102m000) Field ASCII File Description Definition File Description Enter the name of the ASCII file. Enter a description of the ASCII file. Enter the name of the definition file, if you are using one. A definition file is used to load preset ASCII file format information into the current ASCII file. Baan normally gets this definition file from another Baan system that has used the exchange tools to export some data. You can make a definiton file by using the Create Definition Files (tuxch0204m000) session. You can reuse definition files in other ASCII files. You can also leave this field blank, in which case Baan uses the definition file that you enter in the ASCII File Fields (tuxch0503m000) session. Text Indicates whether the ASCII file includes text.

ASCII file fields (tuxch0503m000)


After you have defined the ASCII file, you define the ASCII file fields. Use the ASCII File Fields (tuxch0503m000) session to list the available ASCII file fields in a logical ASCII file. The ASCII file fields define the layout of the ASCII file and are identified by a unique number and name. The Specific menu contains these options:
n

Create ASCII File (Ctrl+Shift+G) Starts the Create ASCII File Fields and Relations (tuxch0203m000) session. For most exports and imports, you can choose this option to let Baan generate the ASCII file fields. You might need to modify the file formats manually, however, if you are converting data or upgrading to a new release. Recalculate Start Positions Changes all the start positions in an ASCII file having variable-length fields. Choose FileNew to display the ASCII File Fields (tuxch0103s000) details session. Enter a new field number, giving it a logical sequence number. Enter the name and description of the ASCII file field you are creating.

Follow this procedure to define the ASCII file fields:


1 2 3

Exchange User Guide 2-10

Master Data

4 5 6

Select the field type. If you select Numeric, also enter the numeric formatting. Enter the start position and length of the fields. If you want to add more information, click the Text button on the toolbar to start the text editor.

Figure 7, ASCII File Fields

Figure 8, ASCII File Fields, New

Exchange User Guide 2-11

Master Data

ASCII File Fields (tuxch0103s000) Field Field Number Description Enter a field number for the ASCII file field. If a field separator is used, ASCII file fields are positioned according to this number. The field separator is defined in the Exchange Schemes (tuxch0101s000) session. What is important is not the actual field number, but the order of fields specified by the field number. Use numbers such as 10, 20, 30, which makes it easier to insert field numbers at a later stage. ASCII Field Enter the name of the ASCII file field. Baan automatically fills in this field if you use a data definition file of the ASCII file or BaanERP table. The ASCII file field is associated with the data found in a certain column in the physical ASCII file. These fields are mapped to BaanERP tables on the import and export file relation sessions. Enter a description of the conversion code. Indicate whether the data type of the ASCII field is alphanumeric, numeric, or multiline text. Enter the column number in an ASCII file where the ASCII file field starts. The start position declares the position of the data in the physical ASCII file. If no field separator is defined in the details session of the Exchange Schemes (tuxch0501m000) session, you must specify the start position. Length Specify the length of a variable-length ASCII file field as either numeric or alphanumeric. You do not need to specify the length of a fixed-length field. The length of an ASCII file field that represents a multiline text is zero. Numeric Format Date Format Define a date format for a numeric field in an ASCII file. If no date format is defined for an ASCII file field, the Default Date Format is used. Select to be able to place the decimal point at any position in the ASCII file field without the decimal actually being present. The number of digits after the decimal point must be specified in Number of Digits after Decimal. The number of digits after a floating decimal point defines where the decimal point is placed in a numeric field. This field is only activated if Floating Decimal is selected.

Description Field Type Field Dimensions Start Position

Floating Decimal

Number of Digits after Decimal

Exchange User Guide 2-12

Master Data

Batches (tuxch0104m000)
Use the Batches (tuxch0104m000) session to create the available batches for an exchange scheme. A batch is used to group operations on related tables and is identified by a unique code. An exchange scheme can contain one or more batches. The exchange process can run by batch, which means that the entire exchange scheme does not have to run at once. The Specific menu contains these options:
n

Table Relations (Import) (Ctrl+Shift+1) Starts the Table Relations (Import) (tuxch0521m000) session. Table Relations (Export) (Ctrl+Shift+2) Starts the Table Relations (Export) (tuxch0531m000) session. (De)activate Table Relations (Ctrl+Shift+G) Starts the (De)activate Table Relations (Import) (tuxch1221m000) session.

Follow this procedure to create a batch:


1 2

Define a unique code, sequence number, and description for the batch. Enter the company number that contains the data to be exported during an export procedure, or the company number to which the data must be written during an import procedure. If the exchange process is based on audit logs, select Exchange Based on Audit. If you want to add more information, click the Text button on the toolbar to start the text editor.

3 4

Figure 9, Batches

Exchange User Guide 2-13

Master Data

Batches (tuxch0104m000) Field Batch Sequence Number Description Company Description Enter a batch name. Enter a number to determine the order in which the batches are processed. Enter a description of the batch. Enter the company that receives or produces the tables affected by the transactions. The company number entered here must have the same package combination as the current company. Select if you want the physical ASCII file to be exported from the audit logs instead of from the Baan tables. Exporting from audit logs means that only updated data is exported. Exporting from the Baan tables means that all the data contained in those tables is exported. Indicates whether this batch includes text.

Based on Audit

Text

Conditions (tuxch0114m000)
Use the Conditions (tuxch0114m000) session to list the available conditions for an exchange scheme. Conditions are used to affect the import or export of data. Conditions are used in the generated scripts to guard an action (such as Add Record or Stop Condition), to supply a value for a table field during an import, or to supply a value for an ASCII field during an export. You write conditions in Baan 3GL code by using the Baan text editor. You only need to write the body of the function because the script generators add the function header and enclosing braces automatically. To learn more about the Baan 3GL code, see the Programmers Manual. When you use a condition as a guard action, Baan expects the return value to be a Boolean true or false. This type of condition is used at the table-relation level to control actions concerning the entire record and is used at the field level to control the concept of overwrite. There are five such conditions and all of them control aspects of the import process. Four of them are included in the Table Relations (Import) (tuxch0521m000) session and the fifth is included in the Field Relations (Import) (tuxch0522m000) session.

Exchange User Guide 2-14

Master Data

The Specific menu contains these options:


n

Check Syntax of Conditions (Ctrl+Shift+G) Performs a syntax check. If the condition script is written and the check is successfully completed, Script and Syntax OK are automatically selected. Parameters by Condition (Ctrl+F1) Starts the Parameters by Condition (tuxch0113m000) session.

Follow this procedure to create a condition:


1 2 3

Define a unique condition code, description, and condition type. Define the corresponding domain for conditions with the Enumerate and Set condition type. Click the Text button on the toolbar to write the condition script.

Predefined functions and variables are available in the Predefined Functions/Variables (tuxch0510s000) session. Set the conditions at table level in the Table Relations (Import) (tuxch0521m000) details session and the Table Relations (Export) (tuxch0531m000) session. Set the conditions on field level in the Table Relations (Import) (tuxch0521m000) details session and the Field Relations (Export) (tuxch0532m000) session.>>

Figure 10, Conditions

Exchange User Guide 2-15

Master Data

Conditions (tuxch0114m000) Field Condition Description Type Domain Script Description Enter the name of the condition. Enter a description of the condition. Choose the datatype of this condition. Enter the domain that corresponds to this condition. Indicates whether a script is present. You can add a script by choosing EditText or by clicking the T button on the toolbar. Indicates whether the syntax of the condition script has been checked. To select the syntax check, choose Special Check Syntax.

Syntax OK

Exchange User Guide 2-16

Master Data

Parameters by Condition (tuxch0113m000)


Run the Parameters by Condition (tuxch0113m000) session to list the parameters used in a condition script of an exchange scheme. The ASCII file fields of a record to be imported or exported are not automatically defined in a condition script. To use the value of an ASCII file field you must use that field as a parameter in the condition script. The parameter name must be the same as the ASCII file field name in the record to which it refers. Follow this procedure to create a parameter:
1 2

Define a unique parameter name. Select a parameter type.

Figure 11, Parameters by Condition

Parameters by Condition (tuxch0113m000) Field Parameter Parameter Type Description Enter the name of the parameter. The parameter name must be the same as an ASCII field name. Enter either numeric or alphanumeric for the parameter type.

Exchange User Guide 2-17

Master Data

Exchange User Guide 2-18

Import module

Introduction
To exchange data between two Baan companies, you export the Baan data to ASCII files, and then import the data into the Baan database. Exchange can use the same master data information for import that it uses for export, because the ASCII file format must be the same. If data must be modified during an import, you can use a conversion. The Exchange module includes three options: condition scripts, conversion tables, and constant values. You can include a formula with the script to calculate new values based on the contents of the ASCII file or data from other Baan tables.

Regular and non-regular data exchange


You can import and export data in Baan on either a regular or a non-regular basis. A regular data exchange refers to a run that is scheduled on a regular basis. A non-regular data exchange is one that you run on demand, on an as-needed basis. The results of both types are the same, but they are used differently, depending on the situation and your business needs. These are the sessions that you use for regular or non-regular data exchange:
n n n n

Import Data (on a Regular Basis) (tuxch0224m000) Import Data (Non-Regular) (tuxch0223m000) Export Data (on a Regular Basis) (tuxch0234m000) Export Data (Non-Regular) (tuxch0233m000)

Non-regular data exchange is useful when critical data has changed that needs to be updated, or when not all of the data has changed and you want to update only the changed data. Non-regular data exchange is also used when you want to test an exchange scheme before approving it for regular data exchange. For a nonregular data exchange, you can select a range of batches or a range of batch sequence numbers to import. The data exchange is restricted to these ranges.

Exchange User Guide 3-1

Import module

Regular data exchange is used when you want to maintain several sites whose data changes periodically. Regular data exchange is also useful in multisite situations where it is critical that no run is lost, overwritten, imported twice, or imported in the incorrect order. Only complete exchange schemes can be imported and exported in a regular run, which ensures that no part is missed. Regular data exchange uses the run number. The run number is unique and consecutive for a combination of exchange scheme and exchange type and is based on the contents of the log table. Each redo is stored under a new try number, which is unique within a run number, exchange scheme, and exchange type combination. Regular and non-regular data exchange differ in where they place the physical ASCII files. A non-regular data exchange places the data in the sequential file directory, named at the exchange scheme level, in a file named in the Table Relations (tuxch0531m000) session. A regular data exchange builds an extra directory for each run of an export in order to retain a history of all exported files.

To use the Data Access Layer


During an Exchange import, you can use all the functionality programmed into the Data Access Layer (DAL). If you use the DAL, Exchange carries out all the constraint checks, integrity checks and side effects, such as updates on other tables, that are programmed into the DAL. Database integrity is guaranteed automatically. Using the DAL reduces the costs of interface development. You can use the DAL to import standard interfaces developed by Baan for partner products, as well as for specific interfaces built by customers, for example, to integrate BaanERP with legacy systems. You can use the DAL in both single site and multisite environments. The checks or additional actions specified in the DAL are carried out for each row that is imported. Database errors are logged in the same way for DAL and non DAL import. DAL hook errors are also logged. You can specify whether the DAL property checks are or are not carried out. When you specify use of the DAL for a table relation for an import, the dal.new, dal.update and dal.destroy functions are used instead of db.insert, db.update and db.delete. You can choose to use DAL for certain tables and not for other tables, so an import batch can contain both types of table relations simultaneously. The import through DAL works for both the import based on audit or indicators (inserts, updates, deletes), and the full import (inserts only).

Exchange User Guide 3-2

Import module

DAL settings are run time aspects, which means you can change them without having to regenerate the import program. DAL settings are also logged in the log table at batch line level, to enable you to find out what the DAL settings were when the import was run. It is important to realize that an update through the DAL can result in a number of side effects. Actions done by the DAL should not be twice. For example, if the DAL updates the available to promise (ATP) quantity for an item when importing order data, the ATP quantity should not be updated in a condition script as well. You should therefore not add any actions in condition scripts, or import additional data, that are already handled in the DAL.

Start and end date and time


For regular data exchange, the start date and time are taken from the log table and normally you cannot specify it. If the start date and time are the same for all selected exchange schemes, they are displayed. The first time an exchange scheme is exported using audit files is the only time you can fill in the start date and time yourself. For non-regular data exchange, you can specify whether the start date and time is based on the contents of the log table. This is useful when not all selected exchange schemes have the same latest end date and time. You can fill in the end date and time for both regular and non-regular data exchange.

During the data exchange


When you have completed the data exchange session and choose Import Data or Export Data, a status window appears and displays the progress of the data exchange. For each batch line that completes, Baan displays the exchange scheme, the batch, and the batch line. The numbers of records read, processed, rejected due to error, and rejected due to conditions are also displayed. To view the imported or exported data, use the Display Log Tables (Batch line level) (tuxch0509m000) session. This session shows the number of records processed from the ASCII file, the number of records imported successfully and the number of records rejected due to an error or a condition.

Exchange User Guide 3-3

Import module

If records are rejected due to validation checks or errors, BaanERP writes them to a log file. You can redo the data exchange for those rejected records only. You can use the Print Log File (tuxch0215m000) session to print the rejected records stored in the log file. BaanERP verifies the imported values according to the referential integrity and validation rules, such as field type, length, range, and format. This information is available in the data dictionary.

How to set up an import process


To import data, you start by setting up an exchange scheme as described in Chapter 2, Master Data. Then you go on by defining the details of the tables to be imported. You begin by creating the relationship at the table level between the BaanERP tables and the ASCII files by using the Table Relations (Import) (tuxch0521m000) session. You then create the relationship at the field level, by setting up the relations between logical ASCII file fields and BaanERP table fields. You do this using the Field Relations (Import) (tuxch0522m000) session. Often data needs to be converted from one system before it can be used by the other. If this is true, you can set up the conversions using the Conversion Tables (tuxch0105m000) and Conversions per Field (tuxch0106m000) sessions. After you have defined the table relations, field relations, and conversions, you need to compile an object that Exchange can use to run the import. You do this by using the Create Import Programs (tuxch0227m000) session. You then test your import using the Import Data (Non-Regular) (tuxch0223m000) session. When you are satisfied that everything is working, you can set up imports to run as often as your business requires, using the Import Data (on a Regular Basis) (tuxch0224m000) session. Following are the sessions included in the Import module:
n n n n n n n

Table Relations (Import) (tuxch0521m000) Field relations (import) (tuxch0522m000) Conversion Tables (tuxch0105m000) Conversions per Field (tuxch0105m000) Create Import Program (tuxch0105m000) Import Data (on a Regular Basis) (tuxch0224m000) Import Data (Non-Regular) (tuxch0223m000)

Exchange User Guide 3-4

Import module

The Import module sessions


Table Relations (Import) (tuxch0521m000)
Run the Table Relations (Import) (tuxch0521m000) session to create a relation between BaanERP tables, logical ASCII files, and physical ASCII files per batch in an exchange scheme. In the table relation, you define the logical ASCII files to which the data from the BaanERP table must be transferred, and you assign a name to the physical ASCII file. You can also run an external program or a BaanERP session as part of an exchange scheme, instead of using the exchange import functionality for a table relation. The relations at field level are created in the Field Relations (Import) (tuxch0522m000) session. The Specific menu contains these options:
n

Field Relations (Import) (Ctrl+Shift+1) Starts the Field Relations (Import) (tuxch0522m000) session. (De)activate Table Relations (Ctrl+Shift+G) Starts the (De)activate Table Relations (tuxch1221m000) session.

Follow this procedure to create a table relation:


1 2 3 4 5 6

Enter the sequence number, BaanERP table, logical ASCII file, and the physical ASCII file name. Select Active to make the relation active and define an execute condition. Under Permitted Operations, specify the actions that are allowed for this table relation, and the appropriate conditions. Select Stop Condition to activate the stop mechanism and define the appropriate stop condition. If you want to use the functionality programmed into the Data Access Layer (DAL), select Import via Data Access Layer. If you want to use an external program, select External Program and enter the program name in the following field. If you want to run a BaanERP session, clear External Program and enter a session or object code in the following field. If one of the ASCII file fields is based on increment, enter the number of the index.

Exchange User Guide 3-5

Import module

If you want to add more information, click the Text button on the toolbar to start the text editor.

Figure 13, Table Relations (Import), Display

Figure 14, Table Relations (Import), New screen,General tab

Exchange User Guide 3-6

Import module

Figure 15, Table Relations (Import), New screen, Specific tab

Table Relations (Import) (tuxch0121s000) Field Table Relation (Import) Description Enter the the number that represents the table relation in the batch during an exchange process. The table relation shows the correspondence between a database table and an ASCII file. Enter a number to determine the process sequence order of the table relation in the batch during an exchange process. The sequence number does not have to be unique in a table relation. If two table relations with an identical sequence number are used in a batch, the relation with the lower table relation number is processed first. Enter the table that contains data from the ASCII file to be read during an import procedure. One batch line can only read one Ban table. If you need to use the same Baan table to create more than one physical file, you can use multiple batch lines. The different batch lines may or may not use the same ASCII file layout. Use multiple table relations to write data from more than one physical ASCII file to one BaanERP table. The BaanERP table name is defined by the package code, a module code, and a table number, for example, tiitm001.

Sequence Number

Baan table

Exchange User Guide 3-7

Import module

ASCII file

Enter the name of the ASCII file that contains data to be transferred to a BaanERP table during an import procedure. To create the field relations of the table relation automatically, the ASCII file name must be the same as the BaanERP table name. You can do this if you do not have a data definition file of the ASCII file. The ASCII file name represents the logical ASCII file. You can create the ASCII file name in the ASCII Files (tuxch0102m000) session.

ASCII File Name

Enter the name of the physical ASCII file where the data is to be written. The maximum length of the file name is 11 characters. The file name entered here is an extension of the default path. The default path is defined in the Path for ASCII Files field under Paths on the General tab in the Exchange Schemes (tuxch0101s000) session. If this is an absolute path, the default path is not used. If this is not an absolute path, the file is stored in the directory for sequential files as defined in the exchange scheme header record.

Active

Select the Active field to make the table relation active so that it can be used for data processing in an import process. If this option is clear, the table relations are kept for reference purposes but are not used during the import process. You can also use it as a debugging tool by turning off all table relations except one to test a new change. Select if you want to test the exchange scheme, a single table relation, or only a few table relations.

Execute Condition Use to check whether the table relation must be carried out when you run the import process. If the Active field is selected, Baan checks the execute condition before running the table relation. If the execute condition returns true, the table relation is carried out. The execute condition is carried out before the table relation is started but after the previous table relations are finished. If the import is based on audit or indicators, the execute condition is carried out at the start of a batch. If Active is selected but no execute condition is specified, the table relation is always executed when the batch is run. You can generate a new condition or edit the specified condition. If you generate a new execute condition, the condition code is the ASCII file name with the extension .exe. The execute condition must be of Boolean type.

Exchange User Guide 3-8

Import module

Permitted Operations Add Condition Select to import all inserts for which a record does not yet exist in the database. If you specify an add condition, Exchange only processes the records that meet the add condition. If you do not specify an add condition, Exchange processes all inserts. Clear if you do not want Exchange to import inserts. This causes Exchange to skip any record to be inserted. For a full import, inserts consist of all records. For import based on audit or based on indicators, inserts are records having indicator i. Overwrite Condition Select to import all inserts for which a record does not yet exist in the database. If you specify an overwrite condition, Exchange only overwrites existing records if the records to be imported meet the overwrite condition. If you do not specify an overwrite condition, Exchange overwrites all existing records. Clear if you do not want Exchange to import inserts. This causes Exchange to skip any record to be inserted. For a full import, inserts consist of all records. For import based on audit or based on indicators, inserts are records having indicator i. Update Condition Select to import all updates (records having indicator u). If no update condition is specified, all updates are processed. If an update condition is specified, only the records that meet the update condition are processed. Clear if you do not want Exchange to import updates. This causes Exchange to skip any record to be updated. This field is only relevant when your exchange is based on audit or on indicators. Delete Condition Select to import all deletes (records having indicator d). If you specify a delete condition, Exchange processes only the records that meet the delete condition. If you do not specify a delete condition, Exchange processes all deletes. Clear if you do not want Exchange to import deletes. This causes Exchange to skip any record to be deleted. This field is only relevant when your exchange is based on indicators or on audit. Stop Mechanism Select if you want the import process to stop when the return value of the stop condition is true.

Exchange User Guide 3-9

Import module

Stop Condition

Enter a stop condition. A stop condition causes the exchange process to stop if the return value of the stop condition is true. If the return value is false, the import process continues with the next batch line. The stop condition is carried out at the end of each table relation. You can automatically generate a stop condition, in which case the stop condition code is the same as the ASCII file code with the .stp extension. This condition is of the Boolean type.

Specific tab Data Access Layer Import via Data Access Layer Select to use the Data Access Layer (DAL) for the current table. By using the DAL, an import carries out all the constraint checks, integrity checks and side effects, such as updates on other tables, that are programmed into the DAL. This guarantees database integrity, saves programming time, and avoids the errors that can occur in condition scripts. Select to use the Data Access Layer (DAL) property checks. Using property checks is safer, but you can turn them off to boost performance. Select to use an external program and enter its name in the next field. Clear to run a BaanERP session, and enter a session or object code in the following field. Enter the name of the external program to be used, or enter a session or object code to run a BaanERP session. Enter the number of the index on which you want to sort. Indicates whether this table relation includes text.

DAL property checks

User Defined Program External Program

Program Name Sort on Index Text

Field relations (import) (tuxch0522m000)


After you have defined the table relations using the Table Relations (Import) (tuxch0521m000) session, you define the field relations. Use the Field Relations (Import) (tuxch0522m000) session to set up the relations between logical ASCII file fields and BaanERP table fields per batch in an exchange scheme. Use the details session to specify the data to be passed to the physical ASCII files. When you import data using Exchange, we recommend that you enter a record in this session to represent all the fields in the table.

Exchange User Guide 3-10

Import module

Baan fills in the value in the ASCII field automatically, using the logic from the Baan Field, Condition, and Context fields. The Specific menu contains this option:
n

Create Default Import Field Relations (Ctrl+Shift+G) Creates the field relations automatically. Make sure that the code of the ASCII file is identical to the BaanERP table code. Use this option if the definition file of the ASCII file is not available. Choose FileNew to display the Field Relations (Import) (tuxch0122s000) details session. Enter a serial number, giving it a logical sequence number. Enter the name of the field for which you are creating field relations. If the field is defined as an array in the data dictionary, enter the array element number. Define the field value, condition script name, and constant, if this field is using them. If you want to add more information, click the Text button on the toolbar to start the text editor.

Follow this procedure to create field relations:


1 2 3

4 5

Figure 16, Field Relations (Import), Display

Exchange User Guide 3-11

Import module

Figure 17, Field Relations (Import), New screen, General tab

Figure 18, Field Relations (Import), New screen, Text/Conditions tab

Exchange User Guide 3-12

Import module

Field Relations (Import) (tuxch0122s000) Field Serial number Description Enter a serial number to make the field relation unique in the table relation. The serial number is only used as an identifier and does not have to be sequential. It is best to use intervals of 10 so that you can insert a new record between existing records if that is where it logically belongs. Enter the name of the field to be updated in the Baan table. During import, Baan fills in the values of this field with data from a field in an ASCII file, based on the rules you define in the Based On field. Enter the element number of an array field if the table field named in Baan Field is defined as an array in the data dictionary. The elements in an array can be filled individually. The element number cannot exceed the array depth. Select to modify data in a field relation before the data of an ASCII file field is transferred to the BaanERP table field. In the next field, enter the ASCII file field to be modified. If you have selected Field value, enter the conversion table for the ASCII file field. Fill in the conversion parameters in the Conversion Tables (tuxch0105m000) session. Enter the name of the condition you are using, if any. You use a condition either if the data to be imported resides in a table other than the table defined at the Table Relation level, or if the data does not exist in any Baan table. You can use a condition to access the different table or table fields necessary to calculate the value that must be imported. The conditions are created in the Conditions (tuxch0114m000) session. Conversion If you have selected Condition, enter a conversion table here. Use a conversion code to modify data in a field relation before the return value of a condition is transferred to the BaanERP table field. You can create conversion tables in the Conversion Tables (tuxch0105m000) session.

Baan Field

Array Element

Based on Field value

Conversion

Condition

Exchange User Guide 3-13

Import module

Constant

Select to load a constant value into a BaanERP table field. In the Conversion field that follows, enter the conversion table that modifies the data in a field relation before the constant value is transferred to the BaanERP table field. When the Based On field is Increment, the value in this field is added to the start value when the higher fields of the primary index remain constant.

Conversion

If you have selected Constant, use this field to enter the name of the conversion table that modifies the field relation data before the constant value is transferred to the BaanERP table field. Conversion tables are created in the Conversion Tables (tuxch0105m000) session.

Increment

Select to base the import on increment. The Baan field is incremented with the value in the Constant field. Increment can only be used for numeric fields that are part of the primary index. Enter the initial value of the series for the Baan field. You can only maintain this field if the Based On field is Increment. During processing, whenever one of the higher fields of the primary index changes, the Baan field is filled with the Start Value. Select to transfer the default value as defined in the data dictionary to the Baan Table field. Indicates whether this field relation includes text.

Start Value

Increment Value Default Text Text Settings Text Number Append Text Text Language Text Language Field Permitted Operations Overwrite Field Select to overwrite the field based on the condition defined in the following field. When an existing record is inserted, if no condition is specified or if the return condition returns true, the field is overwritten. If the Overwrite Field is selected, enter a condition here. When an existing record is inserted, if the return value of the overwrite condition is true, the value of the field is overwritten.

Text/Conditions tab

Condition

Exchange User Guide 3-14

Import module

You can automatically generate a condition if you click Create/Edit. The condition for overwriting code contains the ASCII file code with the .ovr extension. The condition must be of the Boolean type. Preconditions for the overwrite condition are: Update Field The type of action is Insert. All ASCII fields are filled. The record already exists. BaanERP table fields are filled with this record.

Select to update a record when the return value of the update condition is true. Enter the update condition in the following field. If Update Field is selected, enter a condition code. The field is updated when the return value of the update condition is true. During an import based on indicators or an import based on audit, records that must be updated start with the letter u. You can automatically generate a condition if you click Create/Edit. In that case, the condition for overwriting code contains the ASCII file code with the .upd extension. This condition is of the Boolean type. Preconditions for the update condition are: The type of action is update (old values). ASCII file fields are filled: primary key fields of the source table on the export site and values that are changed. The record that must be updated exists. BaanERP table fields are filled with an existing record.

Condition

Exchange User Guide 3-15

Import module

Conversion Tables (tuxch0105m000)


Data from other systems does not always match the data on the local Baan system. For example, the local Baan system can refer to the English language with the code EN, while other systems use the code ENG or GB or US. Before you use Exchange to load data into Baan, the data on the two systems must be synchronized. You can use the Conversion Tables (tuxch0105m000) session to store the relationships between the old and new values of fields of data. By using these relationships when importing data, Baan converts the old to new before writing the rows. The code you set up here can be used in the following sessions:
n n n

Field Relations (Import) (tuxch0122s000) Field Relations (Export) (tuxch0132s000) Conversions per Field (tuxch0106m000) Choose FileNew to create a conversion relation. Enter its name and description. To change a conversion relation, double-click the existing conversion relation. Choose the FilePrint to print the conversion relations.

Follow this procedure to set up conversion tables:


1 2 3

Figure 19, Conversion Tables

Exchange User Guide 3-16

Import module

Conversion Tables (tuxch0105m000) Field Relation Description Enter the relation name. All the relations for one exchange scheme are stored together in this table. In order for Baan to know which rules to use for a particular field, give the same relation name to all translation rules that are logically grouped together. Enter a description of the conversion table. Enter the source system value. Enter the Baan value.

Description Old Value New Value

Conversions per Field (tuxch0105m000)


After you have defined a conversion code by using the Conversion Tables (tuxch0105m000) session, you assign the conversion code to a BaanERP table and field. You do this using the Conversions per Field (tuxch0106m000) session. The Specific menu contains this option:
n

Load Conversions per Field Conversions per Field (tuxch0106m000) session, which you can use to convert data in BaanERP table fields according to a conversion table. Choose FileNew to create a new conversion for a BaanERP table. Enter the exchange scheme for which you want to create conversions. Enter the names of the Baan table, field, and conversion relation.

Follow this procedure to create a conversion:


1 2 3

Exchange User Guide 3-17

Import module

To change an existing conversion, double-click on an existing conversion for a BaanERP table field.

Figure 20, Conversions per Field

Conversions per Field (tuxch0106m000) Field Baan Table Description Enter the name of the table whose contents are to be converted. This overrides the rule in the Field Relations (Import) (tuxch0522m000) session. Enter the field whose contents are to be converted. This overrides the rule in the Field Relations (Import) (tuxch0522m000) session. Enter the field to be used during data exchange.

Baan Field

Conversion

Exchange User Guide 3-18

Import module

Create Import Program (tuxch0227m000)


To be able to use an exchange scheme, you must pull together all the data in the sessions you have just filled, put the data into one program script, and compile the program script into a runable object. The Create Import Programs (tuxch0227m000) session does all of that for import scripts. You can print the actual data contained in the ASCII file to be imported by using the Print ASCII File (tuxch0202m000) session. This enables you to see, for example, that separators are correct and whether any data needs to be converted. Follow this procedure to create an import program.
1 2

Enter the range of exchange schemes and batches for which you want to create import programs. Specify the compile options.

Figure 21, Create Import Programs

Exchange User Guide 3-19

Import module

Create Import Programs (tuxch0227m000) Field Selection Range Exchange Scheme Batch Compile Options Compile in Debug Mode Compile with Profiler Display Errors Select to go through a condtion script step by step. Select to compile with the profiler. After the import has run, the Profiler generates a report that provides information about the performance time required for each function. Select to get a detailed list of errors showing the exact problem with each line of code. Enter the exchange scheme to be compiled. Enter the batch number of the exchange scheme. Description

Exchange User Guide 3-20

Import module

Import Data (on a Regular Basis) (tuxch0224m000)


Use the Import Data (on a Regular Basis) (tuxch0224m000) session to run the import program to transfer data on a regular basis from sequential ASCII files to BaanERP tables. The import can also run as part of a batch job. Follow this procedure to run the import program:
1 2 3 4 5 6 7

Select a range of exchange schemes. Select the processing type. Select the Overrule Batch Company check box if the data is imported from a company other than the batch company. Enter another company if the current company is overruled. Define the details of the import procedure in the Processing Details group box. Click Import Data to start the import procedure. Click Log Table to view the contents of the log table. A log table gives an overview of the results of the import procedure.

Figure 22, Import Data (on a Regular Basis)

Exchange User Guide 3-21

Import module

Import Data (on a Regular Basis) (tuxch0224m000) Field Selection Range Exchange Scheme Processing Type Enter the name of the exchange scheme. Description

Processing Settings Choose the type of run for this data exchange:
n n

New run Restart previous run This option allows you to import data by using the last run number over again. This field is usually used in the Import Data (on a Regular Basis) (tuxch0224m000) session where each run number provides different data sets. The log files are the only thing that is affected in this session, because the data to be loaded into Baan is the same for both the last run number used and the first free run number. Reprocess rejected records When records are rejected during an import process, Baan creates two additional files to hold the rejected records. Records that are rejected due to index or domain errors (database problems) are placed in the Rejected due to Error file and records that are rejected due to a condition returning a false status are placed in the Rejected due to Condition file. Baan places these files in the same directory as the data file that was read in and appends the suffixes .e01 or .c01 to them. If more records are rejected during reprocessing, Baan creates new files with the next sequential number. When you choose this option, you can use the next two fields to choose which records to reprocess. Continue interrupted run If an exchange scheme run stops in the middle of the run, you can restart the import. You can only do this if there is more than one batch line and the restart can begin at the start of the batch line that was not completed. If there is only one batch line, this option is the same as a complete restart of the import.

Reprocess rejected due to errors Reprocess rejected due to Conditions

This field is only activated if you chose Reprocess Rejected Records in Processing Type. This field is only activated if you chose Reprocess Rejected Records in Processing Type.

Exchange User Guide 3-22

Import module

Overrule Batch Company Company

Enter Yes to override the value in the Company field in The Batches (tuxch0104m000) session. Enter the company to be used during this session instead of the batch company. This field can only be defined if Overrule Batch Company is selected. Select to quit when the return value of a stop condition is true. Clear if you want the import to continue running and write a message to the log file. The stop condition is defined in the Table Relations (Import) (tuxch0121s000) session. Select to cause messages to remain on screen until you press Enter. Clear if you want the import program to continue without any interaction from you. This option can be used for an import that runs throughout the night. Select if you want the import to complete without checking for other import batches. This option can be used to test or run the import without using data that is waiting to be imported at the export site. This is useful when testing an import in a multisite environment. If you clear this and an active exchange link exists for a batch, that batch will only run if there is data waiting to be imported. For example, if there is no batch to import. This field is only relevant when you are using multisite control, and the batch is used in one or more exchange links.

Processing Details Really Quit on Stop Condition

Wait for <CR> with Messages

Ignore Batches to Import

Uncompress ASCII Files

Select when you want to restore compressed ASCII files to their original format before the import procedure. Only use this option if the ASCII files that will be imported were compressed using the BaanERP compression program.

Exchange User Guide 3-23

Import module

Import Data (Non-Regular) (tuxch0223m000)


Use the Import Data (Non-Regular) (tuxch0223m000) session to run the import program to transfer data on a non-regular basis from sequential ASCII files to BaanERP tables. This session can be used to test exchange schemes that will be run on a regular basis, to make sure that the import procedure functions properly. The details of an exchange scheme are defined in the master data and import business objects. Follow this procedure to run the import program:
1 2 3 4 5 6 7 8

Select a range of exchange schemes, batches, and/or batch sequence numbers. Select the processing type. Enter the start and end time of the audit range if the import is based on audit. Select the Overrule Batch Company check box if the data is imported from a company other than the current company. Enter another company if the current company is overruled. Select the Wait for <CR> with Messages check box if the import program must stop after a message. Click Import Data to start the import procedure. Click Log Table to view the contents of the log table. A log table gives an overview of the results of the import procedure.

Figure 23, Import Data (Non-Regular)

Exchange User Guide 3-24

Import module

Import Data (Non-Regular) (tuxch0223m000) Field Selection Range Exchange Scheme Batch Batch Sequence Number Processing Type Enter the exchange scheme. Enter the batch in the exchange scheme. Enter the batch sequence number. Description

Processing Settings Choose the type of run for this data exchange:
n n

New run Restart previous run This option allows you to import data using the last run number over again. This field is usually used in the Import Data (on a Regular Basis) (tuxch0224m000) session, where each run number provides different data sets. Only the log files are affected in this session, because the data to be loaded into Baan is the same for both the last run number used and the first free run number. Reprocess rejected records When records are rejected during an import process, Baan creates two additional files to hold the rejected records. Records that are rejected due to index or domain errors (database problems) are placed in the Rejected due to Error file and records that are rejected due to a condition returning a false status are placed in the Rejected due to Condition file. Baan places these files in the same directory as the data file that was read in and appends the suffixes .e01 or .c01 to them. If more records are rejected during reprocessing, Baan creates new files with the next sequential number. If you choose this option, you can use the next two fields to choose which records to reprocess. Continue interrupted run If an exchange scheme run stops in the middle of the run, you can restart the import if there is more than one batch line and the restart can begin at the start of the batch line that was not completed. If there is only one batch line, this option is the same as a complete restart of the import.

Overrule Batch Company Company

Enter Yes to override the value in the Company field in the Batches (tuxch0104m000) session. Enter the company to be used in the Company field in this session.

Exchange User Guide 3-25

Import module

Processing Details Really Quit on Stop Condition Wait for <CR> with Messages Select to quit on a stop condition, or clear if you want the import to continue running and only return an error message if it meets the stop condition. Select to have messages remain on screen until you press Enter.

Exchange User Guide 3-26

Export module

Sometimes you need to export data from Baan to another application, for example, when:
n n n

Data must be shown in a specific way such as in a spreadsheet. Text is to be maintained by using a word processor. The data and procedures in a company are handled partly by Baan.

The result of the export process is an ASCII file, which other applications, including other Baan environments, can read. To exchange data between two Baan companies, you export the Baan data to ASCII files, and then import the data into the Baan database. Exchange can use the same master data information for import that it uses for export, because the ASCII file format should be the same.

To set up an export process


To export data, you start by setting up an exchange scheme as described in Chapter 2, Master Data. Then you go on to define the details of the tables to be exported. You begin by creating the relationship at the table level between the BaanERP tables and the ASCII files by using the Table Relations (Export) (tuxch0531m000) session in the Export module. You then create the relationship at the field level, by setting up the relations between logical ASCII file fields and BaanERP table fields. You do this using the Field Relations (Export) (tuxch0532m000) session. If you want to control which records are exported, you can use operators to create range limitation expressions. You do this by using the Ranges (tuxch0112m000) session. After you have defined the table relations, field relations, and conversions, you need to compile an object that Exchange can use to run the export. You do this by using the Create Export Programs (tuxch0228m000) session. You then test your export by using the Export Data (Non-Regular) (tuxch0233m000) session. When you are satisfied that everything is working, you can set up exports to run as often as your business requires, using the Export Data (on a Regular Basis) (tuxch0234m000) session.

Exchange User Guide 4-1

Export module

Following are the sessions included in the Export module:


n n n n n n

Table Relations (Export) (tuxch0531m000) Field Relations (Export) (tuxch0531m000) Ranges (tuxch0112m000) Create Export Programs (tuxch0228m000) Export Data (on a Regular Basis) (tuxch0234m000) Export Data (Non-Regular) (tuxch0233m000)

BAAN

Application BAAN Data XCH export ASCII file

Figure 24, The export process

The Export module sessions


Table Relations (Export) (tuxch0531m000)
Open the Table Relations (Export) (tuxch0531m000) session. Check that the exchange scheme and batch are correct. When you have finished with the Table Relations (Export) session, you can zoom from the Choice field to the next step in creating an exchange scheme, the field relations. The Specific menu contains these options:
n

Field Relations (Export) (Ctrl+Shift+1) Starts the Field Relations (Export) (tuxch0532m000) session. (De)activate Table Relations (Ctrl+Shift+G) Starts the (De)activate Table Relations (tuxch1221m000) session.

Exchange User Guide 4-2

Export module

Follow this procedure to create a table relation:


1 2 3 4 5 6

Choose FileNew to display the Table Relations (Export) (tuxch0131s000) details session. Enter a number in the logical sequence for the table relation. Enter the table from the ASCII file and the name of the ASCII file to be used during an export. Enter the physical ASCII file to be written. Enter the other parameters that define this table relation. If you want to add more information, click the Text button on the toolbar to start the text editor.

Figure 25, Table Relations (Export)

Exchange User Guide 4-3

Export module

Figure 26, Table Relations (Export), New

Table Relations (Export) (tuxch0131s000) Field Table Relation (Export) Description Enter the number that represents the table relation in the batch during an exchange process. The table relation shows the correspondence between a database table and an ASCII file. Enter the table that contains data from the ASCII file to be read during an export procedure. One batch line can only read one Baan table. If you need to use the same Baan table to create more than one physical file, you can use multiple batch lines. The different batch lines may or may not use the same ASCII file layout. Use multiple table relations to write data from more than one physical ASCII file to one BaanERP table. The BaanERP table name is defined by the package code, a module code, and a table number, for example, tiitm001. ASCII File Enter the name of the ASCII file that contains data to be transferred to a BaanERP table during an export procedure. To create the field relations of the table relation automatically, the ASCII file name must be the same as the BaanERP table name. You can do this if you do not have a data definition file of the ASCII file. The ASCII file name represents the logical ASCII file. You can create the ASCII file name in the ASCII Files (tuxch0102m000) session.

Baan Table

Exchange User Guide 4-4

Export module

ASCII File Name

Enter the name of the physical ASCII file where the data is to be written. The maximum length of the file name is eleven characters. The file name entered here is an extension of the default path. The default path is defined in the Path for ASCII Files field under Paths on the General tab in the Exchange Schemes (tuxch0101s000) session. If this is an absolute path, the default path is not used. If this is not an absolute path, the file is stored in the directory for sequential files as defined in the exchange scheme header record.

Active

Select to activate the table relation so that it can be used for data processing in an export process. If this option is cleared, the table relations are kept for reference purposes but are not used during the export process. You can also use it as a debugging tool by turning off all table relations except one to test a new change. Select if you want to test the exchange scheme, a single table relation, or only a few table relations.

Use bdbpre

Select to ignore the layout of the ASCII file and let the standard bdbpre program create the ASCII file. The range, sort index, and ASCII file fields are not considered. Clear to create the sequential ASCII file using the ASCII file fields that are created in the ASCII File Fields (tuxch0103s000) session. This option is not applicable for an exchange based on audit. If you change this field, you must generate the exchange program again.

Condition

Enter a condition code. The condition must be of the Boolean type. The export of data depends on the return value of this condition. If the return value of the condition is true, the data of the BaanERP table is written to the ASCII file. If the return value of the condition is false, the data of the BaanERP table is not written, that is, the export is not done. Conditions are also used during an exchange based on audit.

Range Active

Select if you want Baan to process the table relation by using the limitations defined in the Ranges (tuxch0112m000) session. Clear if you do not want Baan to use the limitations defined in the Ranges (tuxch0112m000) session. The range is not active if the export is part of an audit procedure or if Use bdbpre is selected.

Exchange User Guide 4-5

Export module

Sort Index

If you want to export the data using any of the indexes from the table listed in the Baan table field, enter the index number of the ASCII file that will contain data from the BaanERP table. If the table is read, this index is used and the ASCII file is sorted according to this index. Indicates whether this table relation includes text.

Table Relations Text

Field Relations (Export) (tuxch0531m000)


After you have defined the table relations by using the Table Relations (Export) (tuxch0531m000) session, you define the field relations. Use the Field Relations (Export) (tuxch0532m000) session to list the available relations between logical ASCII files fields and BaanERP table fields per batch in an exchange scheme. Use the details session to specify which data must be passed to the physical ASCII files. The Specific menu contains these options:
n

Create Default Field Relations (Ctrl+Shift+1) Creates the field relations automatically. Make sure that the code of the BaanERP table is the same as the code of the ASCII file table. Use this option if the definition file of the BaanERP table is not available.

Follow this procedure to create a field relation:

Figure 27, Field Relations (Export)

Exchange User Guide 4-6

Export module

Figure 28, Field Relations (Export), New

Exchange User Guide 4-7

Export module

Field Relations (Export) (tuxch0132s000) Field Serial Number Description Enter a serial number to make the field relation unique in the table relation. The serial number is only used as an identifier and need not be sequential. It is best to use intervals of ten so you can insert a new record between existing records if that is where it logically belongs. Enter the code of the ASCII file field to contain the data transferred from a field in the BaanERP table during an export procedure. The ASCII file code represents the logical ASCII file. It is created in the ASCII Files (tuxch0102m000) session. Based on Baan Field Select and enter the name of a Baan field on which the data transfer is based. This value is passed to the physical ASCII file in the position designated by the ASCII Field. Enter the element number of an array field if the table field named in Baan Field is defined as an array in the data dictionary. The elements in an array can be filled individually. The element number cannot exceed the array depth. Enter the name of the condition you are using, if any. You use a condition either if the data to be exported resides in a table other than the table defined at the Table Relation level, or if the data does not exist in any Baan table. You can use a condition to access the different table or table fields necessary to calculate the value that must be exported. The conditions are created in the Conditions (tuxch0114m000) session. Constant Select to import a constant value into a BaanERP table field or to export a constant to an ASCII file field. Use this field to pad the file with additional data if the receiving system requires additional data fields.

ASCII Field

Array Element

Condition

Exchange User Guide 4-8

Export module

Ranges (tuxch0112m000)
Normally even if the entire table is not needed, all the data is exported anyway and only the desired records are read in during import. This control is achieved by writing conditions that are used at the table relation (import) level. Baan also provides a tool to limit which records are exported to begin with. The Ranges (tuxch0112m000) session allows you to use relational and logical operators to create range-limitation logic expressions that control the export process. Only active records that match the condition are exported. This enables you to transfer a smaller file between systems. The drawback is that the filter cannot be as complex, because the range limitation logic is not as powerful as conditions. To activate this session, select the Range Active field in the Table Relations (Export) (tuxch0531m000) session. The following are the data type restrictions per data type of the BaanERP table field: Date data type
n n n

The Entered Date field must be of the default date format. The plus or minus signs can be used to change the current date. For example, +2 adds two days to the current date. The number sign (#) can be used for the current date.

String/multibyte data type


n

The domain of the BaanERP table field determines if a field is justified to the left, right, or center, or converted to uppercase or lowercase.

Numeric data type


n

Only numeric values can be entered

For the operators in or not in, the value must be entered as follows:
n n

The set of values must be placed between parentheses. For string data type, each item in the set of values must be placed between double quotation marks.

EXAMPLE:

For a numeric field (1,2,5,7). For a string or multibyte string, double quotes must be added: ("a","b").

Exchange User Guide 4-9

Export module

Follow this procedure to create a range:


1 2 3 4

Enter a serial number in the logical sequence order. Enter the rule that specifies the range of table fields to be checked. Enter a relational or logical operator to create range-limitation logic expressions to control the export. Enter the from and to values that apply to the Baan field.

Figure 29, Ranges

Ranges (tuxch0112m000) Field Serial Number Baan Field Description Enter a number to ensure the correct sorting sequence. Enter a rule to specify the range of table fields to be checked. If the rule involves more than one field, you can use two lines to express the range. Enter a relational or logical operator to create range limitation logic expressions to control the export process. The Operator performs a check between the Baan field and the Value From and Range Value To fields. Enter the limits that are applied to the Baan field. You can use this only for the between and not between operators. If the range rules need more than one line to be expressed properly, enter an and or an or in the And/Or/End field to join the multiple lines. When a range expression goes over one line, the sequence number is the only determination of which line is to be read next. All range limitations must end with the end of expression choice.

Operator

Value (from) Range value to And/or/end

Exchange User Guide 4-10

Export module

Create Export Programs (tuxch0228m000)


To be able to use an exchange scheme, you must pull together all the data in the sessions you have just filled, put the data into one program script, and compile the program script into a runable object. The Create Export Programs (tuxch0228m000) session does all of that for export scripts. Before you create the export programs, check the syntax of the condition scripts that are used in the table and field relations. Syntax errors in the condition script cause compilation errors. You can check the syntax with the Check Syntax of Conditions (tuxch0206m000) session. Follow this procedure to create an export program:
1 2 3 4

Select a range of exchange schemes and batches. Select the check boxes under Compile Options to specify how the import program must be created. Click Create to start the creation of the export program. Click Export Data to start the Export Data (Non-Regular) (tuxch0233m000) session that will run the export program that is created in this session.

Figure 30, Create Export Programs

Exchange User Guide 4-11

Export module

Create Export Programs (tuxch0228m000) Field Selection Range Exchange Scheme Batch Compile Options Compile in Debug Mode Compile with Profiler Display with Errors Select to go through a condition script step by step. Select to compile with the profiler. After the import has run, the profiler generates a report that provides information about the performance time required for each function. Select to get a detailed list of errors showing the exact problem with each line of code. Enter an exchange scheme. Enter a batch. Description

Export Data (on a Regular Basis) (tuxch0234m000)


After you have set up the exchange schemes and tested them by running the Export Data (Non-Regular) (tuxch0233m000) session, you can set up a regular export to facilitate the recurring exchange of data. An export on a regular basis is especially useful in a multisite environment, where it is important that no run is lost or overwritten. The export can also run as part of a batch job. Use the Export Data (on a Regular Basis) (tuxch0234m000) session to run the export program to transfer data on a regular basis from BaanERP tables to sequential ASCII files. All of the input fields in the Export Data (on a Regular Basis) (tuxch0234m000) session are also contained in the Export Data (Non-Regular) (tuxch0233m000) session. In a regular export, however, you cannot enter a range for batch and batch lines, which prevents you from running part of an exchange scheme. This is to make sure that one period of audit information is not missed for one batch line while the rest of the batch lines are complete. When you use the regular export session, you need to pay extra attention to your UNIX directory management. When you export data using the Export Data (on a Regular Basis) (tuxch0234m000) session, the ASCII file is placed in an additional directory in the sequential file directory to keep the different runs separate. The name of this additional directory is <exchange scheme name>.<run number>.e.

Exchange User Guide 4-12

Export module

The session Import Data (on a Regular Basis) (tuxch0224m000) uses a similar directory naming convention to look for incoming data. The only difference is the last letter, which is an i for imports. The export can also run as part of a batch job. Follow this procedure to create a regular export:
1 2 3 4 5 6 7 8

Select a range of exchange schemes. Select the processing type. Enter the start and end time of the audit range if the export is based on audit. Select the Overrule Batch Company check box if the data is exported from a company other than the batch company. Enter another company if the current company is overruled. Define the details of the export procedure in the Processing Details group box. Click Export Data to start the export procedure. Click Log Table to view the contents of the log table. A log table gives an overview of the results of the export procedure.

Figure 31, Export Data (on a Regular Basis)

Exchange User Guide 4-13

Export module

Export Data (on a Regular Basis) (tuxch0234m000) Field Selection Range Exchange Scheme Processing Type Enter a range of exchange schemes. Description

Processing Settings Choose the type of run for this data exchange:
n n

New run Restart previous run This option allows you to import data using the last run number over again. This field is usually used in the Import Data (on a Regular Basis) (tuxch0224m000) session, where each run number provides different data sets. Only the log files are affected in this session, because the data to be loaded into Baan is the same for both the last run number used and the first free run number. Reprocess rejected records When records are rejected during an import process, Baan creates two additional files to hold the rejected records. Records that are rejected due to index or domain errors (database problems) are placed in the Rejected due to Error file and records that are rejected due to a condition returning a false status are placed in the Rejected due to Condition file. Baan places these files in the same directory as the data file that it was read in and appends the suffixes .e01 or .c01 to them. If more records are rejected during reprocessing, Baan creates new files with the next sequential number. When you choose this option, you can use the next two fields to choose which records to reprocess. Continue interrupted run If an exchange scheme run stops in the middle of the run, you can restart the import. You can only do this if there is more than one batch line and the restart can begin at the start of the batch line that was not completed. If there is only one batch line, this option is the same as a complete restart of the import.

Overrule Batch Company Company

Enter a Yes to override the value in the Company field in the Batches (tuxch0104m000) session. Enter the company to be used during this session instead of the batch company. This field can only be defined if Overrule Batch Company is On.

Exchange User Guide 4-14

Export module

Processing Details Wait for <CR> with Messages Select to cause messages to remain on screen until you press Enter. Clear if you want the export program to continue without any interaction from you. This option can be used for an export that runs throughout the night. Select if you want the export to complete without checking for messages that indicate that the export procedure is completed. If you clear this option, an Export Done message is sent, but only if there is a subscription for the batch. This option can be used to test or run the export. This is useful when testing an export in a multisite environment. Compress ASCII Files Select when you want to compress files after they are exported. Only use this option if the ASCII files to be exported are compressed using the BaanERP compress program. Enter the start date and time of the audit range. Select to set the end date and time of the audit range to the current date and time. All transactions between the specified start time and date and the current time and date are exported. This is important if the export procedure is part of a job. Every time the job is started, the end of the audit range will be the current time and date. The length of the interval is therefore not fixed. The ends of audit range fields do not have to be specified. Export to Current Date/Time Select to have this export continue until the current date and time.

Suppress Export Done Messages

Export Based on Audit Start of Audit Range End of Audit Range

Export Data (Non-Regular) (tuxch0233m000)


Use the Export Data (Non-Regular) (tuxch0233m000) session to run the export program to transfer data from BaanERP tables to sequential ASCII files. This is useful for one-time only exports and to test exchange schemes that will be run on a regular basis, to make sure that the export procedure functions properly. All of the input fields in the Export Data (on a Regular Basis) (tuxch0234m000) session are also contained in the Export Data (Non-Regular) (tuxch0233m000) session. In a non-regular export, however, you can specify a range for Batch and Batch Lines, which allows you to run part of an exchange scheme.

Exchange User Guide 4-15

Export module

This is not allowed in a regular export because it is possible to miss one period of audit information for one batch line while the rest of the batch lines are complete. The export can also run as part of a batch job. Follow this procedure to run the export program:
1 2 3

Select a range of exchange schemes, batches and/or batch sequence numbers. Select the processing type. Select the Overrule Batch Company check box if the data is exported from a company other than the current company. In such a case, define that company in the next field. Select the Wait for <CR> with Messages check box if the export program must stop after a message. Enter the start and end time of the audit range if the export is based on audit. Click Export Data to start the export procedure. The screen changes and a status window displays the progress of the export. For each batch line that completes, Baan displays the exchange scheme, the batch, and the batch line. The numbers of records read, processed, rejected due to error, and rejected due to conditions are also displayed. Click Log Table to view the contents of the log table. A log table gives an overview of the results of the export procedure.

4 5 6

Figure 32, Export Data (Non-Regular)

Exchange User Guide 4-16

Export module

Export Data (Non-Regular) (tuxch0233m000) Field Selection Range Exchange Scheme Batch Sequence Number Processing Type Enter a range of exchange schemes. Enter a range of batches. Enter a range of sequence numbers. Description

Processing Settings Choose the type of run for this data exchange:
n n

New run Restart previous run This option allows you to import data reusing the last run number. This field is usually used in the Import Data (on a Regular Basis) (tuxch0224m000) session where each run number provides different data sets. The log files are the only thing that is affected in this session, because the data to be loaded into Baan is the same both for the last run number used and the first free run number. Reprocess rejected records When records are rejected during an import process, Baan creates two additional files to hold the rejected records. Records that are rejected due to index or domain errors (database problems) are placed in the "Rejected due to Error" file and records that are rejected due to a condition returning a false status are placed in the "Rejected due to Condition" file. Baan places these files in the same directory as the data file that it was read in and appends the suffixes .e01 or .c01 to them. If more records are rejected during reprocessing, Baan creates new files with the next sequential number. When you choose this option, you can use the next two fields to choose which records to reprocess. Continue interrupted run If an exchange scheme run stops in the middle of the run, it is possible to restart the import. You can only do this if there is more than one batch line and the restart can begin at the start of the batch line that was not completed. If there is only one batch line, this option is the same as a complete restart of the import.

Overrule Batch Company

Enter a Yes to override the value in the Company field in the Batches (tuxch0104m000) session.

Exchange User Guide 4-17

Export module

Company Wait for <CR> with Messages Start of Audit Range Start from last Export Date/Time

Enter the company to be used in the Company field in this session. Select to cause messages to remain on screen until you press Enter. Enter the start date and time of the audit range. Select to have this export start from the time the last export based on audit finished. All transactions between the specified start time and date and the current time and date are exported. This is important if the export procedure is part of a job. Every time the job is started, the end of the audit range will be the current time and date. The length of the interval is therefore not fixed.

Export Based on Audit

End of Audit Range

Enter the end date and time of the audit range.

To check the results


After the ASCII file has been created, you can print the contents of this file using the Print ASCII File (tuxch0202m000) session. You can use the Log Table (Batch Level) (tuxch0508m000) session to check whether the export process was successfully completed. This session shows the number of records successfully processed and exported. This session also shows whether records were rejected due to an error, which happens when the write statement to the sequential file is not successful.

Exchange User Guide 4-18

Multisite control

With BaanERP you can now use the Exchange module to set up a batch-driven replication server. This enables you to maintain the same data at multiple sites. Data replication can be synchronous or asynchronous. In synchronous replication, data is sent from one system to another as soon as the data changes. Asynchronous replication is batch-driven, that is, it occurs at set time intervals or on demand. In BaanERP, data replication is asynchronous. It is accomplished as follows:
n n

The source system runs an export process. The source system sends a message to the target system or systems notifying them that new data is available. The target system runs an import process to assimilate the new data received from the source system.

In Exchange, a site is defined as an application server on which one or more exchange schemes for exporting or importing data are stored.

Audit trail
Exchange uses your databases audit trail to enable multisite exchange. Before you can begin a multisite exchange process, you must have audit trail set on. You can do this using the Database Definitions (ttaad4510m000) and Table by Database (ttaad4111m000) sessions. Auditing all of your data can consume a large amount of memory. You should therefore specify exactly which tables are to be audited and which are not. Every table containing data that you want to replicate in a multisite exchange scheme must be audited.

Exchange User Guide 5-1

Multisite control

About multisite exchange in Baan


When you set up a multisite exchange, you can link the export and import processes so that they are performed as one process. These links are not tightly coupled, however, and are controlled at each site. You can run the export and import within one process, so that one process is based on the results of the other. Or you can run the export at the source system, copy the resulting ASCII files to the target system, and then run the import there. Other configurations are also possible, depending on your companys business needs. Each source can have multiple targets and each target can have multiple sources. Multisite exchange works by setting up links at both the source and target sites. The link at the target site is called an exchange link and points to the export batch at the source site. When you define an exchange link, Baan stores a subscription at the source site, which points to the import batch at the target site. The link is active when both the exchange link at the target site and the subscription at the source site are available. When you run a regular export, Exchange checks whether there are any subscriptions. During a regular export, Exchange sends a message to the target site saying which files have been exported and where they are stored. The target site stores this information. When you run a regular import, Exchange checks to see if any data is waiting to be imported. If so, Baan copies the files from the source site to the target site and then imports them. Afterward, the target site reports to the source site that the data has been imported.

The export process


Whenever an export batch has been completed, Exchange checks whether there are any subscriptions for that batch. If subscriptions exist, the source site sends an Export Done message to each target that has subscribed to the batch. The Export Done messages are stored at the source site.

Exchange User Guide 5-2

Multisite control

The Export Done message


Exchange only sends and stores an Export Done message if the batch contains at least one active table relation (export). Exchange needs the following information to be able to create and send an Export Done message:
n n n n n n

Source environment, company, exchange scheme, and batch Run and try number of the export process (required for the sequence order at the target site) Target environment, company, exchange scheme, and batch Separator and enclosing character of the source exchange scheme Whether the ASCII files were compressed after export Batch line and file name (including the directory) for each batch line completed

At the target site, Exchange checks whether an exchange link exists that specifies the source environment, company, exchange scheme, and batch. If so, Exchange stores the information in Batches to Import and Batch Lines to Import.

File transport specifications


With regular export, you can choose whether to compress the ASCII files. After Exchange copies the files to the target site, the files are decompressed. Exchange does not provide additional security; that is, the files to be transported are not encrypted. When copying the files, any previously existing files are overwritten. This does not often happen, however, because usually you would use a separate subdirectory for each run for the regular export and the regular import.

The import process


A batch to import refers to a target batch that can be run because the source batch has already been run. Before running a regular import batch, Exchange checks whether there is an active exchange link for that batch at the target site. If there is no exchange link, Exchange runs an ordinary import. If there is an active exchange link, Exchange checks the batches to import.

Exchange User Guide 5-3

Multisite control

If there are no batches to import, Exchange does not perform an import. If there is a batch to import, Exchange performs the following functions, and repeats the process for subsequent batches to import:
n n n n

Copies the files from the source site. Removes the run from the batches to import and deletes its batch lines to import. Runs the import. Sends an Import Done to the source site.

The import process takes some time to complete, which means that while Exchange is busy processing one batch to import, new batches to import can arrive. Exchange continues checking for new batches until all the batches have been imported. Exchange usually runs a regular import only when there is no exchange link or when there are one or more batches to import. You can overrule this, however, and initiate an import batch without having Exchange perform these checks.
IMPORTANT NOTE

Each batch to import is processed in order of the run number and the try number within each run. The run number refers to the sequence order of a process within an exchange scheme. The try number is the number of attempts made for each run. If Exchange cannot process one import batch, it stops and does not continue processing subsequent batches. If necessary, you can delete the problematic batch so that Exchange can continue with the subsequent batches.

The Import Done message


The Import Done message reports to the source site that the data has been successfully imported at the target site. The files at the export site are deleted only after all of the target sites that need those files have copied and imported them. When you send the Import Done message, Exchange checks whether there are any rejected Import Done messages and if so, sends them, too. The sequence in which the Import Done messages are delivered to the source site is not relevant. If the files were successfully imported but the Import Done message could not be delivered to the source site, Exchange writes the Import Done message to the rejected Import Done messages and logs an error message. Exchange needs to have the following information so that it can create and send an Import Done message:
n n n

Source environment, company, exchange scheme, and batch The run number and try number of the export Target environment, company, exchange scheme, and batch

Exchange User Guide 5-4

Multisite control

When Exchange receives the Import Done message at the source site, Exchange removes the stored current Export Done message to which the Import Done message refers. When you are ready to clean up the ASCII files, you can check whether all targets that have subscribed to the source have already processed the files. A file must only be deleted when the run and try that created it do not occur in the current Export Done messages.

How to set up a multisite exchange


To set up a multisite exchange, you start by defining all the source environments and target environments using the Environments (tuxch4100m000) session. Then you use the Exchange Links (tuxch4501m000) and the Subscriptions (tuxch4502m000) sessions to define the exchange links and subscriptions, so that you can link the target environment and source environment. After the exchange links are defined, you must activate them using the Activate/Deactivate Exchange Links (tuxch4201m000) session. You can only use multisite functionality when all the links are present and linked.

The Multisite Control sessions


These are the sessions used in the Multisite Control business object:
n n n n n n

Environments (tuxch4100m000) Exchange Links (tuxch4501m000) Activate/Deactivate Exchange Links (tuxch4201m000) Resend Rejected Messages (tuxch4203m000) Subscriptions (tuxch4502m000) Receive Remote Procedure Calls (tuxch4200m000)

Environments (tuxch4100m000)
To set up a multisite exchange, you need to define all the source environments and target environments that are used in the multisite exchange. Use the Environments (tuxch4100m000) session to find, list, and maintain sites to be used to exchange data between different sites. Even though this session is especially designed for data exchanges between different sites, you can also use this session if you are using multisite exchange in a single BSE environment. The target environment and source environment are then the same.

Exchange User Guide 5-5

Multisite control

Follow this procedure to set up an environment:


1 2

Enter the name of the environment. Enter the system on which the environment resides, and the path for the directory of the environment.

Figure 33, Environments

Environments (tuxch4100m000) Field Environment System BSE Path Description Enter the name of the environment. Enter the system on which the environment resides. Enter the path for the directory of the environment.

Exchange Links (tuxch4501m000)


After you have defined the source environments and target using the Environments (tuxch4100m000) session, you need to define the exchange links and subscriptions so that you can link the target environment and source environment. Use the Exchange Links (tuxch4501m000) session to view a list of the exchange links you have already defined. Use the details session to create new links. The exchange link code defined at the target site must be the same as the subscription defined at the source site. You can only delete an exchange link if its status is inactive at both the source and target site. For more information about activating and deactivating exchange links, see the Activate/Deactivate Exchange Links (tuxch4201m000) session.
Exchange User Guide 5-6

Multisite control

The Specific menu contains the following:


n

Activate (Ctrl+Shift+A) Activates a single exchange link. Deactivate (Ctrl+Shift+D) Deactivates a single exchange link. Activate/Deactivate Exchange Links Activate or deactivate a range of exchange links. Batches to Import View or delete the batches to import. Rejected Import Done Messages View the Rejected Import Done Messages. Choose FileNew to display the Exchange Links (tuxch4101s000) details session. Enter a name and description for the link that you are creating. Enter the target exchange scheme and batch. Enter the source information. If you want to add more information, click the Text button on the toolbar to start the text editor.

Follow this procedure to set up an exchange link:


1 1 2 3 4

Figure 34, Exchange Links

Exchange User Guide 5-7

Multisite control

Figure 35, Exchange Links, Details session

Exchange Links (tuxch4101s000) Field Exchange Link Description Target Exchange Scheme Target Batch Source Environment Source Company Source Exchange Scheme Source Batch Exchange Link Status Exchange Link Text Description Use the Exchange Link field to enter a name for the link that you are creating. Enter a description for this exchange link. Enter the name of the target exchange scheme. Enter the batch number of the target exchange scheme. Enter the source environment. Enter the number of the source company. Enter the name of the source exchange scheme. Enter the batch number in the source exchange scheme. This field is shown as inactive until links at both the target and source sites are set up, and you activate this exchange link. Indicates whether this exchange link includes text.

Exchange User Guide 5-8

Multisite control

Activate/Deactivate Exchange Links (tuxch4201m000)


After you have created exchange links using the Exchange Links (tuxch4501m000) session, you need to activate the links before you can use them in a multisite exchange. You use the Activate/Deactivate Exchange Links (tuxch4201m000) session to activate and deactivate a range of exchange links between the source and target batches. The link must be active to make the exchange link available at the target site and the subscription available at the source site. If the link is not active, you cannot use the multisite functionality. When you activate an exchange link, the target site sends a Subscribe message to the source site. The subscription is checked and stored at the source site. After that, whenever the batch defined in the subscription is carried out, the source site sends an Export Done message to the target site. If this message is not processed successfully, the link is stored at the target site, but the status is changed to inactive. When you deactivate an exchange link at the target site, Exchange sends an Unsubscribe message to the source site. The subscription is then deleted and the target batch can no longer automatically process data from the source site. The Current Export Done messages are also deleted. You can only delete an exchange link if its status is inactive at both the source and target site. This process can also run as part of a job. Follow this procedure to activate or deactivate an exchange link:
1 2 3

Under Action Type, choose whether to activate or to deactivate the link. Under Selection Type, choose how to make a selection of links. Define a range of exchange links, or choose the Detailed tab where you can make a more detailed selection.

Exchange User Guide 5-9

Multisite control

Click (De)activate to start the process.

Figure 36, Activate/Deactivate Exchange Links, General tab

Figure 37, Activate/Deactivate Exchange Links, Detailed tab

Exchange User Guide 5-10

Multisite control

Activate/Deactivate Exchange Links (tuxch4201m000) Field General tab Action Type Activate Deactivate Select to activate a range of exchange links. Specify the range in Selection by Exchange Link. Select to deactivate a range of exchange links. Specify the range in Selection by Exchange Link. Description

Only Links Having Select to deactivate only the links in the specified range with the status Inactive (Target Only). Status Inactive (Target Only Selection Type Selection by Exchange Link Select to be able to enter a range of links in the Exchange Link field under Selection by Exchange Link.

Detailed Selection Select to be able to make a more detailed selection of exchange links on the Detailed tab. Selection by Exchange Link Exchange Link Detailed tab Detailed Selection Target Exchange Scheme Target Batch Source Environment Source Company Source Exchange Scheme Source Batch Enter a range of target exchange schemes for which you want to activate or deactivate the exchange links. Enter a range of target batches for which you want to activate or deactivate the exchange links. Enter a range of source environments for which you want to activate or deactivate the exchange links. Enter a range of source companies for which you want to activate or deactivate the exchange links. Enter a range of source exchange schemes for which you want to activate or deactivate the exchange links. Enter a range of source batches for which you want to activate or deactivate the exchange links. Enter a range of exchange links. This field is only activated if Selection by Exchange Link is set On.

Exchange User Guide 5-11

Multisite control

Resend Rejected Messages (tuxch4203m000)


The Resend Rejected Messages (tuxch4203m000) session is relevant at both the source site and the target site. You can use this session to resend the following rejected messages:
n n n

Current Export Done Import Done Subscription Destroyed

Messages can be rejected because of the following reasons:


n n n n n

The target system does not use Baan Exchange. The target system is not operational. Network connections are slow. There is no remote user in the target environment or in the source environment. The Receive Remote Procedure Calls (tuxch4200m000) session did not run in the source environment or target environment.

If a message cannot be delivered to the receiving site, it is stored at the sending site and receives the status rejected. Follow this procedure to resend the rejected message:
1 2 3 4

Select one or more message types in the Messages To Resend group box. This activates the appropriate range tab. Use the check boxes in the Selection Type group box to either make a global or a detailed selection of messages to resend. Define the range on the appropriate range tab. Click Resend to start the process.

After messages are successfully sent, they are removed. This process can also run automatically as part of a job. This means that if you do this regularly, you do not have to check manually for rejected messages.

Exchange User Guide 5-12

Multisite control

Figure 38, Resend Rejected Messages, Selection tab

Figure 39, Resend Rejected Messages, Current Export Done Messages tab

Exchange User Guide 5-13

Multisite control

Figure 40, Resend Rejected Messages, Import Done Messages tab

Figure 41, Resend Rejected Messages, Subscription Destroyed Messages tab

Exchange User Guide 5-14

Multisite control

Resend Rejected Messages (tuxch4203m000) Field Selection tab Messages to Resend Current Export Done Messages Import Done Messages Subscription Destroyed Messages Selection Type Global Selection Select to activate the global selections on each tab and see everything for each exchange link or subscription. Select to activate the fields contained on the Current Export Done Messages tab. Select to activate the fields contained on the Import Done Messages tab. Select to activate the fields contained on the Subscription Destroyed Messages tab. Description

Detailed Selection Select to specify the exchange scheme, batch, company, and environment for which to see rejected messages. Current Export Done Messages tab Global Selection Subscription Target Environment Target Company Detailed Selection Source Exchange Scheme Source Batch Target Environment Target Company Target Exchange Scheme Target Batch Global Selection Exchange Link Detailed Selection Target Exchange Scheme Enter a range of target exchange schemes. Enter a range of exchange links. Enter a range of source exchange schemes. Enter a range of source batches. Enter a range of target environments. Enter a range of target companies. Enter a range of target exchange schemes. Enter a range of target batches. Enter a range of subscriptions. Enter a range of target environments. Enter a range of target companies.

Import Done Messages tab

Exchange User Guide 5-15

Multisite control

Target Batch Source Environment Source Company Source Exchange Scheme Source Batch Global Selection Subscription Target Environment Target Company Detailed Selection Source Exchange Scheme Source Batch Target Environment Target Company Target Exchange Scheme Target Batch

Enter a range of target batches. Enter a range of source environments. Enter a range of source companies. Enter a range of source exchange schemes. Enter a range of source batches.

Subscription Destroyed Messages tab Enter a range of subscription from the source sites. Enter a range of target environments. Enter a range of target companies. Enter a range of source exchange schemes. Enter a range of source batches. Enter a range of target environments. Enter a range of target companies. Enter a range of target exchange schemes. Enter a range of target batches.

Subscriptions (tuxch4502m000)
After you have defined the source environments and target using the Environments (tuxch4100m000) session, you need to define the exchange links and subscriptions so that you can link the target environment and source environment. You can use the Subscriptions (tuxch4502m000) session to view and maintain subscriptions. The subscription at the source site is equivalent to the exchange link at the target site. The codes for both the subscription and the exchange link must be the same. When a subscription is deleted, the source site sends a Subscription Destroyed message to the target site. This deactivates the exchange link.

Exchange User Guide 5-16

Multisite control

The Specific menu contains the following options:


n

Current Export Done Messages Allows you to view the Export Done messages. Rejected Subscriptions Destroyed Messages Allows you to view the rejected Subscription Destroyed messages.

Follow this procedure to set up a subscription:


1 2 3

Enter a name for the link that you are creating. Enter the source exchange scheme and batch. Enter the target information.

Figure 42, Subscriptions

Subscriptions (tuxch4502m000) Field Description Subscription Enter a name for the link that you are creating. Source Exchange Enter the source exchange scheme. Scheme Source Batch Enter the source batch. Target Enter the target environment. Environment Target Company Enter the target company. Target Exchange Enter the target exchange scheme. Scheme Target Batch Enter the target batch.

Exchange User Guide 5-17

Multisite control

Receive Remote Procedure Calls (tuxch4200m000)


Run the Receive Remote Procedure Calls (tuxch4200m000) session on the target site to read the remote procedure calls. Remote procedure calls are used to indicate that messages have been received regarding the export or import. Follow this procedure to receive remote procedure calls:
1 2 3

Click Start Receiving to read the messages. Click Stop Receiving to stop the end reading the messages. Click Clean Up to remove the messages that were not automatically removed after reading the messages.

Figure 43, Receive Remote Procedure Calls

Receive Remote Procedure Calls (tuxch4200m000) Field Start Receiving Stop Receiving Description Select to begin receiving remote procedure calls. Select to stop receiving remote procedure calls.

Exchange User Guide 5-18

Generate Exchange Scheme

Introduction
You can use the Exchange (XCH) module to exchange data between two or more companies in an organization. The Generate Exchange Schemes business object lets you automate the creation of the required master data and import data. Data is exchanged between companies in Baan when you want to export data:
n

From one company and then import the data into one or more companies (dissemination). From multiple companies and then import the data into one company (consolidation).

In the first situation, you execute the export and import procedures sequentially. This is called dissemination because the data is disseminated from a master company to one or more dependent companies. If the data is to be imported into more than one company, you should create a batch for each company. You must also create the corresponding import table and field relations. Refer to the Copy Exchange Scheme (tuxch0201m000) session in the Exchange Miscellaneous Tools module for more information. In the second situation, you also execute the export and import procedures sequentially. This is called consolidation because the data is consolidated from subcompanies to a master company. As in the dissemination strategy, you create multiple batches for the export companies. You create one batch for the import company.

Exchange User Guide 6-1

Generate Exchange Scheme

At this time, the only method of exchange for consolidation available is the one shown in Figure 44, Using Exchange to consolidate data across Baan companies.

master company

Import

Generation of Exchange Scheme

ASCII files

ASCII files

ASCII files

Export

Export

Export

sub company 1

sub company 2

sub company 3

Figure 44, Using Exchange to consolidate data across Baan companies

To set up an exchange between companies, you must identify the master companies and subcompanies. Use the Exchange Companies (tuxch0150m000) session to record master companies. You can split the import and export processes into more manageable groups using the Exchange Groups (tuxch0151m000) session. If the importing company only obtains data from a single exporting company, you can use the Table Details (tuxch0152m000) session to specify the exporting company per table. Then you can use the Field Details (tuxch0153m000) session to specify which fields are maintained locally for each table. You can create import tables and their fields for the exchange group and master company using the Import Tables (tuxch0154m000) and the Import Fields (tuxch0155m000) session. After everything is set up for your exchange scheme, use the Generate Exchange Scheme (tuxch0251m000) session to automatically generate the exchange scheme, ASCII files and their formats, batch lines, and import table and table field data.
Exchange User Guide 6-2

Generate Exchange Scheme

These are the sessions included in the Generate Exchange Scheme module:
n n n n n n n n n

Exchange Companies (tuxch0150m000) Exchange Groups (tuxch0151m000) Table Details (tuxch0152m000) Field Details (tuxch0153m000) Import Tables (tuxch0154m000) Import Fields (tuxch0155m000) Update Field Data per Exchange Group (tuxch0255s000) Generate Exchange Scheme (tuxch0251m000) Generate Authorizations (tuxch0256m000)

Figure 45, Mandatory sessions for setting up an exchange scheme shows the sessions that are mandatory when you set up an exchange scheme using the Generate Exchange Scheme module.

Exchange Companies (tuxch0150m000)

Exchange Groups (tuxch0151m000)

Table Details (tuxch0152m000) Import from different company numbers Field Details (tuxch0153m000)

Import Tables (tuxch0154m000)

Import Fields (tuxch0155m000)

Generate Exchange Scheme (tuxch0251m000)

Generate Authorizations (tuxch0256m000)

Figure 45, Mandatory sessions for setting up an exchange scheme

Exchange User Guide 6-3

Generate Exchange Scheme

The Generate Exchange Scheme sessions


Exchange Companies (tuxch0150m000)
Use the Exchange Companies (tuxch0150m000) session to record master companies. A master company is used to import data from subcompanies. For each master company, you specify whether the import data has been exported from one company or from multiple company numbers. You then create an exchange scheme to import the data from the subcompanies to the master company. Usually the table definitions of the subcompanies and the master company are the same. It is best to define the structure and organization of a multisite company before you generate an exchange scheme. Figure 46 shows an example of a multisite structure in which the master company 100 is an importing company. Company 100 imports data from Subcompany 200 and Subcompany 300.

Master Company 100

Subcompany 200

Subcompany 300

Figure 46 Example of a multisite structure

Exchange User Guide 6-4

Generate Exchange Scheme

Follow this procedure to create a master exchange company in an exchange scheme:


1 2

Enter the company code and company name of the master company. If data is received from more than one source, select Data from Multiple Sources.

Figure 47, Exchange Companies

Exchange Companies (tuxch0150m000) Field Company Name Description Enter the name of the master company. Company Number Enter the number of the master company. Data from Multiple Select if the data is received from more than one source. Sources

Exchange User Guide 6-5

Generate Exchange Scheme

Exchange Groups (tuxch0151m000)


You can make imports and exports easier to manage by breaking them into logical groups. For example, you can create submodules such as sales orders and purchase orders, or distribution, export, and transportation. You can use the Exchange Groups (tuxch0151m000) session to split the import process into smaller parts. The exchange groups are converted to the exchange scheme that is created in the Generate Exchange Scheme (tuxch0251m000) session.

Figure 48, Exchange Groups

Exchange Groups (tuxch0151m000) Field Exchange Group Description Text Description Enter the name of the exchange group you want to create. Enter a description of the exchange group. Indicates whether this exchange group includes text.

Exchange User Guide 6-6

Generate Exchange Scheme

Table Details (tuxch0152m000)


Use the Table Details (tuxch0152m000) session to specify the exporting company per table. You can only use this session if the importing company obtains data from a single exporting company, and not from multiple sources. Refer to the Exchange Companies (tuxch0150m000) session to see whether data is imported into the master company from a single company or from multiple sources. The Specific menu contains these options:
n

Update Table Details Starts the Update Table Details (tuxch0250m000) session, which allows you to import a range of tables. This is a convenient way to enter many tables. Generate Reference Tables (Ctrl+Shift+G) Creates the reference tables. Enter all BaanERP tables of the master company. Enter the company number in a BaanERP table that is used to export table details to the master company.

Follow this procedure to create the table details:


1 2

You can also choose Update Table Details on the Specific menu to create a range of tables in this session. Choose Generate Reference Tables on the Specific menu to create the reference tables.

Figure 49, Table Details

Exchange User Guide 6-7

Generate Exchange Scheme

Table Details (tuxch0152m000) Field Baan Table Description Export Company Text Description Enter the names of the Baan tables of the master company involved in the exchange process. Enter a description of the table. Enter the number of the company to which this table is to be exported. Indicates whether this table includes text.

Field Details (tuxch0153m000)


Use the Field Details (tuxch0153m000) session to specify which fields are maintained locally for each table for an import company that does not have multiple sources. Locally-maintained fields are not overwritten by the exporting company. You can skip this session if all the table fields are the same. Refer to the Exchange Companies (tuxch0150m000) session to see whether data is imported into the master company from a single company or from multiple sources. Per BaanERP table and per master company, you can specify the table fields and exporting company. The exporting company contains data that is imported from another site to the master company. The Specific menu contains this option:
n

Update Field Details Starts the Update Field Details (tuxch0253s000) session, where you can select a company to overwrite the table fields in the master company.

Exchange User Guide 6-8

Generate Exchange Scheme

Follow this procedure to specify the table field details:


1 2 3

Enter all BaanERP table fields of the BaanERP table in a master company. Use the check box to specify if this field is a local field in an exporting company. Enter the company number of the export company.

Figure 50, Field Details

Field Details (tuxch0153m000) Field Baan Field Description Local Field Export Company Text Description Enter the fields for the specified Baan table. Enter a description of the field. Select if this is a local field in an exporting company. Enter the number of the company to which this table is to be exported. Indicates whether this field detail includes text.

Exchange User Guide 6-9

Generate Exchange Scheme

Import Tables (tuxch0154m000)


Use the Import Tables (tuxch0154m000) session to create import tables for the exchange group and master company. The tables are grouped by exchange group to split the exchange of data into logical units. The tables created in this session are imported when the exchange process starts. If you are importing from a single source, you can use the Sequence field to specify the sequence of the tables to be imported. These tables must be specified in the Table Details (tuxch0152m000) session. If you are importing from multiple sources, you use this session to specify the tables and sequence of the tables to be imported. The tables are not specified in the Table Details (tuxch0152m000) session. The Specific menu contains these options:
n

Update Table Data per Exchange Group Starts the Update Table Data per Exchange Group (tuxch0254m000) session, which automatically creates a range of tables per exchange groups. Generate sequence numbers and reference tables (Ctrl+Shift+A) Begins generating the sequence numbers and reference tables. Generate reference tables (Ctrl+Shift+G) Begins generating the reference tables.

Exchange User Guide 6-10

Generate Exchange Scheme

Follow this procedure to create the import tables:


1 2

Specify the exchange group and master company. Define per BaanERP table the sequence number and export company.

Figure 51, Import Tables

Import Tables (tuxch0154m000) Field Baan Table Description Sequence Description Enter the name of the table to be imported. Enter the description. Select to specify the sequence of the tables to be imported. You can only use this if you are importing from a single source (multiple data sources = no). Enter the company from which the data for each table is to be exported. Indicates whether this table includes text.

Export Company Text

Exchange User Guide 6-11

Generate Exchange Scheme

Import Fields (tuxch0155m000)


Use the Import Fields (tuxch0155m000) session to create the fields in the import tables. The fields are grouped by exchange group to split the exchange of data into logical units. The fields created in this session are imported when the exchange process starts. If importing is done from a single source, you can use this session to specify the sequence of the tables to be imported. These tables must be specified in the Table Details (tuxch0152m000) session. If importing is done from multiple sources, you can use this session to specify the tables and the sequence order of the tables to be imported. In this case, the tables are not specified in the Table Details (tuxch0152m000) session. The Specific menu contains this option:
n

Update Field Data per Exchange Group Starts the Update Field Data per Exchange Group (tuxch0255m000) session, which allows you to create a range of table fields automatically per exchange group.

Follow this procedure to create the fields in the import tables:


1 2

Specify the exchange group and master company and BaanERP table. Define the BaanERP table field, sequence number and export company.

Figure 52, Import Fields

Exchange User Guide 6-12

Generate Exchange Scheme

Import Fields (tuxch0155m000) Field Baan Field Description Local Field Export Company Text Description If the fields of a table have multiple sources, enter the field names to be imported. Enter a description of the Baan field. Select if the source is a local field in an export company. Enter the number of the export company. Indicates whether this field includes text.

Update Field Data per Exchange Group (tuxch0255s000)


You use the Update Table Data per Exchange Group (tuxch0254s000) session to create a range of table fields per exchange group. You can start the Update Field Data per Exchange Group session from the Import Fields (tuxch0155m000) session. You can use it to load the table fields from the table definition into the Import Fields (tuxch0155m000) session.

Figure 53, Update Field Data per Exchange Group

Update Table Data per Exchange Group (tuxch0254s000) Field Exporting Company Options Overwrite Records Select to overwrite the existing table fields. Description Enter the number of the export company.

Exchange User Guide 6-13

Generate Exchange Scheme

Generate Exchange Scheme (tuxch0251m000)


Exchange uses the information entered in the previous steps of this module to generate components of the Master Data and Import modules. Use the Generate Exchange Scheme (tuxch0251m000) session to automatically generate the exchange scheme, ASCII files and their formats, batch lines, and import table and table field data. You can customize these components by appending condition scripts. The generated exchange schemes and batches are identified by adding the number of the master company to the code of the exchange group and batch code. For example: <Exchange group><master company number> <Batch><master company number> Follow this procedure to generate exchange schemes:
1 2 3 4 5

Enter a range of exchange groups. Enter the number of the master company. Define a character to separate the ASCII file fields. Enter a path to store the programs and files created during this process. Click Generate to start the process.

Figure 54, Generate Exchange Scheme

Exchange User Guide 6-14

Generate Exchange Scheme

Generate Exchange Scheme (tuxch0251m000) Field Selection Range Exchange Group Importing Company Details Separator Path for Files Enter the character used to separate variable-length ASCII file fields. Enter the path name of the directory where the programs and files created during the exchange process are to be stored. Enter the exchange group to be generated. Enter the number of the importing company. Description

Generate Authorizations (tuxch0256m000)


Users who create the exchange scheme as well as users who execute the exchange scheme must be able to read and create files. It is therefore important that you set up proper security permissions. In a UNIX system, the user should create files with write permissions for the group level (umask 022). It is best to consult the system administrator because the way the information is established depends on the installation. Use the Generate Authorizations (tuxch0256m000) session to generate user authorizations for the exporting companies in a multisite environment. The authorizations are generated for Normal Users for all BaanERP table fields. The fields are divided into Local fields and Imported fields. The authorizations for Local fields must exceed or be equal to the authorizations of the imported fields. For example, if the user has a read authorization on Local fields, the authorization on imported fields is either read or not authorized. The authorizations can also be created as part of a job. After you have created the authorizations, you must perform a convert to run time process to activate the authorizations for the user. Follow this procedure to generate authorizations:
1

Use the All Exporting Companies check box to generate authorizations for all exporting companies. If the authorizations have to be created for one or more companies, enter the number of the companies. Enter a valid range of exporting company numbers. Enter the names of the users that are to be authorized.
Exchange User Guide 6-15

2 3

Generate Exchange Scheme

4 5 6

Enter the number of the master company. Define the authorizations for the local and imported fields. Click Generate to start the process.

Figure 55, Generate Authorizations

Generate Authorizations (tuxch0256m000) Field All Exporting Companies Description Select to generate authorizations for all exporting companies. Clear to use the fields under Selection Range to specify the companies for which you want to generate authorizations. Enter the range of exporting companies. Enter the names of the users to be authorized. Enter the code for the master company. The master company is used to import data from subcompanies. The master company is created in the Exchange Companies (tuxch0150m000) session. Authorizations Local Fields Imported Fields Define the user authorizations for the local fields. Define the user authorizations for the imported fields.

Selection Range Exporting Company User Importing Company

Importing Company

Exchange User Guide 6-16

Miscellaneous

The sessions in the Miscellaneous business object provide useful utilities and sessions related to the status of the export and import processes performed. The utilities do not belong to a specific procedure but they can be used at any time in the Exchange Module. The functions in the Miscellaneous module are divided into the following groups:
n

Logging The Logging functions let you set up and maintain a log table, so that you can monitor what is happening during the exchange process. Tools The Tools functions allow you to perform administrative activities on exchange schemes, ASCII files, ASCII file fields and relations, Baan fields, definition files, and conditions. You can also view a list of predefined functions and variables. Conversion The Conversion sessions guide you through converting a Baan application from Version 6.1.a to a newer release or version.

The Logging sessions


The Logging functions enable you to track the activities during an exchange by maintaining and monitoring a log table. The Logging sessions are comprised of the following:
n n n n n

Print Log File (tuxch0215m000) Remove Log Files (tuxch0216m000) Log Table (Batch Level) (tuxch0508m000) Log Table (Batch Line Level) (tuxch0509m000) Clear Log Table (tuxch0208m000)

Exchange User Guide 7-1

Miscellaneous

Print Log File (tuxch0215m000)


During the import process, you have the option of printing a detailed log file. This file is located in the same directory as the exchange scheme. Use the Print Log File (tuxch0215m000) session to print the log file that is created during processing of the Import Data (Non-Regular) (tuxch0223m000) or the Import Data (on a Regular Basis) (tuxch0224m000) session. Using this session, the log file is printed for the run number selected. This is useful in locating errors. The print process can also be run as part of a job. Follow this procedure to print the log file:
1 2 3 4 5 6 7 8 9

Enter the type of exchange. Enter a range of exchange schemes. Enter a range of batches. Enter a range of run numbers. Enter a range of try numbers. Enter a range of table relations. Enter the error type. Enter a range of error codes. Select one of the check boxes to print the error report. You have the option to print either a short description or a complete description of the error message.

10 Use the check box to suppress messages for nonexisting files. 11 Click Print to start the process.

Figure 56, Print Log File

Exchange User Guide 7-2

Miscellaneous

Print Log File (tuxch0215m000) Field Selection Range Type of Exchange Enter whether this is a regular or non-regular export or import. Exchange Scheme Batch Run Number Try Number Batch Line Error Type Error Code Print Options Print Short Error Description Select if you want to see an overview of all the errors showing only the first 30 characters of the error message. This option is easy to read but it might not display enough information, for example, referential errors. To make sure that you have a complete error report, select Print Long Error Descriptions. Select to see the entire error description. Select if you do not want to see messages regarding log files that you have already deleted or that no longer exist. Clear if you want to see an error message for each log file in the specified range that no longer exists. Enter the exchange scheme to be logged. Enter the batch number of the exchange scheme. Enter the run number of this batch. Enter the try number of this batch. Enter the batch line. Use this to specify a type of error, if preferred. Enter the error code, if known. Description

Print Long Error Description Suppress Messages for Non-existing Files

Exchange User Guide 7-3

Miscellaneous

Remove Log Files (tuxch0216m000)


Use the Remove Log Files (tuxch0216m000) session to clean up your system by removing log files that you no longer need. This session removes the log files that are created in the Import Data (Non-Regular) (tuxch0223m000) and the Import Data (on a Regular Basis) (tuxch0224m000) sessions. This process can also run as part of a job. Follow this procedure to remove the log files:
1 2 3 4 5 6

Define the type of exchange. Enter a range of exchange schemes. Enter a range of batches. Enter a range of run numbers. Enter a range of try numbers. Click Remove to start the process.

Figure 57, Remove Log Files

Remove Log Files (tuxch0216m000) Field Selection Range Type of Exchange Enter whether the log files of regular or non-regular exports or imports are to be removed. Exchange Scheme Batch Run Number Try Number Enter the exchange scheme whose log file is to be removed. Enter the batch number of the exchange scheme. Enter the run number of this batch. Enter the try number of this batch. Description

Exchange User Guide 7-4

Miscellaneous

Log Table (Batch Level) (tuxch0508m000)


Use the Log Table (Batch Level) (tuxch0508m000) session to view the log table containing the results of the exchange process at the batch level. The Specific menu contains this option:
n

Log Table (Batch Line Level) Starts the Log Table (Batch Line Level) (tuxch0509m000) session.

Follow this procedure to view the log table at batch level:


1 2 3

Enter the type of exchange, whether its a regular or non-regular import or export. Enter the exchange scheme name and run number. Confirm that the other information is correct.

Figure 58, Log Table (Batch Level)

Exchange User Guide 7-5

Miscellaneous

Log Table (Batch Level) (tuxch0508m000) Field Description Type of Exchange Enter whether this is a regular or non-regular export or import. Exchange Scheme Run Number Try Number Batch Sequence Number Processing Type Control Type User Name Company Enter the exchange scheme of the log file. Enter the run number of the batch. Confirm the try number of this batch. Confirm the batch number of this exchange scheme. Confirm the sequence number. Confirm the processing type. Confirm the control type. Confirm the user name. Confirm the company code.

Exchange User Guide 7-6

Miscellaneous

Log Table (Batch Line Level) (tuxch0509m000)


Use the Log Table (Batch Line Level) (tuxch0509m000) session to view the log table containing the results of the exchange process at the batch line level. Follow this procedure to view the log table at batch line level:
1 2 3

Enter whether this is a regular or non-regular export or import. Enter the exchange scheme of the log file. Enter the batch information. For each table relation, Exchange displays the import or export information.

Figure 59, Log Table (Batch Line Level)

Exchange User Guide 7-7

Miscellaneous

Log Table (Batch Line Level) (tuxch0509m000) Field Description Type of Exchange Enter whether this is a regular or non-regular export or import. Exchange Scheme Run Number Try Number Batch Table Relation Sequence Number Baan Table ASCII File Records Read Records Processed Error Rejected Conditions Rejected Records Skipped Batch Line End Date and Time Enter the exchange scheme of the log file. Enter the run number of the batch. Enter the try number of this batch. Enter the batch number of this exchange scheme. Confirm the table relation. Confirm the sequence number. Confirm the Baan table. Confirm the ASCII file. Displays the number of records read. Displays the number of records processed. Displays the number of rows that were not processed due to errors. Displays the number of records having problems with condition scripts. Displays the number of records skipped. Displays the batch line end date and time.

Exchange User Guide 7-8

Miscellaneous

Clear Log Table (tuxch0208m000)


To delete the result of export and import runs, use the Clear Log Table (tuxch0208m000) session. Because the data of the last run is sometimes used later, it is recommended that you keep the highest run number of both the import and export. This process can also run as part of a job. Follow this procedure to clear the log tables of a specified range:
1 2 3 4 5 6

Define the type of exchange. Enter a range of exchange schemes. Enter a range of run numbers. Enter a range of batch end dates. Use the check box if you want to clear the log data of the last run. Click Clear to start the process.

Figure 60, Clear Log Table

Clear Log Table (tuxch0208m000) Field Description Selection Range Type of Exchange Enter whether this is a regular or non-regular export or import. Exchange Enter the exchange scheme of the log table. Scheme Run Number Enter the run number of the batch. Batch End Date Enter the date of the end of this batch. Options Also Clear Last Select to clear the last run as well as the log table. Run

Exchange User Guide 7-9

Miscellaneous

The Tools sessions


The Tools functions enable you to work at a more detailed level and fully customize the Exchange module to meet your business needs. The Tools sessions are comprised of the following:
n n n n n n n n n n

Copy Exchange Scheme (tuxch0201m000) Delete Exchange Scheme (tuxch0222m000) Rename ASCII File (tuxch1202m000) Create ASCII File Fields and Relations (tuxch0203m000) Create Definition Files (tuxch0204m000) Print ASCII File (tuxch0202m000) Remove ASCII Files (tuxch2202m000) Check Syntax of Conditions (tuxch0206m000) Predefined Functions/Variables (tuxch0510m000) Print Exception Report for Baan Fields (tuxch0423m000)

Copy Exchange Scheme (tuxch0201m000)


Using the Copy Exchange Scheme (tuxch0201m000) session, you can copy an exchange scheme, as well as the full structure such as the conditions, ASCII files, ASCII file fields, ranges, table relations, and field relations for import or for export. Certain elements of the structure can also be selectively copied. You can copy this to another scheme within the same company or to another company. Instead of using this session to copy existing exchange schemes you can also use parent exchange schemes in multilevel exchange schemes. The process can also run as part of a job. Follow this procedure to copy exchange schemes:
1 2 3

Use the check boxes under Attachments how to copy the exchange schemes. Enter the company number to where you want to copy the exchange schemes. Select the exchange schemes, batches and table relations for import or export, depending on the chosen option.

Exchange User Guide 7-10

Miscellaneous

Click Copy to start the process

Figure 61, Copy Exchange Scheme

Copy Exchange Scheme (tuxch0201m000) Field Copy Description Choose whether you want to copy the complete exchange scheme, batch, or relations. When you copy an exchange scheme, existing target exchange schemes are deleted and overwritten. If the conditions codes or relation codes used in the relations are not already present in the new exchange scheme, the condition code/conversion relation code is initialized as empty. Copy to Company Enter the company number to which you want to copy this Number exchange scheme. The default is the current company number. You can also copy part of the exchange scheme. Selection Exchange Scheme Batch Table Relation (Import) Table Relation (Export) Enter the source and target exchange schemes. If you specified Batch in the Copy field, you can enter the batch name here. If you specified Relations in the Copy field, you can enter the table relation name here. If you specified Relations in the Copy field, you can enter the table relation name here.

Exchange User Guide 7-11

Miscellaneous

Delete Exchange Scheme (tuxch0222m000)


The Delete Exchange Scheme (tuxch0222m000) session deletes a selected range of exchange schemes for the current company. If there are still files, batches, and relations defined in an exchange scheme, you cannot delete the exchange scheme using the Exchange Scheme (tuxch0101m000) session. The Delete Exchange Scheme session offers you the option to delete selected elements of the exchange structure or to delete the entire exchange scheme with all components. The process can also run as part of a job. Follow this procedure to delete the exchange scheme, or part of the exchange scheme:
1 2 3

Use the check boxes under Attachments to specify how to delete the exchange scheme. Select the exchange schemes, batches and table relations for import or export, depending on the chosen option. Click Delete to start the process.

Figure 62, Delete Exchange Scheme

Exchange User Guide 7-12

Miscellaneous

Delete Exchange Scheme (tuxch0222m000) Field Delete Selection Range Exchange Scheme Batch Table Relation (Import) Table Relation (Export) Enter a range of exchange schemes. If you specified Batch in the Delete field, you can enter the batch name here. If you specified Relations in the Delete field, you can enter the table relation name here. If you specified Relations in the Delete field, you can enter the table relation name here. Description Choose whether you want to delete the complete exchange scheme, batch, or relations.

Rename ASCII File (tuxch1202m000)


Use the Rename ASCII File (tuxch1202m000) session to rename logical ASCII files, if necessary, in an exchange scheme. The codes of the logical ASCII files are replaced in TU, XCH, table relation. The process can also run as part of a job. Follow this procedure to rename logical ASCII files:
1 2 3

Enter the exchange scheme. Enter the old ASCII file code and the new ASCII file code. Click Rename to start the process.

Figure 63, Rename ASCII File

Exchange User Guide 7-13

Miscellaneous

Rename ASCII File (tuxch1202m000) Field Exchange Scheme Selection ASCII File Enter the old name of the ASCII file and enter the new name you want it to have. Description Enter the exchange scheme to be renamed.

Create ASCII File Fields and Relations (tuxch0203m000)


ASCII file definitions are representations of the structure of an ASCII file. Before importing data, this definition file is loaded. You can use the Create ASCII File Fields and Relations (tuxch0203m000) session to generate ASCII file fields and relations for an exchange scheme automatically. By using this session, you can skip the Table Relations (Import) (tuxch0121m000) and Field Relations (Import) (tuxch0122m000) sessions. You can copy ASCII file fields from definition files and BaanERP table definitions, but the definition files have precedence over the BaanERP table definitions. During an import procedure, if a BaanERP field and an ASCII file field do not match, the BaanERP table field receives the value based on default. For example, if the ASCII file contains fewer fields than the BaanERP table, the value specified in the data dictionary is used for this field. During an export procedure, if the ASCII file and BaanERP table do not match, the BaanERP table field remains empty. This process can also run as part of a job.

Exchange User Guide 7-14

Miscellaneous

Follow this procedure to generate ASCII file fields and relations:


1 2 3 4 5

Enter the code of the exchange scheme. Select a range of ASCII files. Use the check boxes to define how to create the ASCII file fields. Use the check boxes to define how to create the Table and Field relations. Click Generate to start the process.

Figure 64, Create ASCII File Fields and Relations

Exchange User Guide 7-15

Miscellaneous

Create ASCII File Fields and Relations (tuxch0203m000) Field Exchange Scheme Selection range ASCII File ASCII File Fields Overwrite ASCII File Formats Create from Definition Files Create Based on Table Definitions Create Batch Create Import Relations Create Export Relations Select to overwrite the existing file formats. Select to create the ASCII file from definition files. Select to create the ASCII file based on table definitions. Enter the range of ASCII files for which you want to create file fields and relations. Description Enter the exchange scheme.

Table and Field Relations Select to create a batch. The import and export relations are defined in the batch. Select to create table and field relations for import of data. Select to create table and field relations for export of data.

Overwrite Existing Select to allow this process to overwrite the existing table Relations and field relations.

Create Definition Files (tuxch0204m000)


Use the Create Definition Files (tuxch0204m000) session to create definition files automatically. This session dumps the ASCII file structure into sequential files. The sequential files are specified in the ASCII file code table in the ASCII Files (tuxch0102m000) session. Definition files can be used in other environments where you copy them using the Create ASCII File Fields and Relations (tuxch0203m000) session. The created definition file is entered in the definition file field in the ASCII Files (tuxch0102m000) session. If the absolute path is not entered in that field, the path is taken from the Path for definition files field in the Exchange Schemes (tuxch0101s000) session. If the definition file field is empty, the definition file is identified by a code consisting of the letter d followed by the ASCII file code. This session is generally used by the exporting site. The created definition files are transferred to the importing site.
Exchange User Guide 7-16

Miscellaneous

Existing definition files are overwritten. This process can also run as part of a job. Follow this procedure to create definition files:
1 2 3

Enter the code of the exchange scheme. Enter the code of the ASCII files. Click Create to start the process.

Figure 65, Create Definition Files

Create Definition Files (tuxch0204m000) Field Selection Range Exchange Scheme ASCII File Enter a range of exchange schemes for which you want to create definition files. Enter a range of ASCII files whose structure you want to copy into sequential files. Description

Exchange User Guide 7-17

Miscellaneous

Print ASCII File (tuxch0202m000)


Use the Print ASCII File (tuxch0202m000) session to print an ASCII file with ASCII file fields of an exchange scheme. You can use this session to test the readability of an ASCII file prior to importing. You can also use it to look at the contents of a file created by the Export module. This session uses the ASCII file format of the exchange scheme. Therefore, the Master Data module must be set up before you can use this session. The table and field relations are not necessary to execute this session. If an ASCII file is being examined prior to import, the table relations (import) can be useful but are not required. Because table relations are not required, you must specify the physical ASCII file name. If the field numbers to be printed are not specified, all the fields in the ASCII file are printed. This process can also run as part of a job. Follow this procedure to print the ASCII file and ASCII file fields:
1 2 3 4

Enter the code of the exchange scheme and ASCII file. The physical ASCII file is automatically entered. If you want to print part of the physical ASCII file, enter range field numbers with a valid range of values. Define the field numbers that have to be printed. Click Print to start the process.

Figure 66, Print ASCII File

Exchange User Guide 7-18

Miscellaneous

Print ASCII File (tuxch0202m000) Field Exchange Scheme ASCII File ASCII File Name Selection Range Field Number Print What Field Numbers If you only want to print part of the ASCII file, enter a range of field numbers of the ASCII file. If you only want to print part of the physical ASCII file, enter a range of field numbers. Description Enter the exchange scheme to be printed. Enter the ASCII file within that exchange scheme. Baan automatically enters the ASCII file name.

Remove ASCII Files (tuxch2202m000)


Use the Remove ASCII Files (tuxch2202m000) session to delete the physical ASCII files used by an exchange process. This does not affect the log files that were created by the exchange process. The physical ASCII files used or created by the selected exchange runs are deleted. You delete the log files, however, using the Clear Log Table (tuxch0208m000) session. This process can also run as part of a job. Follow this procedure to remove the physical ASCII files:
1 2 3 4 5 6 7

Define the type of the exchange. Enter a range of exchange schemes. Enter a range of run numbers. Enter a range of try numbers. Enter a range of code of the batches. Enter a range of table relations. Specify a time period between two dates.

Exchange User Guide 7-19

Miscellaneous

Click Continue to start the process.

Figure 67, Remove ASCII Files

Remove ASCII Files (tuxch2202m000) Field Exchange Type Exchange Scheme Run Number Try Number Batch Batch Line Date Description Enter whether this is a regular or non-regular export or import. Enter the exchange scheme of the transaction to be checked. Enter the run number of this batch. Enter the try number of the batch. Enter the batch number of this exchange scheme. Enter the line number of this batch. Enter the creation date of the ASCII files to be removed.

Check Syntax of Conditions (tuxch0206m000)


Use the Check Syntax of Conditions (tuxch0206m000) session to check the syntax of a range of condition scripts used in an exchange scheme. You can use this session instead of compiling the conditions individually in the Conditions (tuxch0111m000) session. If errors occur during compilation, this session can display the errors. The errors found in the condition script are stored in the path condition errors specified in the Exchange Schemes (tuxch0101s000) session. The error filename looks like e<condition>. The errors found in the condition script are also displayed on screen. Due to the limitations of this session, and because the conditions are checked individually, irrelevant errors may be reported.

Exchange User Guide 7-20

Miscellaneous

If an error is reported on a specific condition in this session, but the sessions Create Import Programs (tuxch0227m000) and Create Export Programs (tuxch0228m000) do not report any errors with this condition, the syntax of the condition is correct.

Figure 68, Check Syntax of Conditions

Check Syntax of Conditions (tuxch0206m000) Field Exchange Scheme Selection Range Condition Options Display Errors Select to display the syntax errors. Enter the range of conditions for which you want to check the syntax. Description Enter the name of the exchange scheme.

Predefined Functions/Variables (tuxch0510m000)


The Baan Tools programming language is used in condition scripts. Certain functions and variables are also available to write condition scripts in Exchange that overrules generated condition scripts. You can use the Predefined Functions/Variables (tuxch0510m000) session to display these predefined functions, variables, and libraries.

Exchange User Guide 7-21

Miscellaneous

Note that, with the exception of import.company, export.company and startup.company, the variables are implemented as a define, and cannot directly be used in queries. For example, do not write: where tuxch008.runn = :run.number, but write instead: where tuxch008.runn = :1 wherebind (1, run.number) For more information about a particular function or variable, click Help and then click on the name of the individual function or variable. For detailed information about the functions, variables and libraries use the hypertext feature. Select the function/variable/library for which you want to see more information. Functions get.xch.scheme get.batch get.batch.line get.default.dateformat qdb.search read.table read.table.once read.table.company log.mess do.not.log.condition do.not.export.record Variables triton.table triton.field element.no ascii.file ascii.file.name run.number try.number xch.type redo.type cntl.type import.company export.company startup.company no.rec.read no.rec.write no.err.rejects no.cond.rejects no.rec.skip

Exchange User Guide 7-22

Miscellaneous

Main Libraries tudllcommon tudlldate-line tudlldate_time tudllfile_path tudlllink_com tudlllink_def tudlllink_file tudlllink_run tudlllogging tudllmultiline tudll_predefine tudllxch2

Figure 69, Predefined Functions/Variables

Exchange User Guide 7-23

Miscellaneous

Print Exception Report for Baan Fields (tuxch0423m000)


You can use the Print Exception Report for Baan Fields (tuxch0423m000) session to print an exception report and to compare the data dictionary (table fields) to the import field relations. You can use this list to check the Baan fields that do not occur in the exchange scheme. Undefined fields remain empty if a new record is added, and old values are retained in case of overwriting. This process can also run as part of a job. Follow this procedure to print the exception report:
1 2 3 4

Enter a range of exchange schemes. Enter a range of batches. Enter a range of table relations (import). Click Print to start the process.

Figure 70, Print Exception Report for Baan Fields

Print Exception Report for Baan Fields (tuxch0423m000) Field Selection range Exchange Scheme Batch Table Relation (Import) Enter a range of exchange schemes. Enter a range of batch numbers. Enter a range of table relations to import for which you want to print exception reports. Description

Exchange User Guide 7-24

Miscellaneous

The Conversion sessions


If you are converting from 6.1.a to a new version or release of Baan, you can use the Convert Exchange Schemes from 6.1a (tuxch9211m000) and Conditions from 6.1a (tuxch0511m000) sessions. If you are converting from another version of Baan, refer to the generic description contained in the next section, The procedure for converting data. The following sessions are included in the Conversion module:
n n

Convert Exchange Schemes from 6.1a(tuxch9211m000) Conditions from 6.1a (tuxch0511m000)

The procedure for converting data


Using the Exchange module, you can convert data from a prior Baan version or release to a new version or release. If the data includes customized table and domain definitions, you need to alter the conversion procedure to accommodate the changes in the data dictionary. By using this procedure, data entered in the older version of Baan can be used in the newer Baan version, which saves on reentering data. Please note that this procedure can vary depending on the specific version and release of Baan.

Types of conversion
Baan data is stored in database tables. The data dictionary describes the structure of tables, such as fields, field types, lengths, and the sequencing of fields in the database. When you upgrade the Baan environment, new fields can be appended to existing tables and existing fields can have changed attributes. Before you can upgrade the Baan environment, you must convert the data to adhere to this new structure. Depending on release requirements, a conversion can have either a reconfiguration of tables and exchange, or only an exchange. The first type, conversion with a reconfiguration of tables and exchange, occurs when you install an update release in an existing Baan environment. To convert the data, you change the package combination of the company. This procedure reconfigures the tables to meet the new specifications. However, if the new version requires new data, you also need to provide an exchange scheme. The second type, a conversion with exchange only, occurs when you install a new version and a new Baan environment. The conversion procedure must then include steps on both the previous and new versions. In this case, Baan provides exchange schemes for you.

Exchange User Guide 7-25

Miscellaneous

The procedure and result for both types of conversion are the same; that is, the data must be converted so that you can use the newest release of Baan.

Procedure
To convert data from the previous version to the new one, Baan delivers exchange schemes with the new Baan version. For the old release, you usually install the exchange schemes using the import program provided in the database tools. You must change the company numbers in the batches of the exchange schemes to export the data for the companies to be converted. You might need to execute some conversion-specific sessions at this time. These sessions prepare the data required in the new release. The data is then exported to ASCII files. As an alternative, you can use the database tool, Create Sequential Dump of Table (ttaad4226m000) session instead of an exchange scheme. The method of exporting data is described in detail in the release-specific conversion procedure. For the new release, you usually install the exchange scheme using the import program provided in the database tools. You must change the company number in the batches of the exchange scheme. You can modify the exchange scheme so that the exports associated with the old release are imported using an exchange scheme.

Exchange schemes

BAAN (old version) XCH - export dump

BAAN (new version) XCH - import

BAAN data

BAAN data

Figure 71, An overview of the conversion procedure

Figure 71, An overview of the conversion procedure, shows the procedure for converting data to a new Baan version.

Exchange User Guide 7-26

Miscellaneous

After the exchange schemes are loaded, you use the Batches (tuxch0104m000) session to specify the companies for which the data is to be converted. After you have compiled the export script, you can export the data using the Export Data (tuxch0233m000) session. Baan writes the data in the old Baan version to ASCII files and then you can perform the Baan conversion. This is described in detail in books written about each specific conversion. In the new Baan environment, you follow the same steps, which are shown in Figure 72, The conversion procedure.

Create Table from Sequential Dump (ttaad4227m000)

Batches (tuxch0104m000)

Create Export Programs (tuxch0228m000)

Export Data (tuxch0234m000)

Import Data (tuxch0224m000)

Figure 72, The conversion procedure

Conversion with Customization


If you have customized the table definitions or domains, you must take some additional steps. You need to modify the remaining sessions in the Master Data module and the Table Relations (tuxch0121m000 for import and tuxch0131m000 for export) and Field Relations (tuxch0122m000 for import and tuxch0132m000 for export) sessions. Refer to Chapter 3 "Import module" and Chapter 4, "Export module," for more information about these sessions. You must also extend the import exchange schemes with the steps described in this section. You can modify table definitions using development tools. The book Programming (7377US) covers the subject of tables and domains.

Exchange User Guide 7-27

Miscellaneous

After you have made these modifications, you must reconfigure the existing data based on the old definitions according to the new definitions. If you have changed table or domain definitions, you can use the Exchange module to modify the existing data according to the new customized definitions. The relationships between the modules used for this conversion are shown in Figure 73, The conversion procedure with customization.

Master data

Export

Table and Domain modifications

Import

Figure 73, The conversion procedure with customization

Use the sessions contained in the Master Data module to enter or modify the ASCII file and formats. Use the sessions contained in the Export module to modify the export data. After data is exported, you can apply the domain and table definitions to the new release. You can usually reuse the information for the import in the Master Data module, and only specify the table and field relations in the Import module. Finally you compile the import script, and the actual import starts.

Exchange User Guide 7-28

Miscellaneous

Convert Exchange Schemes from 6.1a (tuxch9211m000)


Use the Convert Exchange Schemes from 6.1a (tuxch9211m000) session to convert exchange schemes from Baan version 6.1a to more recent versions. To perform a complete conversion, you run this session twice. The first time, select only the Convert Domains and Separators check box. Select the other options that you want for the second run. Only select Clear Old Conditions if the results of the conversion of conditions have been checked. Conditions can contain errors, and you need the old condition texts to correct them. You can view the original conditions using in the Conditions from 6.1a (tuxch0511m000) session. The condition errors are logged in a log file. To speed up the conversion process, you can store the bic compiler into memory. This means that more memory is allocated to the process. This process can also run as part of a job. Follow this procedure to convert exchange schemes:
1 2

Use the check boxes under Attachments to define how to convert the exchange schemes. Enter the log file and separator character under Details. The log file can only be entered if at least one of the Convert Conditions and Replace Conditions are selected. The separator character can only be defined if the Convert Domains and Separators check box are selected. Enter a range of exchange schemes and ASCII files. Click Convert to start the process.

3 4

Domains
Make sure that the domain check on database level is disabled before you convert domains. The conversion of domains in the first run can influence the selection range of successive session runs. The range of exchange schemes or ASCII files may have to be changed on the second run. For example, during a conversion of the domains, exchange scheme Scheme-1 to Scheme-1 will be converted to Scheme_1. The hyphen (-) is an illegal character in the exchange scheme name. It is converted to the underscore character(_). During the conversions of start positions of ASCII files, conditions and so on, the range must therefore be set to: Scheme_1 - Scheme_1. The code of ASCII files might also have been changed.

Exchange User Guide 7-29

Miscellaneous

Click Display Log File to view the contents of the log file. More characters and character combinations are illegal for the following domains than for previous versions of Baan Exchange. These illegal characters are replaced by legal characters during the conversion. The following domains are changed in version 6.1 b of the Baan Exchange:
n n

tuxch.cxch for exchange schemes tuxch.casf for ASCII files

The following fields are affected by these changes. The fields marked with an asterisk (*) are primary key fields. The illegal characters in these fields are replaced by an underscore (_).
n n

cxch: first field in most tables*, 001.mxch casf: 002.casf*, 003.casf*, 011.casf*, 021.casf, 031.casf.

For the fields 001.cxch and 002.casf, Exchange carries out a check on conflicting names. This is necessary to avoid a condition or table relation being moved inadvertently to another exchange scheme. If there is a name conflict, a number is added to the cxch or casf field code. Only a maximum of 11 conflicting names, for example scheme#, scheme_, and scheme+, can be handled.

Separator
The separator character, consisting of the Separator Character field and the Control Character check box, has been moved from the ASCII files table (tuxch002) to the exchange scheme (tuxch001) table. Therefore, if the Control Character and Separator Character fields have been filled in version 6.1 a, it will no longer be correct in version 6.1 b. If Separator is selected, a new separator character is added to each exchange scheme in the range that has no separator character.

Convert Conditions
Because a condition is no longer directly linked to an ASCII file, the condition script does not recognize fields of the ASCII file. You must therefore use parameters. The name of the parameters should be the same for different ASCII files for which the condition is used. To enforce this, a parameter should be the same as the field name of the ASCII file field to which the parameter refers. When converting a condition, the parameters for the new condition will be generated for each variable that is used (but not declared) in the script and is a field of the ASCII file.

Exchange User Guide 7-30

Miscellaneous

Parameters are stored in the Parameters by Condition table. The log file lists all converted conditions, remarks, error messages, and warning messages. Error messages will be logged in the log file if:
n n

An error occurred on reading or writing a conditions text. A condition could not be compared to an existing condition to check if the existing condition is the same and could therefore be reused (error caused by to read or write problem). Conflicting update.field.(x) commands occur within one script. The return type of a condition is not correct for all the places where the condition is used. For example, in tuxch022.ccon it is used to return a long, while in tuxch032.ccon it is used to return an enumerate. In the condition, a return statement is missing. The syntax of a condition could not be checked. The directory for source object could not be created or source file could not be written. A converted condition contains syntax errors.

n n

n n

Warning messages will be logged in the log file if:


n

A unique name had to be generated for the condition. The old conditions code could not be used because of name conflicts. A condition is used in tuxch022.ccon to fill a BaanERP date field. The date format might be changed in Baan Exchange version 6.1 b. A condition with a correct syntax results in the following warning message Statement not reached on compiling.

A remark will be logged in the log file if:


n

A condition could be reused. An already existing condition could be used to replace another condition if the conditions are equivalent.

No message will be logged for:


n n

Problems concerning help texts of conditions. Problems on writing the log file.

For most subfunctions of convert.conditions(), the log file must be open for writing and function log.file.init() must have been called. After calling the convert.conditions() function, the program should call the remove.tmp.include.file(). This is because a temp.include file is used for compiling the converted conditions.

Exchange User Guide 7-31

Miscellaneous

Reuse can be limited if different conditions in ASCII files have the same name. For example, if the condition C1 is used in ASCII files A1, A2, and A3, and another condition, also called C1, is used in ASCII files A4, A5, and A6, the last one will not be reused. The conditions will be converted to four new conditions (C1, A4.C1, A5.C1, A6.C1), instead of two new conditions.

Replace Conditions
The following tables and fields will be updated:
n n n

Table Relations (Import) (fields econ, acon, ocon, ucon, dcon, scon). Field Relations (Import) (fields ccon, rval, uval). Field Relations (Export) (field ccon).

The fields of these tables, which previously contained old conditions, refer now to the new conditions. In Baan Exchange version 6.1 b, two additional update conditions are added. The relevant fields are copied from the already existing overwrite conditions. Four fields are copied:
n n n n

Overwrite Record? is copied to Update Record Overwrite Condition is copied to Update Condition Overwrite field is copied to Update Field Overwrite Condition is copied to Update Condition

List all replacements in the log file except overwrite conditions that are copied to update conditions. An error is logged if no new condition could be found to correspond an old condition in the converted conditions table (tuxch017). For most subfunctions of replace.conditions.where.used(), the log file must be open for writing and function log.file.init() must have been called.

Log file
Error messages are logged if:
n n n n n n n

Errors occur during the reading or writing of condition texts. A condition cannot be compared to an already existing condition, to make sure that the condition codes are not identical. The return value of a condition is not true for all places where the condition is used. A return statement is missing in the condition script. The syntax of a condition can be checked. Converted conditions contain syntax errors. A condition cannot be replaced because it is not converted.

Exchange User Guide 7-32

Miscellaneous

Warning messages are logged if:


n n

A unique code is generated for a new condition to avoid code conflicts. A condition is used in tuxch022.ccon to fill a triton date field.

A remark is logged if an existing condition can be used to replace another equivalent condition.

Figure 74, Convert Exchange Schemes from 6.1a

Exchange User Guide 7-33

Miscellaneous

Convert Exchange Schemes from 6.1a (tuxch9211m000) Field Options Convert Domains and Separators Control Character The first time you run a conversion, select only this option and clear the others. This converts the domains and sets the separators. Select to add a new control character to each exchange scheme in the specified range that has no separator, and therefore no control character. Select to reset the start positions of ASCII file fields. In versions before the 6.1 b ASCII file, the fields could start at position 1 or 2. In version 6.1 b, they always start at position 1. If the start positions of a range of ASCII files are converted, the ASCII File Fields table will be updated for the ASCII files in the specified range. If the start positions are reset, the lowest start position for each ASCII file will be equal to 1. Select to replace existing conditions in the old version with conditions in the new version. In version 6.1.a, conditions were stored by ASCII file and had to be duplicated to be used by more than one ASCII file. In newer versions this is not necessary because conditions are no longer stored by ASCII file. Conditions were defined by cxch/casf/ccon in Baan Exchange version 6.1 a, but are defined by cxch/ccon in Baan Exchange version 6.1 b. Redo Converted Conditions Replace Conditions Select to convert the conditions again when you repeat the process. The new condition is deleted and the old condition is converted again. Select to replace old conditions that were used in the first conversion. Replacements are put in the log file, except overwrite conditions that update conditions. An error will be logged if, for an old condition, a new condition could not be found in the converted conditions table (tuxch017). Description

Reset Start Positions ASCII Files

Convert Conditions

Exchange User Guide 7-34

Miscellaneous

Clear Old Conditions

Select to remove old conditions that were successfully converted and replaced. This option also deletes the conditions from the temporary Converted Conditions table. From the old Converted Conditions table, only the conditions that are in the conversion table will be deleted. Therefore, if a condition has not been converted at all, for example because a log file could not be opened, the old condition will not be deleted. However, if the condition has been converted, it will be deleted even if the new conditions contain syntax or other errors.

Details Logfile Separator Selection Range Exchange Scheme ASCII File Enter a range of exchange schemes. Enter a range of ASCII files. Enter the name of the logfile to which error messages are written. Enter the separator character to be used in every exchange scheme that does not have a separator character.

Exchange User Guide 7-35

Miscellaneous

Conditions from 6.1a (tuxch0511m000)


Use the Conditions from 6.1a (tuxch0511m000) session to see the conditions that were used in older versions.

Figure 75, Conditions from 6.1a

Conditions from 6.1a (tuxch0511m000) Field Exchange Scheme ASCII File Condition Description Type Script Syntax OK Description Enter the name of the exchange scheme. Enter the name of the ASCII file. Confirm the old condition. Displays the description of the condition. Displays the type of condition. Indicates whether the condition includes a script. Indicates whether the syntax of the condition was acceptable.

Exchange User Guide 7-36

Generic Exchange Scheme

Baan has developed a Generic Exchange Scheme that you can use to install standard exchange schemes delivered by Baan or Baan partners. You can also use it to copy customer specific exchange schemes to other companies or systems, for example, in a multisite environment. The Generic Exchange Scheme contains two batches:
n n

EXPORT, to export exchange schemes IMPORT, to import exchange schemes

You must complete the following steps before you can use the Generic Exchange Scheme:
n n n

Install the Generic Exchange Scheme Customize the Generic Exchange Scheme Generate the exchange programs and run the Generic Exchange Scheme.

To install the Generic Exchange Scheme


The files to install for the Generic Exchange Scheme are stored in the $BSE/lib/exchange directory. If you move them to another directory, be sure to enter the correct directory when you install these files. If you use FTP to copy the files, use ASCII mode. To install the Generic Exchange Scheme take the following steps:
1 2

Choose Baan ToolsDatabase ManagementDatabase Utilities, and start the Create Table from Sequential Dump (ttaad4227m000) session. On the Details tab, define the company where you want to store and run the exchange scheme. This can be either your current company or another company in which you want to use the interface. Also on the Details tab, select the following options: Create Tables for Different Company Append f if Table Exists Ignore Referential Integrity Checks

Exchange User Guide 8-1

Generic Exchange Scheme

On the Files tab, select Sequential File has Fixed Record Length. On this tab you also define: %PBO()$BSE/lib/exchange%PBO() directory in the Directory for Searching Table Files field.

%PBO()generic.err%PBO() in the Name of the Error File field.

Use the Exchange Schemes (tuxch0501m000) session to make sure you do not already have an exchange scheme called generic in the specified company, because that is the name of the Generic Exchange Scheme that will be created. If you already have an exchange scheme generic you can rename it using the Copy Exchange Scheme (tuxch0201m000) session. Delete the old generic scheme using the Delete Exchange Scheme (tuxch0222m000) session.
4

Click the Create button to install the Generic Exchange Scheme. This adds the exchange scheme generic to your database. Next Baan prompts you to run the Reorganize Tables (ttaad4225m000) session. The field details that you need to give for this session are displayed below. Note: the company range should be the same as the one selected for the previous session.

Click the Reorganize button to start the process, and then Exit the sessions. The installation is complete, but before you can use it you must adapt the Generic Exchange Scheme to your environment and create the export/import program.

Exchange User Guide 8-2

Generic Exchange Scheme

Customize the Generic Exchange Scheme


1 2

Run the Batches (tuxch0104m000) session in the Exchange module. The field details are displayed in Figure 76, Batches, using the Generic Exchange Scheme. Change the field Company to your current working company or to any other company you want to use.

Figure 76, Batches, using the Generic Exchange Scheme

The Generic Exchange Scheme is the same as any other exchange scheme, so you can adapt it to your needs. Using the details session of Exchange Schemes (tuxch0501m000), you can specify the locations of exchange schemes, log files, and so on.

Run the Generic Exchange Scheme


To export one or more exchange schemes you must first run the Create Export Programs (tuxch0228m000) session for exchange scheme generic, batch EXPORT. Then you can run the actual export or import using the Export Data Non-Regular (tuxch0233m000) session or the Export or Import Data on a Regular Basis (tuxch0234m000) sessions. Both sessions are located in the Baan Exchange, Export Module. To import one or more exchange schemes you must first run the Create Import Programs (tuxch0227m000) session for exchange scheme generic, batch IMPORT. Then you can run the actual import using the Import Data NonRegular (tuxch0223m000) session or the Export or Import Data on a Regular Basis (tuxch0224m000) session. Both sessions are located in the Baan Exchange, Import Module.

Exchange User Guide 8-3

Generic Exchange Scheme

The Generic Exchange Scheme is just like any other exchange scheme. Refer to the online Help topics of Exchange for more information on adapting and using exchange schemes.

Exchange User Guide 8-4

You might also like