U7137A US

148
BaanERP Exchange User Guide

description

Baan 5 Erp

Transcript of U7137A US

Page 1: U7137A US

BaanERP

Exchange User Guide

Page 2: U7137A US

A publication of:

Baan Development B.V.P.O.Box 1433770 AC BarneveldThe Netherlands

Printed in the Netherlands

© Baan Development B.V. 1999.All rights reserved.

The information in this documentis subject to change withoutnotice. No part of this documentmay be reproduced, stored ortransmitted in any form or by anymeans, electronic or mechanical,for any purpose, without theexpress written permission ofBaan Development B.V.

Baan Development B.V.assumes no liability for anydamages incurred, directly orindirectly, from any errors,omissions or discrepanciesbetween the software and theinformation contained in thisdocument.

Document Information

Code: U7137A USGroup: User DocumentationEdition: ADate: September, 1999

Page 3: U7137A US

i

Exchange User Guide

1 Introduction 1-1Exchange compared to Database Management 1-2To design a data exchange 1-2To activate the data exchange 1-3The Exchange modules 1-3

2 Master Data 2-1Data exchange based on audit 2-1How to set up a data exchange 2-1The Master Data sessions 2-2Exchange schemes (tuxch0501m000) 2-3ASCII files (tuxch0102m000) 2-9ASCII file fields (tuxch0503m000) 2-10Batches (tuxch0104m000) 2-13Conditions (tuxch0114m000) 2-14Parameters by Condition (tuxch0113m000) 2-17

3 Import module 3-1Introduction 3-1Regular and non-regular data exchange 3-1To use the Data Access Layer 3-2Start and end date and time 3-3During the data exchange 3-3How to set up an import process 3-4The Import module sessions 3-5Table Relations (Import) (tuxch0521m000) 3-5Field relations (import) (tuxch0522m000) 3-10Conversion Tables (tuxch0105m000) 3-16Conversions per Field (tuxch0105m000) 3-17Create Import Program (tuxch0227m000) 3-19Import Data (on a Regular Basis) (tuxch0224m000) 3-21Import Data (Non-Regular) (tuxch0223m000) 3-24

4 Export module 4-1To set up an export process 4-1The Export module sessions 4-2Table Relations (Export) (tuxch0531m000) 4-2Field Relations (Export) (tuxch0531m000) 4-6

Table of contents

Page 4: U7137A US

Table of contents

Exchange User Guide

ii

Ranges (tuxch0112m000) 4-9Create Export Programs (tuxch0228m000) 4-11Export Data (on a Regular Basis) (tuxch0234m000) 4-12Export Data (Non-Regular) (tuxch0233m000) 4-15To check the results 4-18

5 Multisite control 5-1Audit trail 5-1About multisite exchange in Baan 5-2The export process 5-2The Export Done message 5-3File transport specifications 5-3The import process 5-3The Import Done message 5-4How to set up a multisite exchange 5-5The Multisite Control sessions 5-5Environments (tuxch4100m000) 5-5Exchange Links (tuxch4501m000) 5-6Activate/Deactivate Exchange Links (tuxch4201m000) 5-9Resend Rejected Messages (tuxch4203m000) 5-12Subscriptions (tuxch4502m000) 5-16Receive Remote Procedure Calls (tuxch4200m000) 5-18

6 Generate Exchange Scheme 6-1Introduction 6-1The Generate Exchange Scheme sessions 6-4Exchange Companies (tuxch0150m000) 6-4Exchange Groups (tuxch0151m000) 6-6Table Details (tuxch0152m000) 6-7Field Details (tuxch0153m000) 6-8Import Tables (tuxch0154m000) 6-10Import Fields (tuxch0155m000) 6-12Update Field Data per Exchange Group (tuxch0255s000) 6-13Generate Exchange Scheme (tuxch0251m000) 6-14Generate Authorizations (tuxch0256m000) 6-15

7 Miscellaneous 7-1The Logging sessions 7-1Print Log File (tuxch0215m000) 7-2Remove Log Files (tuxch0216m000) 7-4Log Table (Batch Level) (tuxch0508m000) 7-5Log Table (Batch Line Level) (tuxch0509m000) 7-7Clear Log Table (tuxch0208m000) 7-9The Tools sessions 7-10

Page 5: U7137A US

Tahle of contents

Exchange User Guide

iii

Copy Exchange Scheme (tuxch0201m000) 7-10Delete Exchange Scheme (tuxch0222m000) 7-12Rename ASCII File (tuxch1202m000) 7-13Create ASCII File Fields and Relations (tuxch0203m000) 7-14Create Definition Files (tuxch0204m000) 7-16Print ASCII File (tuxch0202m000) 7-18Remove ASCII Files (tuxch2202m000) 7-19Check Syntax of Conditions (tuxch0206m000) 7-20Predefined Functions/Variables (tuxch0510m000) 7-21Print Exception Report for Baan Fields (tuxch0423m000) 7-24The Conversion sessions 7-25The procedure for converting data 7-25Types of conversion 7-25Procedure 7-26Conversion with Customization 7-27Convert Exchange Schemes from 6.1a (tuxch9211m000) 7-29Domains 7-29Separator 7-30Convert Conditions 7-30Replace Conditions 7-32Log file 7-32Conditions from 6.1a (tuxch0511m000) 7-36

8 Generic Exchange Scheme 8-1To install the Generic Exchange Scheme 8-1Customize the Generic Exchange Scheme 8-3Run the Generic Exchange Scheme 8-3

Page 6: U7137A US

Table of contents

Exchange User Guide

iv

Page 7: U7137A US

Exchange User Guide

v

This guide is intended to assist developers who need to transfer data in and out ofBaan applications. It is assumed that users have a thorough knowledge of thedata model structure of the Baan system and of the Baan application. Usersshould also be familiar with the basic programming concepts of 3GLprogramming, ASCII files, and applications such as Microsoft Excel.

This guide fully describes the Exchange module in Baan and how to use it. Eachmodule in Exchange is described in a chapter in this guide. Each chapter beginswith a description of the module. Next, are sections that describe all of thesessions in each module. Each session description contains the following:

n An overview of the sessionn The procedure for using the sessionn A picture of the session in Baann 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 briefoverview of the Exchange module in Baan.

Chapter 2, “Master Data,” describes how to set up an exchange scheme, which isthe basis for all data exchanges.

Chapter 3, “Import module,” describes how to set up an import of data into aBaan application.

Chapter 4, “Export module,” describes how to set up an export of data from aBaan application to another application.

Chapter 5, “Multisite control,” describes how to set up data exchanges betweenmultiple companies.

Chapter 6, “Generate Exchange Scheme,” describes how to set up an exchange ofdata 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.

About this document

Page 8: U7137A US

About this document

Exchange User Guide

vi

Page 9: U7137A US

Exchange User Guide

1-1

You can use the Exchange (XCH) module to import and export data to and fromBaanERP. Data is imported and exported by writing to and reading frominformation contained in ASCII files. ASCII files can be in various formats tosupport exchange of data between third-party applications, databases, andspreadsheets.

The exchange module has these primary purposes:

n To import data for conversions from other systems and from prior releases ofBaan

n To exchange data with other applications

n To interchange data between BaanERP companies to support multisiteorganizations

Exchange is not recommended, however, when you are only transferring smallnumbers of records, or transferring whole tables where you do not need toperform any data manipulation.

BAAN

Exchange

export

ASCII file

ASCII file

BAAN data

import

Figure 1, The Exchange module in Baan

1 Introduction

Page 10: U7137A US

Introduction

Exchange User Guide

1-2

Exchange compared to DatabaseManagementThe Database Management module of Baan Tools also provides the ability tocreate ASCII files from Baan data and to load data from an ASCII file intoBAAN. You can use these tools for basic data exchanges that do not require anyspecial handling. These tools are contained in the Create Sequential Dump ofTable (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 Baancompany to another.

The main difference between the Database Management and Exchange modulesis that the Exchange module provides more flexibility in specifying which datamust be read or written and in which format. In the Database Managementmodule you must import or export whole tables. The advantages of using theExchange module instead of the database tools include the ability to:

n Specify the exact data to be exchanged by table and field

n Convert and calculate data during an exchange

n Export based on an audit, only the data that has changed since the lastexchange

n Specify the order in which fields are imported

n Read data from other tables

To design a data exchangeThe way that you design your exchange scheme depends on how often you wantto 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 schedulefrequent updates so that you have a near real-time environment. On the otherhand, you might want to schedule less frequent updates if it is more important tokeep communication costs down.

If your data only needs to be updated when there are predictable changes, youcan schedule the exchange accordingly. For example, if the stock data onlychanges when an inventory control is done at the end of the month, you onlyneed to run an exchange after the inventory control is performed.

Page 11: U7137A US

Introduction

Exchange User Guide

1-3

For less frequent changes, or if the changes are not predictable, you can alsoperform the exchange on demand instead of on a fixed schedule.

Not all sites require updates of all data, and you can minimize yourcommunication costs by exactly specifying the data to be exchanged. Forexample, all bank sites need to have up-to-date currency exchange rates, but allsites do not need to have all the customer data for the entire bank.

To activate the data exchangeAfter the exchange information is set up, you can manually activate the actualimport or export process or it can be activated by the job manager. You can alsocreate an export file based on audit information. This is typically used for dataexchange in a company. Figure 2 shows the relation between the Exchangemodule, the job manager, and the audit manager.

Audit files

Audit manager

Exchange module

Job manager

BAAN data

ASCIIFiles

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

The Exchange modulesExchange contains the following modules:

n Master Datan Import Modulen Export Modulen Multisite Controln Generate Exchange Schemen Miscellaneous

Page 12: U7137A US

Introduction

Exchange User Guide

1-4

You can enter the general characteristics of the exchange process in the MasterData module. This information contains parameters and directories. The MasterData module also defines the layout of the ASCII file.

In the Import module and the Export module, you specify the structure of theASCII files and the relationship to the Baan tables. These modules contain theactual import and export processes as well.

Use the Generation of Exchange Scheme module to specify the desiredfunctionality of an exchange scheme. AanERP uses this information to create anexchange scheme and its related import data. The data can also be used to generatedatabase authorizations in the Baan Tools Database Authorizations.

Use the Multisite Control module to set up a batch-driven replication server. Thisallows 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 theMiscellaneous module to query the results and status of previous export andimport processes.

Page 13: U7137A US

Exchange User Guide

2-1

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. Theprocedure consists of setting up the exchange scheme and file layout for theexchange, and then performing the actual import and/or export of data to andfrom ASCII files.

An exchange scheme defines the general parameters used during an import orexport such as the location of files, use of an audit trail, and other defaultsettings. The exchange scheme contains all definitions of data that must beimported or exported. The ASCII files, conditions, batches, table and fieldrelations, ranges, and conversions are grouped together in an exchange scheme.

The result of an import process is the data imported into Baan tables, and theresult of an export process is the Baan data exported to ASCII files. You can thenuse these ASCII files in different applications to import data that originated inBaan.

Data exchange based on auditThe data exchange can be based on an audit. In an export, this means that onlychanges in the table are exported, as opposed to the entire table. The exportprovides information on insertions, updates, and deletions. When import is basedon an audit, the insertions, updates, and deletions are processed in the importingcompany. In order to export based on an audit, the audit must be turned on forthe 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 exchangeBoth 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 thefollowing steps:

1 Define an exchange scheme.

2 Define an ASCII file.

2 Master Data

Page 14: U7137A US

Master Data

Exchange User Guide

2-2

3 Define the fields for the ASCII file.

4 Create a batch.

5 Add conditions if necessary.

To export or import Baan data, you begin by setting up an exchange schemeusing the Exchange Schemes (tuxch0501m000) session in the Master Datamodule.

Because other applications store data in different formats, Baan cannot alwaysdirectly exchange data with them. The best way to perform a data exchange is toconvert data into ASCII text, which is readable both by Baan and otherapplications. The Exchange module handles the conversion of data between Baanand ASCII, the selection of the data, and the sequencing of the data in the ASCIIfile.

After you have created an exchange scheme, you define the ASCII file to whichyour exchange scheme will export or import data. You do this using the ASCIIFiles (tuxch0102m000) session.

The ASCII file consists of fields. You define the fields contained in the ASCIIfile 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. Eachexchange scheme can contain more than one batch. A batch is a group of relatedtable operations. When you have defined the batches, you can run the export orimport by batch, instead of running the entire exchange scheme at once.

If necessary, you can write scripts to further customize the exchange, and addthem to your exchange scheme as conditions.

The Master Data sessionsFollowing are the sessions included in the Master Data module:

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

Page 15: U7137A US

Master Data

Exchange User Guide

2-3

Exchange schemes (tuxch0501m000)

Use the Exchange Schemes (tuxch0501m000) session to view and maintainexchange 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 menuto start the following sessions:

n ASCII Files (Ctrl+Shift+A)Starts the ASCII Files (tuxch0102m000) session.

n Batches (Ctrl+Shift+B)Starts the Batches (tuxch0104m000) session.

n Conditions (Ctrl+Shift+C)Starts the Conditions (tuxch0114m000) session.

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

Follow this procedure to set up an exchange scheme:

1 Choose FileÅNew to display the Exchange Schemes (tuxch0101s000)details session.

2 Enter the name and description of the exchange scheme you are creating.

3 Enter the full path of the directories where Exchange files are to be stored.

4 Set up the ASCII file configuration, indicating whether the exchange is to bebased on audit, based on indicators, and how the fields in the ASCII file areseparated.

5 If this exchange scheme is copied from an existing exchange scheme, enterthe parent exchange scheme on the Special tab.

6 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 defaultsubdirectory.

7 Enter the settings for text, multibyte, float, and log.

Page 16: U7137A US

Master Data

Exchange User Guide

2-4

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

Figure 3, Exchange Schemes, Display

Figure 4, Exchange Schemes, New, General tab

Page 17: U7137A US

Master Data

Exchange User Guide

2-5

Figure 5, Exchange Scheme, New, Special tab

Exchange Schemes (tuxch0101s000)

Field Description

General tab

ExchangeScheme

Enter the name of the exchange scheme.

Description Enter a description of the exchange scheme.

Paths

ExchangePrograms

Enter the absolute path name (starting from the rootdirectory) of the directory in which to write Exchangeprograms. Exchange uses the path name entered here onall the fields where the path name is required.

Errors / Log Files Enter the absolute path name (starting from the rootdirectory) of the directory for error files and log files.Exchange uses the path name entered here on all the fieldswhere the path name is required.

ASCII Files Enter the absolute path name (starting from the rootdirectory) of the directory for ASCII files. Exchange usesthe path name entered here on all the fields where the pathname is required.

Definition Files Enter the absolute path name (starting from the rootdirectory) of the directory for definition files. Exchange usesthe path name entered here on all the fields where the pathname is required.

Page 18: U7137A US

Master Data

Exchange User Guide

2-6

ASCII File Configuration

Based on Audit Select to export only the changed data, that is, data that isimported or exported from audit files instead of BaanERPtables. 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. Thisoption only shows that an audit is carried out on one ormore tables that are imported or exported. Baan does notcheck whether audit is set for the tables to be exported.You can overrule the audit procedure for batches in anexchange scheme by using the Batches (tuxch0104m000)session. For example, the audit is overruled if a batchcontains tables that do not use the audit procedure.

Based onIndicators

Select to include an indicator to display whether thefollowing record is an audit action code. Codes include:I = insert or addd = deleteu = update or modifyn = new valueIf Based on Audit is selected, this option is alsoautomatically selected. You can also select this optionindependently, which allows Exchange to receiveinformation from other systems that also produce netchange reports.

SeparatorCharacter

Enter a value here if you want to use variable-length fieldsin the ASCII file. The value you enter here is used toseparate the ASCII file fields. The default is fixed-lengthfields.Allowed values are characters such as \, ], ^, and _, andletters in the range [A-Z] if the Control Character check boxis selected. Do not use characters that are used in the datafields that have to be exchanged.

Control Character If a control character is part of the separator character,enter its value here.This option is only activated if Separator Charactercontains a value, indicating that the ASCII file field usesvariable lengths.

Enclosingcharacter

Enter the character you want to use to enclose strings, forexample, string.

Default DateFormat

Define the default format for the date. The date format isdefined per field in the ASCII file that is used in anexchange scheme. If no date format is defined for an ASCIIfile field, the Default Date Format is selected.If the ASCII file field is created by using BaanERP auditfiles, the Default Date Format is set to BaanERP Number.

Page 19: U7137A US

Master Data

Exchange User Guide

2-7

Special tab

Parent ExchangeScheme

Enter the name of the exchange scheme that is used as theparent in a multilevel exchange scheme. A parentexchange scheme is useful if you want to make smallchanges to an existing exchange scheme. You only copythose parts of the scheme that you want to change. Thebatches and table relations that you do not copy areinherited from the parent exchange scheme.

Overrule Subdirectories

Regular ImportDirectory

Enter the subdirectory that must overrule the defaultsubdirectory for a data import on a regular basis. Thisenables you to use the same directory for import and exporton a regular basis. If the run numbers of the import andexport run are identical, you need not move the ASCII files.During a data export on a regular basis, if an OverruleSubdirectory is not specified, the ASCII files are placed inthe default subdirectory (<exchange scheme>.<runnumber>.i). If an Overrule Subdirectory is specified, thespecified directory is used instead.If the overruling subdirectory already contains files, they areoverwritten.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 filename specified in the Table Relations (Import)(tuxch0121s000) session does not contain an absolutepath.

Regular ExportDirectory

Enter the subdirectory that must overrule the defaultsubdirectory for a data export on a regular basis. Thisenables you to use the same directory for import and exporton a regular basis. If the run numbers of the import andexport run are identical, you do not have to move the ASCIIfiles.During a data export on a regular basis, the ASCII files areplaced in the default subdirectory (<exchangescheme>.<run number>.i).If the overruling subdirectory already contains files, theASCII file is placed in the default directory <exportsubdirectory>.<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 filename specified in the Table Relations (Import)(tuxch0121s000) session does not contain an absolutepath.

Page 20: U7137A US

Master Data

Exchange User Guide

2-8

Text, Multibyte, Float, and Log settings

Increase TextNumber

Select to increase the text numbers when the text tablesare imported. Otherwise the text numbers remain the same.Existing texts are overwritten if this is allowed in the tableand field relations. Thus, text tables are handled like othertables.

MultibyteConversions

Select to convert table field datatypes from multibyte stringto the local character type. The conversion is done directlyafter reading the characters in the ASCII file during a dataimport. When you export, a conversion is done just beforethe value is written to the ASCII file. Errors during multibyteconversions are not logged.

ConvertFloats/Doubles

Select to convert the values of the db.float and db.doubletable fields. Use this option if you have trouble exportingdata based on the audit procedure in a client/serverenvironment that combines a non-Intel application serverwith an Intel database server.

Do AdditionalLogging

Select to perform additional logging. During a data exportbased on audit, transactions performed on the database inthe same second are logged. This is because Baan doesnot know the correct sequence in which the transactionswere done on the import site. Additional logs are used tocheck the transactions. The additional log file is placed inthe same directory as the normal log file and has the .tranextension.Do not select this check box if additional logging is notrequired. Logging is time-consuming and reducesperformance.

ExchangeScheme Text

Indicates whether this exchange scheme includes text.

Page 21: U7137A US

Master Data

Exchange User Guide

2-9

ASCII files (tuxch0102m000)

Use the ASCII Files (tuxch0102m000) session to maintain logical ASCII files inan exchange scheme. You can do this automatically or manually.

If you use the name of a Baan table for the ASCII file name, Baan canautomatically 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.

n 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 Define a unique logical ASCII file name with a description.

2 In the Definition File field, define a definition file from which used to copythe ASCII file fields.

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

Figure 6, ASCII Files

Page 22: U7137A US

Master Data

Exchange User Guide

2-10

ASCII Files (tuxch0102m000)

Field Description

ASCII File Enter the name of the ASCII file.

Description Enter a description of the ASCII file.

Definition File Enter the name of the definition file, if you are using one. Adefinition file is used to load preset ASCII file formatinformation into the current ASCII file. Baan normally getsthis definition file from another Baan system that has usedthe exchange tools to export some data. You can make adefiniton file by using the Create Definition Files(tuxch0204m000) session. You can reuse definition files inother ASCII files.

You can also leave this field blank, in which case Baanuses the definition file that you enter in the ASCII FileFields (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 theASCII File Fields (tuxch0503m000) session to list the available ASCII file fieldsin a logical ASCII file.

The ASCII file fields define the layout of the ASCII file and are identified by aunique 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 generatethe ASCII file fields. You might need to modify the file formats manually,however, if you are converting data or upgrading to a new release.

n Recalculate Start PositionsChanges all the start positions in an ASCII file having variable-length fields.

Follow this procedure to define the ASCII file fields:

1 Choose FileÅNew to display the ASCII File Fields (tuxch0103s000) detailssession.

2 Enter a new field number, giving it a logical sequence number.

3 Enter the name and description of the ASCII file field you are creating.

Page 23: U7137A US

Master Data

Exchange User Guide

2-11

4 Select the field type. If you select Numeric, also enter the numericformatting.

5 Enter the start position and length of the fields.

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

Figure 7, ASCII File Fields

Figure 8, ASCII File Fields, New

Page 24: U7137A US

Master Data

Exchange User Guide

2-12

ASCII File Fields (tuxch0103s000)

Field Description

Field Number Enter a field number for the ASCII file field. If a fieldseparator is used, ASCII file fields are positioned accordingto this number. The field separator is defined in theExchange Schemes (tuxch0101s000) session.

What is important is not the actual field number, but theorder of fields specified by the field number. Use numberssuch as 10, 20, 30, which makes it easier to insert fieldnumbers at a later stage.

ASCII Field Enter the name of the ASCII file field. Baan automaticallyfills in this field if you use a data definition file of the ASCIIfile or BaanERP table. The ASCII file field is associatedwith the data found in a certain column in the physicalASCII file. These fields are mapped to BaanERP tables onthe import and export file relation sessions.

Description Enter a description of the conversion code.

Field Type Indicate whether the data type of the ASCII field isalphanumeric, numeric, or multiline text.

Field Dimensions

Start Position Enter the column number in an ASCII file where the ASCIIfile field starts. The start position declares the position ofthe data in the physical ASCII file.

If no field separator is defined in the details session of theExchange Schemes (tuxch0501m000) session, you mustspecify the start position.

Length Specify the length of a variable-length ASCII file field aseither numeric or alphanumeric. You do not need to specifythe length of a fixed-length field.

The length of an ASCII file field that represents a multilinetext is zero.

Numeric Format

Date Format Define a date format for a numeric field in an ASCII file. Ifno date format is defined for an ASCII file field, the DefaultDate Format is used.

Floating Decimal Select to be able to place the decimal point at any positionin the ASCII file field without the decimal actually beingpresent. The number of digits after the decimal point mustbe specified in Number of Digits after Decimal.

Number of Digitsafter Decimal

The number of digits after a floating decimal point defineswhere the decimal point is placed in a numeric field. Thisfield is only activated if Floating Decimal is selected.

Page 25: U7137A US

Master Data

Exchange User Guide

2-13

Batches (tuxch0104m000)

Use the Batches (tuxch0104m000) session to create the available batches for anexchange scheme. A batch is used to group operations on related tables and isidentified by a unique code. An exchange scheme can contain one or morebatches. The exchange process can run by batch, which means that the entireexchange 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.

n Table Relations (Export) (Ctrl+Shift+2)Starts the Table Relations (Export) (tuxch0531m000) session.

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

Follow this procedure to create a batch:

1 Define a unique code, sequence number, and description for the batch.

2 Enter the company number that contains the data to be exported during anexport procedure, or the company number to which the data must be writtenduring an import procedure.

3 If the exchange process is based on audit logs, select Exchange Based onAudit.

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

Figure 9, Batches

Page 26: U7137A US

Master Data

Exchange User Guide

2-14

Batches (tuxch0104m000)

Field Description

Batch Enter a batch name.

SequenceNumber

Enter a number to determine the order in which the batchesare processed.

Description Enter a description of the batch.

Company Enter the company that receives or produces the tablesaffected by the transactions. The company number enteredhere must have the same package combination as thecurrent company.

Based on Audit Select if you want the physical ASCII file to be exportedfrom the audit logs instead of from the Baan tables.Exporting from audit logs means that only updated data isexported. Exporting from the Baan tables means that all thedata contained in those tables is exported.

Text Indicates whether this batch includes text.

Conditions (tuxch0114m000)

Use the Conditions (tuxch0114m000) session to list the available conditions foran 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 AddRecord or Stop Condition), to supply a value for a table field during an import, orto supply a value for an ASCII field during an export.

You write conditions in Baan 3GL code by using the Baan text editor. You onlyneed to write the body of the function because the script generators add thefunction header and enclosing braces automatically. To learn more about theBaan 3GL code, see the Programmers Manual.

When you use a condition as a guard action, Baan expects the return value to bea Boolean true or false. This type of condition is used at the table-relation level tocontrol actions concerning the entire record and is used at the field level tocontrol the concept of overwrite. There are five such conditions and all of themcontrol aspects of the import process. Four of them are included in the TableRelations (Import) (tuxch0521m000) session and the fifth is included in the FieldRelations (Import) (tuxch0522m000) session.

Page 27: U7137A US

Master Data

Exchange User Guide

2-15

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 issuccessfully completed, Script and Syntax OK are automatically selected.

n Parameters by Condition (Ctrl+F1)Starts the Parameters by Condition (tuxch0113m000) session.

Follow this procedure to create a condition:

1 Define a unique condition code, description, and condition type.

2 Define the corresponding domain for conditions with the Enumerate and Setcondition type.

3 Click the Text button on the toolbar to write the condition script.

Predefined functions and variables are available in the PredefinedFunctions/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

Page 28: U7137A US

Master Data

Exchange User Guide

2-16

Conditions (tuxch0114m000)

Field Description

Condition Enter the name of the condition.

Description Enter a description of the condition.

Type Choose the datatype of this condition.

Domain Enter the domain that corresponds to this condition.

Script Indicates whether a script is present. You can add a scriptby choosing EditÅText or by clicking the T button on thetoolbar.

Syntax OK Indicates whether the syntax of the condition script hasbeen checked. To select the syntax check, choose SpecialÅCheck Syntax.

Page 29: U7137A US

Master Data

Exchange User Guide

2-17

Parameters by Condition (tuxch0113m000)

Run the Parameters by Condition (tuxch0113m000) session to list the parametersused in a condition script of an exchange scheme.

The ASCII file fields of a record to be imported or exported are not automaticallydefined in a condition script. To use the value of an ASCII file field you must usethat field as a parameter in the condition script. The parameter name must be thesame as the ASCII file field name in the record to which it refers.

Follow this procedure to create a parameter:

1 Define a unique parameter name.

2 Select a parameter type.

Figure 11, Parameters by Condition

Parameters by Condition (tuxch0113m000)

Field Description

Parameter Enter the name of the parameter. The parameter namemust be the same as an ASCII field name.

Parameter Type Enter either numeric or alphanumeric for the parametertype.

Page 30: U7137A US

Master Data

Exchange User Guide

2-18

Page 31: U7137A US

Exchange User Guide

3-1

IntroductionTo exchange data between two Baan companies, you export the Baan data toASCII files, and then import the data into the Baan database. Exchange can usethe same master data information for import that it uses for export, because theASCII file format must be the same.

If data must be modified during an import, you can use a conversion. TheExchange module includes three options: condition scripts, conversion tables,and constant values. You can include a formula with the script to calculate newvalues based on the contents of the ASCII file or data from other Baan tables.

Regular and non-regular data exchangeYou can import and export data in Baan on either a regular or a non-regularbasis. 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-neededbasis. 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 Import Data (on a Regular Basis) (tuxch0224m000)n Import Data (Non-Regular) (tuxch0223m000)n Export Data (on a Regular Basis) (tuxch0234m000)n Export Data (Non-Regular) (tuxch0233m000)

Non-regular data exchange is useful when critical data has changed that needs tobe updated, or when not all of the data has changed and you want to update onlythe changed data. Non-regular data exchange is also used when you want to testan exchange scheme before approving it for regular data exchange. For a non-regular data exchange, you can select a range of batches or a range of batchsequence numbers to import. The data exchange is restricted to these ranges.

3 Import module

Page 32: U7137A US

Import module

Exchange User Guide

3-2

Regular data exchange is used when you want to maintain several sites whosedata changes periodically. Regular data exchange is also useful in multisitesituations where it is critical that no run is lost, overwritten, imported twice, orimported in the incorrect order. Only complete exchange schemes can beimported 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 andconsecutive for a combination of exchange scheme and exchange type and isbased on the contents of the log table. Each redo is stored under a new trynumber, which is unique within a run number, exchange scheme, and exchangetype combination.

Regular and non-regular data exchange differ in where they place the physicalASCII files. A non-regular data exchange places the data in the sequential filedirectory, named at the exchange scheme level, in a file named in the TableRelations (tuxch0531m000) session. A regular data exchange builds an extradirectory for each run of an export in order to retain a history of all exportedfiles.

To use the Data Access LayerDuring an Exchange import, you can use all the functionality programmed intothe Data Access Layer (DAL). If you use the DAL, Exchange carries out all theconstraint checks, integrity checks and side effects, such as updates on othertables, that are programmed into the DAL. Database integrity is guaranteedautomatically.

Using the DAL reduces the costs of interface development. You can use the DALto import standard interfaces developed by Baan for partner products, as well asfor specific interfaces built by customers, for example, to integrate BaanERPwith legacy systems. You can use the DAL in both single site and multisiteenvironments.

The checks or additional actions specified in the DAL are carried out for eachrow that is imported. Database errors are logged in the same way for DAL andnon DAL import. DAL hook errors are also logged. You can specify whether theDAL 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 anddb.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. Theimport through DAL works for both the import based on audit or indicators(inserts, updates, deletes), and the full import (inserts only).

Page 33: U7137A US

Import module

Exchange User Guide

3-3

DAL settings are run time aspects, which means you can change them withouthaving to regenerate the import program. DAL settings are also logged in the logtable at batch line level, to enable you to find out what the DAL settings werewhen the import was run.

It is important to realize that an update through the DAL can result in a numberof side effects. Actions done by the DAL should not be twice. For example, if theDAL updates the ‘available to promise’ (ATP) quantity for an item whenimporting order data, the ATP quantity should not be updated in a conditionscript as well.

You should therefore not add any actions in condition scripts, or importadditional data, that are already handled in the DAL.

Start and end date and timeFor regular data exchange, the start date and time are taken from the log tableand normally you cannot specify it. If the start date and time are the same for allselected exchange schemes, they are displayed. The first time an exchangescheme is exported using audit files is the only time you can fill in the start dateand time yourself.

For non-regular data exchange, you can specify whether the start date and time isbased on the contents of the log table. This is useful when not all selectedexchange schemes have the same latest end date and time.

You can fill in the end date and time for both regular and non-regular dataexchange.

During the data exchangeWhen you have completed the data exchange session and choose Import Data orExport Data, a status window appears and displays the progress of the dataexchange. For each batch line that completes, Baan displays the exchangescheme, 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 viewthe imported or exported data, use the Display Log Tables (Batch line level)(tuxch0509m000) session. This session shows the number of records processedfrom the ASCII file, the number of records imported successfully and the numberof records rejected due to an error or a condition.

Page 34: U7137A US

Import module

Exchange User Guide

3-4

If records are rejected due to validation checks or errors, BaanERP writes themto a log file. You can redo the data exchange for those rejected records only. Youcan use the Print Log File (tuxch0215m000) session to print the rejected recordsstored in the log file.

BaanERP verifies the imported values according to the referential integrity andvalidation rules, such as field type, length, range, and format. This information isavailable in the data dictionary.

How to set up an import processTo import data, you start by setting up an exchange scheme as described inChapter 2, “Master Data.” Then you go on by defining the details of the tables tobe imported.

You begin by creating the relationship at the table level between the BaanERPtables and the ASCII files by using the Table Relations (Import)(tuxch0521m000) session. You then create the relationship at the field level, bysetting up the relations between logical ASCII file fields and BaanERP tablefields. 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 theother. 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, youneed to compile an object that Exchange can use to run the import. You do thisby 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 ImportData (on a Regular Basis) (tuxch0224m000) session.

Following are the sessions included in the Import module:

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

Page 35: U7137A US

Import module

Exchange User Guide

3-5

The Import module sessions

Table Relations (Import) (tuxch0521m000)

Run the Table Relations (Import) (tuxch0521m000) session to create a relationbetween BaanERP tables, logical ASCII files, and physical ASCII files per batchin an exchange scheme. In the table relation, you define the logical ASCII files towhich the data from the BaanERP table must be transferred, and you assign aname to the physical ASCII file.

You can also run an external program or a BaanERP session as part of anexchange scheme, instead of using the exchange import functionality for a tablerelation.

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.

n (De)activate Table Relations (Ctrl+Shift+G)Starts the (De)activate Table Relations (tuxch1221m000) session.

Follow this procedure to create a table relation:

1 Enter the sequence number, BaanERP table, logical ASCII file, and thephysical ASCII file name.

2 Select Active to make the relation active and define an execute condition.

3 Under Permitted Operations, specify the actions that are allowed for thistable relation, and the appropriate conditions.

4 Select Stop Condition to activate the stop mechanism and define theappropriate stop condition.

5 If you want to use the functionality programmed into the Data Access Layer(DAL), select Import via Data Access Layer.

6 If you want to use an external program, select External Program and enterthe program name in the following field. If you want to run a BaanERPsession, clear External Program and enter a session or object code in thefollowing field.

7 If one of the ASCII file fields is based on increment, enter the number of theindex.

Page 36: U7137A US

Import module

Exchange User Guide

3-6

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

Figure 13, Table Relations (Import), Display

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

Page 37: U7137A US

Import module

Exchange User Guide

3-7

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

Table Relations (Import) (tuxch0121s000)

Field Description

Table Relation(Import)

Enter the the number that represents the table relation inthe batch during an exchange process. The table relationshows the correspondence between a database table andan ASCII file.

SequenceNumber

Enter a number to determine the process sequence orderof the table relation in the batch during an exchangeprocess. The sequence number does not have to be uniquein a table relation. If two table relations with an identicalsequence number are used in a batch, the relation with thelower table relation number is processed first.

Baan table Enter the table that contains data from the ASCII file to beread during an import procedure. One batch line can onlyread one Ban table. If you need to use the same Baan tableto create more than one physical file, you can use multiplebatch lines. The different batch lines may or may not usethe same ASCII file layout.

Use multiple table relations to write data from more thanone 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.

Page 38: U7137A US

Import module

Exchange User Guide

3-8

ASCII file Enter the name of the ASCII file that contains data to betransferred to a BaanERP table during an importprocedure.To create the field relations of the table relationautomatically, the ASCII file name must be the same as theBaanERP table name. You can do this if you do not have adata definition file of the ASCII file.

The ASCII file name represents the logical ASCII file. Youcan 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 isto be written. The maximum length of the file name is 11characters.

The file name entered here is an extension of the defaultpath. The default path is defined in the Path for ASCIIFiles field under Paths on the General tab in the ExchangeSchemes (tuxch0101s000) session.

If this is an absolute path, the default path is not used. Ifthis is not an absolute path, the file is stored in the directoryfor sequential files as defined in the exchange schemeheader record.

Active Select the Active field to make the table relation active sothat it can be used for data processing in an importprocess. If this option is clear, the table relations are keptfor reference purposes but are not used during the importprocess.

You can also use it as a debugging tool by turning off alltable relations except one to test a new change. Select ifyou want to test the exchange scheme, a single tablerelation, or only a few table relations.

Execute Condition Use to check whether the table relation must be carried outwhen you run the import process. If the Active field isselected, Baan checks the execute condition beforerunning the table relation. If the execute condition returnstrue, the table relation is carried out.The execute condition is carried out before the tablerelation is started but after the previous table relations arefinished. If the import is based on audit or indicators, theexecute 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 specifiedcondition. If you generate a new execute condition, thecondition code is the ASCII file name with the extension.exe.

The execute condition must be of Boolean type.

Page 39: U7137A US

Import module

Exchange User Guide

3-9

Permitted Operations

Add Condition Select to import all inserts for which a record does not yetexist in the database. If you specify an add condition,Exchange only processes the records that meet the addcondition. If you do not specify an add condition, Exchangeprocesses all inserts.

Clear if you do not want Exchange to import inserts. Thiscauses Exchange to skip any record to be inserted.

For a full import, inserts consist of all records. For importbased on audit or based on indicators, inserts are recordshaving indicator i.

OverwriteCondition

Select to import all inserts for which a record does not yetexist in the database. If you specify an overwrite condition,Exchange only overwrites existing records if the records tobe imported meet the overwrite condition. If you do notspecify an overwrite condition, Exchange overwrites allexisting records.

Clear if you do not want Exchange to import inserts. Thiscauses Exchange to skip any record to be inserted.

For a full import, inserts consist of all records. For importbased on audit or based on indicators, inserts are recordshaving indicator i.

Update Condition Select to import all updates (records having indicator u). Ifno update condition is specified, all updates are processed.If an update condition is specified, only the records thatmeet the update condition are processed.

Clear if you do not want Exchange to import updates. Thiscauses Exchange to skip any record to be updated.

This field is only relevant when your exchange is based onaudit or on indicators.

Delete Condition Select to import all deletes (records having indicator d). Ifyou specify a delete condition, Exchange processes onlythe records that meet the delete condition. If you do notspecify a delete condition, Exchange processes all deletes.

Clear if you do not want Exchange to import deletes. Thiscauses Exchange to skip any record to be deleted.

This field is only relevant when your exchange is based onindicators or on audit.

Stop Mechanism Select if you want the import process to stop when thereturn value of the stop condition is true.

Page 40: U7137A US

Import module

Exchange User Guide

3-10

Stop Condition Enter a stop condition. A stop condition causes theexchange process to stop if the return value of the stopcondition is true. If the return value is false, the importprocess continues with the next batch line. The stopcondition is carried out at the end of each table relation.

You can automatically generate a stop condition, in whichcase the stop condition code is the same as the ASCII filecode with the .stp extension.

This condition is of the Boolean type.

Specific tab

Data Access Layer

Import via DataAccess Layer

Select to use the Data Access Layer (DAL) for the currenttable. By using the DAL, an import carries out all theconstraint checks, integrity checks and side effects, suchas updates on other tables, that are programmed into theDAL. This guarantees database integrity, savesprogramming time, and avoids the errors that can occur incondition scripts.

DAL propertychecks

Select to use the Data Access Layer (DAL) propertychecks. Using property checks is safer, but you can turnthem off to boost performance.

User Defined Program

External Program Select to use an external program and enter its name in thenext field. Clear to run a BaanERP session, and enter asession or object code in the following field.

Program Name Enter the name of the external program to be used, or entera session or object code to run a BaanERP session.

Sort on Index Enter the number of the index on which you want to sort.

Text Indicates whether this table relation includes 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 relationsbetween logical ASCII file fields and BaanERP table fields per batch in anexchange scheme. Use the details session to specify the data to be passed to thephysical ASCII files.

When you import data using Exchange, we recommend that you enter a record inthis session to represent all the fields in the table.

Page 41: U7137A US

Import module

Exchange User Guide

3-11

Baan fills in the value in the ASCII field automatically, using the logic from theBaan 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 theASCII file is identical to the BaanERP table code. Use this option if thedefinition file of the ASCII file is not available.

Follow this procedure to create field relations:

1 Choose FileÅNew to display the Field Relations (Import) (tuxch0122s000)details session.

2 Enter a serial number, giving it a logical sequence number.

3 Enter the name of the field for which you are creating field relations. If thefield is defined as an array in the data dictionary, enter the array elementnumber.

4 Define the field value, condition script name, and constant, if this field isusing them.

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

Figure 16, Field Relations (Import), Display

Page 42: U7137A US

Import module

Exchange User Guide

3-12

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

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

Page 43: U7137A US

Import module

Exchange User Guide

3-13

Field Relations (Import) (tuxch0122s000)

Field Description

Serial number Enter a serial number to make the field relation unique inthe table relation. The serial number is only used as anidentifier and does not have to be sequential. It is best touse intervals of 10 so that you can insert a new recordbetween existing records if that is where it logicallybelongs.

Baan Field Enter the name of the field to be updated in the Baan table.During import, Baan fills in the values of this field with datafrom a field in an ASCII file, based on the rules you definein the Based On field.

Array Element Enter the element number of an array field if the table fieldnamed in Baan Field is defined as an array in the datadictionary. The elements in an array can be filledindividually. The element number cannot exceed the arraydepth.

Based on

Field value Select to modify data in a field relation before the data of anASCII file field is transferred to the BaanERP table field. Inthe next field, enter the ASCII file field to be modified.

Conversion If you have selected Field value, enter the conversion tablefor the ASCII file field. Fill in the conversion parameters inthe Conversion Tables (tuxch0105m000) session.

Condition Enter the name of the condition you are using, if any. Youuse a condition either if the data to be imported resides in atable other than the table defined at the Table Relationlevel, or if the data does not exist in any Baan table. Youcan use a condition to access the different table or tablefields necessary to calculate the value that must beimported.

The conditions are created in the Conditions(tuxch0114m000) session.

Conversion If you have selected Condition, enter a conversion tablehere. Use a conversion code to modify data in a fieldrelation before the return value of a condition is transferredto the BaanERP table field.

You can create conversion tables in the Conversion Tables(tuxch0105m000) session.

Page 44: U7137A US

Import module

Exchange User Guide

3-14

Constant Select to load a constant value into a BaanERP table field.In the Conversion field that follows, enter the conversiontable that modifies the data in a field relation before theconstant value is transferred to the BaanERP table field.

When the Based On field is Increment, the value in thisfield is added to the start value when the higher fields of theprimary index remain constant.

Conversion If you have selected Constant, use this field to enter thename of the conversion table that modifies the field relationdata before the constant value is transferred to theBaanERP table field.

Conversion tables are created in the Conversion Tables(tuxch0105m000) session.

Increment Select to base the import on increment. The Baan field isincremented with the value in the Constant field.Increment can only be used for numeric fields that are partof the primary index.

Start Value Enter the initial value of the series for the Baan field. Youcan only maintain this field if the Based On field isIncrement. During processing, whenever one of the higherfields of the primary index changes, the Baan field is filledwith the Start Value.

Increment Value

Default Select to transfer the default value as defined in the datadictionary to the Baan Table field.

Text Indicates whether this field relation includes text.

Text/Conditions tab

Text Settings

Text Number

Append Text

Text Language

Text LanguageField

Permitted Operations

Overwrite Field Select to overwrite the field based on the condition definedin the following field. When an existing record is inserted, ifno condition is specified or if the return condition returnstrue, the field is overwritten.

Condition If the Overwrite Field is selected, enter a condition here.When an existing record is inserted, if the return value ofthe overwrite condition is true, the value of the field isoverwritten.

Page 45: U7137A US

Import module

Exchange User Guide

3-15

You can automatically generate a condition if you clickCreate/Edit. The condition for overwriting code containsthe ASCII file code with the .ovr extension.

The condition must be of the Boolean type. Preconditionsfor the overwrite condition are:

� The type of action is Insert.

� All ASCII fields are filled.

� The record already exists.

� BaanERP table fields are filled with this record.

Update Field Select to update a record when the return value of theupdate condition is true. Enter the update condition in thefollowing field.

Condition If Update Field is selected, enter a condition code. Thefield is updated when the return value of the updatecondition is true.

During an import based on indicators or an import based onaudit, records that must be updated start with the letter u.

You can automatically generate a condition if you clickCreate/Edit. In that case, the condition for overwriting codecontains the ASCII file code with the .upd extension.

This condition is of the Boolean type. Preconditions for theupdate condition are:

� The type of action is update (old values).

� ASCII file fields are filled: primary key fields of thesource table on the export site and values that arechanged.

� The record that must be updated exists.

� BaanERP table fields are filled with an existing record.

Page 46: U7137A US

Import module

Exchange User Guide

3-16

Conversion Tables (tuxch0105m000)

Data from other systems does not always match the data on the local Baansystem. For example, the local Baan system can refer to the English languagewith the code EN, while other systems use the code ENG or GB or US. Beforeyou use Exchange to load data into Baan, the data on the two systems must besynchronized.

You can use the Conversion Tables (tuxch0105m000) session to store therelationships between the old and new values of fields of data. By using theserelationships when importing data, Baan converts the old to new before writingthe rows.

The code you set up here can be used in the following sessions:

n Field Relations (Import) (tuxch0122s000)n Field Relations (Export) (tuxch0132s000)n Conversions per Field (tuxch0106m000)

Follow this procedure to set up conversion tables:

1 Choose FileÅNew to create a conversion relation. Enter its name anddescription.

2 To change a conversion relation, double-click the existing conversionrelation.

3 Choose the FileÅPrint to print the conversion relations.

Figure 19, Conversion Tables

Page 47: U7137A US

Import module

Exchange User Guide

3-17

Conversion Tables (tuxch0105m000)

Field Description

Relation Enter the relation name. All the relations for one exchangescheme are stored together in this table. In order for Baanto know which rules to use for a particular field, give thesame relation name to all translation rules that are logicallygrouped together.

Description Enter a description of the conversion table.

Old Value Enter the source system value.

New Value Enter the Baan 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 tableand field. You do this using the Conversions per Field (tuxch0106m000) session.

The Specific menu contains this option:

n Load Conversions per FieldConversions per Field (tuxch0106m000) session, which you can use toconvert data in BaanERP table fields according to a conversion table.

Follow this procedure to create a conversion:

1 Choose FileÅNew to create a new conversion for a BaanERP table.

2 Enter the exchange scheme for which you want to create conversions.

3 Enter the names of the Baan table, field, and conversion relation.

Page 48: U7137A US

Import module

Exchange User Guide

3-18

4 To change an existing conversion, double-click on an existing conversion fora BaanERP table field.

Figure 20, Conversions per Field

Conversions per Field (tuxch0106m000)

Field Description

Baan Table Enter the name of the table whose contents are to beconverted. This overrides the rule in the Field Relations(Import) (tuxch0522m000) session.

Baan Field Enter the field whose contents are to be converted. Thisoverrides the rule in the Field Relations (Import)(tuxch0522m000) session.

Conversion Enter the field to be used during data exchange.

Page 49: U7137A US

Import module

Exchange User Guide

3-19

Create Import Program (tuxch0227m000)

To be able to use an exchange scheme, you must pull together all the data in thesessions you have just filled, put the data into one program script, and compilethe 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 usingthe Print ASCII File (tuxch0202m000) session. This enables you to see, forexample, that separators are correct and whether any data needs to be converted.

Follow this procedure to create an import program.

1 Enter the range of exchange schemes and batches for which you want tocreate import programs.

2 Specify the compile options.

Figure 21, Create Import Programs

Page 50: U7137A US

Import module

Exchange User Guide

3-20

Create Import Programs (tuxch0227m000)

Field Description

Selection Range

ExchangeScheme

Enter the exchange scheme to be compiled.

Batch Enter the batch number of the exchange scheme.

Compile Options

Compile in DebugMode

Select to go through a condtion script step by step.

Compile withProfiler

Select to compile with the profiler. After the import has run,the Profiler generates a report that provides informationabout the performance time required for each function.

Display Errors Select to get a detailed list of errors showing the exactproblem with each line of code.

Page 51: U7137A US

Import module

Exchange User Guide

3-21

Import Data (on a Regular Basis) (tuxch0224m000)

Use the Import Data (on a Regular Basis) (tuxch0224m000) session to run theimport program to transfer data on a regular basis from sequential ASCII files toBaanERP tables. The import can also run as part of a batch job.

Follow this procedure to run the import program:

1 Select a range of exchange schemes.

2 Select the processing type.

3 Select the Overrule Batch Company check box if the data is imported froma company other than the batch company.

4 Enter another company if the current company is overruled.

5 Define the details of the import procedure in the Processing Details groupbox.

6 Click Import Data to start the import procedure.

7 Click Log Table to view the contents of the log table. A log table gives anoverview of the results of the import procedure.

Figure 22, Import Data (on a Regular Basis)

Page 52: U7137A US

Import module

Exchange User Guide

3-22

Import Data (on a Regular Basis) (tuxch0224m000)

Field Description

Selection Range

ExchangeScheme

Enter the name of the exchange scheme.

Processing Settings

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

n Restart previous runThis option allows you to import data by using the lastrun number over again. This field is usually used inthe Import Data (on a Regular Basis)(tuxch0224m000) session where each run numberprovides different data sets. The log files are the onlything that is affected in this session, because the datato be loaded into Baan is the same for both the lastrun number used and the first free run number.

n Reprocess rejected recordsWhen records are rejected during an import process,Baan creates two additional files to hold the rejectedrecords. Records that are rejected due to index ordomain errors (database problems) are placed in theRejected due to Error file and records that are rejecteddue to a condition returning a false status are placedin the Rejected due to Condition file. Baan placesthese files in the same directory as the data file thatwas read in and appends the suffixes .e01 or .c01 tothem. If more records are rejected duringreprocessing, Baan creates new files with the nextsequential number. When you choose this option, youcan use the next two fields to choose which records toreprocess.

n Continue interrupted runIf an exchange scheme run stops in the middle of therun, you can restart the import. You can only do this ifthere is more than one batch line and the restart canbegin at the start of the batch line that was notcompleted. If there is only one batch line, this option isthe same as a complete restart of the import.

Reprocessrejected due toerrors

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

Reprocessrejected due toConditions

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

Page 53: U7137A US

Import module

Exchange User Guide

3-23

Overrule BatchCompany

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

Company Enter the company to be used during this session insteadof the batch company. This field can only be defined ifOverrule Batch Company is selected.

Processing Details

Really Quit onStop Condition

Select to quit when the return value of a stop condition istrue. Clear if you want the import to continue running andwrite a message to the log file. The stop condition isdefined in the Table Relations (Import) (tuxch0121s000)session.

Wait for <CR>with Messages

Select to cause messages to remain on screen until youpress Enter. Clear if you want the import program tocontinue without any interaction from you. This option canbe used for an import that runs throughout the night.

Ignore Batches toImport

Select if you want the import to complete without checkingfor other import batches. This option can be used to testor run the import without using data that is waiting to beimported at the export site. This is useful when testing animport in a multisite environment.

If you clear this and an active exchange link exists for abatch, that batch will only run if there is data waiting to beimported. For example, if there is no batch to import.

This field is only relevant when you are using multisitecontrol, and the batch is used in one or more exchangelinks.

UncompressASCII Files

Select when you want to restore compressed ASCII filesto their original format before the import procedure.

Only use this option if the ASCII files that will be importedwere compressed using the BaanERP compressionprogram.

Page 54: U7137A US

Import module

Exchange User Guide

3-24

Import Data (Non-Regular) (tuxch0223m000)

Use the Import Data (Non-Regular) (tuxch0223m000) session to run the importprogram to transfer data on a non-regular basis from sequential ASCII files toBaanERP tables. This session can be used to test exchange schemes that will berun 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 importbusiness objects.

Follow this procedure to run the import program:

1 Select a range of exchange schemes, batches, and/or batch sequence numbers.

2 Select the processing type.

3 Enter the start and end time of the audit range if the import is based on audit.

4 Select the Overrule Batch Company check box if the data is imported froma company other than the current company.

5 Enter another company if the current company is overruled.

6 Select the Wait for <CR> with Messages check box if the import programmust stop after a message.

7 Click Import Data to start the import procedure.

8 Click Log Table to view the contents of the log table. A log table gives anoverview of the results of the import procedure.

Figure 23, Import Data (Non-Regular)

Page 55: U7137A US

Import module

Exchange User Guide

3-25

Import Data (Non-Regular) (tuxch0223m000)

Field Description

Selection Range

ExchangeScheme

Enter the exchange scheme.

Batch Enter the batch in the exchange scheme.

Batch SequenceNumber

Enter the batch sequence number.

Processing Settings

Processing Type Choose the type of run for this data exchange:

n New runn Restart previous run

This option allows you to import data using the last runnumber over again. This field is usually used in theImport Data (on a Regular Basis) (tuxch0224m000)session, where each run number provides different datasets. Only the log files are affected in this session,because the data to be loaded into Baan is the same forboth the last run number used and the first free runnumber.

n Reprocess rejected recordsWhen records are rejected during an import process,Baan creates two additional files to hold the rejectedrecords. Records that are rejected due to index ordomain errors (database problems) are placed in theRejected due to Error file and records that are rejecteddue to a condition returning a false status are placed inthe Rejected due to Condition file. Baan places thesefiles in the same directory as the data file that was readin and appends the suffixes .e01 or .c01 to them. Ifmore records are rejected during reprocessing, Baancreates new files with the next sequential number. If youchoose this option, you can use the next two fields tochoose which records to reprocess.

n Continue interrupted runIf an exchange scheme run stops in the middle of therun, you can restart the import if there is more than onebatch line and the restart can begin at the start of thebatch line that was not completed. If there is only onebatch line, this option is the same as a complete restartof the import.

Overrule BatchCompany

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

Company Enter the company to be used in the Company field in thissession.

Page 56: U7137A US

Import module

Exchange User Guide

3-26

Processing Details

Really Quit onStop Condition

Select to quit on a stop condition, or clear if you want theimport to continue running and only return an errormessage if it meets the stop condition.

Wait for <CR>with Messages

Select to have messages remain on screen until you pressEnter.

Page 57: U7137A US

Exchange User Guide

4-1

Sometimes you need to export data from Baan to another application, forexample, when:

n Data must be shown in a specific way such as in a spreadsheet.n Text is to be maintained by using a word processor.n 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 toASCII files, and then import the data into the Baan database. Exchange can usethe same master data information for import that it uses for export, because theASCII file format should be the same.

To set up an export processTo export data, you start by setting up an exchange scheme as described inChapter 2, Master Data. Then you go on to define the details of the tables to beexported.

You begin by creating the relationship at the table level between the BaanERPtables and the ASCII files by using the Table Relations (Export)(tuxch0531m000) session in the Export module. You then create the relationshipat the field level, by setting up the relations between logical ASCII file fields andBaanERP 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 tocreate range limitation expressions. You do this by using the Ranges(tuxch0112m000) session.

After you have defined the table relations, field relations, and conversions, youneed to compile an object that Exchange can use to run the export. You do thisby 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 ExportData (on a Regular Basis) (tuxch0234m000) session.

4 Export module

Page 58: U7137A US

Export module

Exchange User Guide

4-2

Following are the sessions included in the Export module:

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

XCHexport

BAAN

BAANData

ASCIIfile

Application

Figure 24, The export process

The Export module sessions

Table Relations (Export) (tuxch0531m000)

Open the Table Relations (Export) (tuxch0531m000) session. Check that theexchange scheme and batch are correct.

When you have finished with the Table Relations (Export) session, you canzoom from the Choice field to the next step in creating an exchange scheme, thefield relations.

The Specific menu contains these options:

n Field Relations (Export) (Ctrl+Shift+1)Starts the Field Relations (Export) (tuxch0532m000) session.

n (De)activate Table Relations (Ctrl+Shift+G)Starts the (De)activate Table Relations (tuxch1221m000) session.

Page 59: U7137A US

Export module

Exchange User Guide

4-3

Follow this procedure to create a table relation:

1 Choose FileÅNew to display the Table Relations (Export) (tuxch0131s000)details session.

2 Enter a number in the logical sequence for the table relation.

3 Enter the table from the ASCII file and the name of the ASCII file to be usedduring an export.

4 Enter the physical ASCII file to be written.

5 Enter the other parameters that define this table relation.

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

Figure 25, Table Relations (Export)

Page 60: U7137A US

Export module

Exchange User Guide

4-4

Figure 26, Table Relations (Export), New

Table Relations (Export) (tuxch0131s000)

Field Description

Table Relation(Export)

Enter the number that represents the table relation in thebatch during an exchange process. The table relationshows the correspondence between a database table andan ASCII file.

Baan Table Enter the table that contains data from the ASCII file to beread during an export procedure. One batch line can onlyread one Baan table. If you need to use the same Baantable to create more than one physical file, you can usemultiple batch lines. The different batch lines may or maynot use the same ASCII file layout.

Use multiple table relations to write data from more thanone 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 betransferred to a BaanERP table during an exportprocedure.

To create the field relations of the table relationautomatically, the ASCII file name must be the same as theBaanERP table name. You can do this if you do not have adata definition file of the ASCII file.

The ASCII file name represents the logical ASCII file. Youcan create the ASCII file name in the ASCII Files(tuxch0102m000) session.

Page 61: U7137A US

Export module

Exchange User Guide

4-5

ASCII File Name Enter the name of the physical ASCII file where the data isto be written. The maximum length of the file name iseleven characters.

The file name entered here is an extension of the defaultpath. The default path is defined in the Path for ASCIIFiles field under Paths on the General tab in the ExchangeSchemes (tuxch0101s000) session.

If this is an absolute path, the default path is not used. Ifthis is not an absolute path, the file is stored in the directoryfor sequential files as defined in the exchange schemeheader record.

Active Select to activate the table relation so that it can be usedfor data processing in an export process. If this option iscleared, the table relations are kept for reference purposesbut are not used during the export process.

You can also use it as a debugging tool by turning off alltable relations except one to test a new change. Select ifyou want to test the exchange scheme, a single tablerelation, or only a few table relations.

Use bdbpre Select to ignore the layout of the ASCII file and let thestandard 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 filefields that are created in the ASCII File Fields(tuxch0103s000) session.

This option is not applicable for an exchange based onaudit. If you change this field, you must generate theexchange program again.

Condition Enter a condition code. The condition must be of theBoolean type.

The export of data depends on the return value of thiscondition. If the return value of the condition is true, thedata of the BaanERP table is written to the ASCII file. If thereturn value of the condition is false, the data of theBaanERP table is not written, that is, the export is not done.

Conditions are also used during an exchange based onaudit.

Range Active Select if you want Baan to process the table relation byusing the limitations defined in the Ranges(tuxch0112m000) session. Clear if you do not want Baan touse the limitations defined in the Ranges (tuxch0112m000)session.

The range is not active if the export is part of an auditprocedure or if Use bdbpre is selected.

Page 62: U7137A US

Export module

Exchange User Guide

4-6

Sort Index If you want to export the data using any of the indexes fromthe table listed in the Baan table field, enter the indexnumber of the ASCII file that will contain data from theBaanERP table. If the table is read, this index is used andthe ASCII file is sorted according to this index.

Table RelationsText

Indicates whether this table relation includes 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 availablerelations between logical ASCII files fields and BaanERP table fields per batchin an exchange scheme. Use the details session to specify which data must bepassed 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 theBaanERP table is the same as the code of the ASCII file table. Use this optionif the definition file of the BaanERP table is not available.

Follow this procedure to create a field relation:

Figure 27, Field Relations (Export)

Page 63: U7137A US

Export module

Exchange User Guide

4-7

Figure 28, Field Relations (Export), New

Page 64: U7137A US

Export module

Exchange User Guide

4-8

Field Relations (Export) (tuxch0132s000)

Field Description

Serial Number Enter a serial number to make the field relation unique inthe table relation. The serial number is only used as anidentifier and need not be sequential. It is best to useintervals of ten so you can insert a new record betweenexisting records if that is where it logically belongs.

ASCII Field Enter the code of the ASCII file field to contain the datatransferred from a field in the BaanERP table during anexport procedure.

The ASCII file code represents the logical ASCII file. It iscreated in the ASCII Files (tuxch0102m000) session.

Based on

Baan Field Select and enter the name of a Baan field on which thedata transfer is based. This value is passed to the physicalASCII file in the position designated by the ASCII Field.

Array Element Enter the element number of an array field if the table fieldnamed in Baan Field is defined as an array in the datadictionary. The elements in an array can be filledindividually. The element number cannot exceed the arraydepth.

Condition Enter the name of the condition you are using, if any. Youuse a condition either if the data to be exported resides in atable other than the table defined at the Table Relationlevel, or if the data does not exist in any Baan table. Youcan use a condition to access the different table or tablefields necessary to calculate the value that must beexported.

The conditions are created in the Conditions(tuxch0114m000) session.

Constant Select to import a constant value into a BaanERP tablefield or to export a constant to an ASCII file field. Use thisfield to pad the file with additional data if the receivingsystem requires additional data fields.

Page 65: U7137A US

Export module

Exchange User Guide

4-9

Ranges (tuxch0112m000)

Normally even if the entire table is not needed, all the data is exported anywayand only the desired records are read in during import. This control is achievedby 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. TheRanges (tuxch0112m000) session allows you to use relational and logicaloperators to create range-limitation logic expressions that control the exportprocess. Only active records that match the condition are exported. This enablesyou to transfer a smaller file between systems. The drawback is that the filtercannot be as complex, because the range limitation logic is not as powerful asconditions.

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 tablefield:

Date data type

n The Entered Date field must be of the default date format.n The plus or minus signs can be used to change the current date. For example,

+2 adds two days to the current date.n 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 theleft, 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 The set of values must be placed between parentheses.n For string data type, each item in the set of values must be placed between

double quotation marks.

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

EXAMPLE:

Page 66: U7137A US

Export module

Exchange User Guide

4-10

Follow this procedure to create a range:

1 Enter a serial number in the logical sequence order.

2 Enter the rule that specifies the range of table fields to be checked.

3 Enter a relational or logical operator to create range-limitation logicexpressions to control the export.

4 Enter the from and to values that apply to the Baan field.

Figure 29, Ranges

Ranges (tuxch0112m000)

Field DescriptionSerial Number Enter a number to ensure the correct sorting sequence.Baan Field Enter a rule to specify the range of table fields to be

checked. If the rule involves more than one field, you canuse two lines to express the range.

Operator Enter a relational or logical operator to create rangelimitation logic expressions to control the export process.The Operator performs a check between the Baan fieldand the Value From and Range Value To fields.

Value (from) Enter the limits that are applied to the Baan field.Range value to You can use this only for the between and not between

operators.And/or/end 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 tojoin the multiple lines. When a range expression goes overone line, the sequence number is the only determination ofwhich line is to be read next. All range limitations must endwith the end of expression choice.

Page 67: U7137A US

Export module

Exchange User Guide

4-11

Create Export Programs (tuxch0228m000)

To be able to use an exchange scheme, you must pull together all the data in thesessions you have just filled, put the data into one program script, and compilethe 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 scriptsthat are used in the table and field relations.

Syntax errors in the condition script cause compilation errors. You can check thesyntax with the Check Syntax of Conditions (tuxch0206m000) session.

Follow this procedure to create an export program:

1 Select a range of exchange schemes and batches.

2 Select the check boxes under Compile Options to specify how the importprogram must be created.

3 Click Create to start the creation of the export program.

4 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

Page 68: U7137A US

Export module

Exchange User Guide

4-12

Create Export Programs (tuxch0228m000)

Field Description

Selection Range

ExchangeScheme

Enter an exchange scheme.

Batch Enter a batch.

Compile Options

Compile in DebugMode

Select to go through a condition script step by step.

Compile withProfiler

Select to compile with the profiler. After the import has run,the profiler generates a report that provides informationabout the performance time required for each function.

Display withErrors

Select to get a detailed list of errors showing the exactproblem with each line of code.

Export Data (on a Regular Basis) (tuxch0234m000)

After you have set up the exchange schemes and tested them by running theExport Data (Non-Regular) (tuxch0233m000) session, you can set up a regularexport to facilitate the recurring exchange of data. An export on a regular basis isespecially useful in a multisite environment, where it is important that no run islost 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 theexport program to transfer data on a regular basis from BaanERP tables tosequential 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 andbatch lines, which prevents you from running part of an exchange scheme. Thisis to make sure that one period of audit information is not missed for one batchline while the rest of the batch lines are complete.

When you use the regular export session, you need to pay extra attention to yourUNIX directory management. When you export data using the Export Data (on aRegular Basis) (tuxch0234m000) session, the ASCII file is placed in anadditional directory in the sequential file directory to keep the different runsseparate. The name of this additional directory is <exchange schemename>.<run number>.e.

Page 69: U7137A US

Export module

Exchange User Guide

4-13

The session Import Data (on a Regular Basis) (tuxch0224m000) uses a similardirectory naming convention to look for incoming data. The only difference isthe 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 Select a range of exchange schemes.

2 Select the processing type.

3 Enter the start and end time of the audit range if the export is based on audit.

4 Select the Overrule Batch Company check box if the data is exported froma company other than the batch company.

5 Enter another company if the current company is overruled.

6 Define the details of the export procedure in the Processing Details groupbox.

7 Click Export Data to start the export procedure.

8 Click Log Table to view the contents of the log table. A log table gives anoverview of the results of the export procedure.

Figure 31, Export Data (on a Regular Basis)

Page 70: U7137A US

Export module

Exchange User Guide

4-14

Export Data (on a Regular Basis) (tuxch0234m000)

Field Description

Selection Range

ExchangeScheme

Enter a range of exchange schemes.

Processing Settings

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

n Restart previous runThis option allows you to import data using the last runnumber over again. This field is usually used in theImport Data (on a Regular Basis) (tuxch0224m000)session, where each run number provides different datasets. Only the log files are affected in this session,because the data to be loaded into Baan is the same forboth the last run number used and the first free runnumber.

n Reprocess rejected recordsWhen records are rejected during an import process,Baan creates two additional files to hold the rejectedrecords. Records that are rejected due to index ordomain errors (database problems) are placed in theRejected due to Error file and records that are rejecteddue to a condition returning a false status are placed inthe Rejected due to Condition file. Baan places thesefiles in the same directory as the data file that it wasread in and appends the suffixes .e01 or .c01 to them. Ifmore records are rejected during reprocessing, Baancreates new files with the next sequential number.When you choose this option, you can use the next twofields to choose which records to reprocess.

n Continue interrupted runIf an exchange scheme run stops in the middle of therun, you can restart the import. You can only do this ifthere is more than one batch line and the restart canbegin at the start of the batch line that was notcompleted. If there is only one batch line, this option isthe same as a complete restart of the import.

Overrule BatchCompany

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

Company Enter the company to be used during this session insteadof the batch company. This field can only be defined ifOverrule Batch Company is On.

Page 71: U7137A US

Export module

Exchange User Guide

4-15

Processing Details

Wait for <CR>with Messages

Select to cause messages to remain on screen until youpress Enter. Clear if you want the export program tocontinue without any interaction from you. This option canbe used for an export that runs throughout the night.

Suppress ExportDone Messages

Select if you want the export to complete without checkingfor messages that indicate that the export procedure iscompleted. If you clear this option, an Export Donemessage is sent, but only if there is a subscription for thebatch.

This option can be used to test or run the export. This isuseful when testing an export in a multisite environment.

Compress ASCIIFiles

Select when you want to compress files after they areexported. Only use this option if the ASCII files to beexported are compressed using the BaanERP compressprogram.

Export Based on Audit

Start of AuditRange

Enter the start date and time of the audit range.

End of AuditRange

Select to set the end date and time of the audit range to thecurrent date and time.

All transactions between the specified start time and dateand the current time and date are exported. This isimportant if the export procedure is part of a job. Every timethe job is started, the end of the audit range will be thecurrent time and date. The length of the interval is thereforenot fixed.

The ends of audit range fields do not have to be specified.

Export to CurrentDate/Time

Select to have this export continue until the current dateand time.

Export Data (Non-Regular) (tuxch0233m000)

Use the Export Data (Non-Regular) (tuxch0233m000) session to run the exportprogram to transfer data from BaanERP tables to sequential ASCII files. This isuseful for one-time only exports and to test exchange schemes that will be run ona 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 andBatch Lines, which allows you to run part of an exchange scheme.

Page 72: U7137A US

Export module

Exchange User Guide

4-16

This is not allowed in a regular export because it is possible to miss one period ofaudit 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 Select a range of exchange schemes, batches and/or batch sequence numbers.

2 Select the processing type.

3 Select the Overrule Batch Company check box if the data is exported froma company other than the current company. In such a case, define thatcompany in the next field.

4 Select the Wait for <CR> with Messages check box if the export programmust stop after a message.

5 Enter the start and end time of the audit range if the export is based on audit.

6 Click Export Data to start the export procedure. The screen changes and astatus window displays the progress of the export. For each batch line thatcompletes, Baan displays the exchange scheme, the batch, and the batch line.The numbers of records read, processed, rejected due to error, and rejecteddue to conditions are also displayed.

7 Click Log Table to view the contents of the log table. A log table gives anoverview of the results of the export procedure.

Figure 32, Export Data (Non-Regular)

Page 73: U7137A US

Export module

Exchange User Guide

4-17

Export Data (Non-Regular) (tuxch0233m000)

Field Description

Selection Range

ExchangeScheme

Enter a range of exchange schemes.

Batch Enter a range of batches.

SequenceNumber

Enter a range of sequence numbers.

Processing Settings

Processing Type Choose the type of run for this data exchange:

n New run

n Restart previous runThis option allows you to import data reusing the lastrun number. This field is usually used in the Import Data(on a Regular Basis) (tuxch0224m000) session whereeach run number provides different data sets. The logfiles are the only thing that is affected in this session,because the data to be loaded into Baan is the sameboth for the last run number used and the first free runnumber.

n Reprocess rejected recordsWhen records are rejected during an import process,Baan creates two additional files to hold the rejectedrecords. Records that are rejected due to index ordomain errors (database problems) are placed in the"Rejected due to Error" file and records that are rejecteddue to a condition returning a false status are placed inthe "Rejected due to Condition" file. Baan places thesefiles in the same directory as the data file that it wasread in and appends the suffixes .e01 or .c01 to them. Ifmore records are rejected during reprocessing, Baancreates new files with the next sequential number.When you choose this option, you can use the next twofields to choose which records to reprocess.

n Continue interrupted runIf an exchange scheme run stops in the middle of therun, it is possible to restart the import. You can only dothis if there is more than one batch line and the restartcan begin at the start of the batch line that was notcompleted. If there is only one batch line, this option isthe same as a complete restart of the import.

Overrule BatchCompany

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

Page 74: U7137A US

Export module

Exchange User Guide

4-18

Company Enter the company to be used in the Company field in thissession.

Wait for <CR>with Messages

Select to cause messages to remain on screen until youpress Enter.

Export Based on Audit

Start of AuditRange

Enter the start date and time of the audit range.

Start from lastExport Date/Time

Select to have this export start from the time the last exportbased on audit finished.

All transactions between the specified start time and dateand the current time and date are exported. This isimportant if the export procedure is part of a job. Every timethe job is started, the end of the audit range will be thecurrent time and date. The length of the interval is thereforenot fixed.

End of AuditRange

Enter the end date and time of the audit range.

To check the resultsAfter the ASCII file has been created, you can print the contents of this file usingthe Print ASCII File (tuxch0202m000) session.

You can use the Log Table (Batch Level) (tuxch0508m000) session to checkwhether the export process was successfully completed. This session shows thenumber of records successfully processed and exported. This session also showswhether records were rejected due to an error, which happens when the writestatement to the sequential file is not successful.

Page 75: U7137A US

Exchange User Guide

5-1

With BaanERP you can now use the Exchange module to set up a batch-drivenreplication server. This enables you to maintain the same data at multiple sites.

Data replication can be synchronous or asynchronous. In synchronousreplication, 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 oron demand.

In BaanERP, data replication is asynchronous. It is accomplished as follows:

n The source system runs an export process.

n The source system sends a message to the target system or systems notifyingthem that new data is available.

n The target system runs an import process to assimilate the new data receivedfrom the source system.

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

Audit trail

Exchange uses your database’s audit trail to enable multisite exchange. Beforeyou can begin a multisite exchange process, you must have audit trail set on. Youcan do this using the Database Definitions (ttaad4510m000) and Table byDatabase (ttaad4111m000) sessions.

Auditing all of your data can consume a large amount of memory. You shouldtherefore specify exactly which tables are to be audited and which are not. Everytable containing data that you want to replicate in a multisite exchange schememust be audited.

5 Multisite control

Page 76: U7137A US

Multisite control

Exchange User Guide

5-2

About multisite exchange in BaanWhen you set up a multisite exchange, you can link the export and importprocesses so that they are performed as one process. These links are not tightlycoupled, however, and are controlled at each site. You can run the export andimport 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 tothe target system, and then run the import there. Other configurations are alsopossible, depending on your company’s 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 batchat the source site. When you define an exchange link, Baan stores a subscriptionat the source site, which points to the import batch at the target site. The link isactive when both the exchange link at the target site and the subscription at thesource site are available.

When you run a regular export, Exchange checks whether there are anysubscriptions. During a regular export, Exchange sends a message to the targetsite saying which files have been exported and where they are stored. The targetsite stores this information.

When you run a regular import, Exchange checks to see if any data is waiting tobe imported. If so, Baan copies the files from the source site to the target site andthen imports them. Afterward, the target site reports to the source site that thedata has been imported.

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

Page 77: U7137A US

Multisite control

Exchange User Guide

5-3

The Export Done message

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

n Source environment, company, exchange scheme, and batchn Run and try number of the export process (required for the sequence order at

the target site)n Target environment, company, exchange scheme, and batchn Separator and enclosing character of the source exchange schemen Whether the ASCII files were compressed after exportn 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 specifiesthe source environment, company, exchange scheme, and batch. If so, Exchangestores 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. AfterExchange copies the files to the target site, the files are decompressed.

Exchange does not provide additional security; that is, the files to be transportedare not encrypted.

When copying the files, any previously existing files are overwritten. This doesnot often happen, however, because usually you would use a separatesubdirectory for each run for the regular export and the regular import.

The import processA batch to import refers to a target batch that can be run because the source batchhas already been run.

Before running a regular import batch, Exchange checks whether there is anactive 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, Exchangechecks the batches to import.

Page 78: U7137A US

Multisite control

Exchange User Guide

5-4

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

n Copies the files from the source site.n Removes the run from the batches to import and deletes its batch lines to

import.n Runs the import.n Sends an Import Done to the source site.

The import process takes some time to complete, which means that whileExchange is busy processing one batch to import, new batches to import canarrive. Exchange continues checking for new batches until all the batches havebeen imported.

Exchange usually runs a regular import only when there is no exchange link orwhen there are one or more batches to import. You can overrule this, however,and initiate an import batch without having Exchange perform these checks.

Each batch to import is processed in order of the run number and the try numberwithin each run. The run number refers to the sequence order of a process withinan exchange scheme. The try number is the number of attempts made for eachrun. If Exchange cannot process one import batch, it stops and does not continueprocessing subsequent batches. If necessary, you can delete the problematicbatch 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 beensuccessfully imported at the target site. The files at the export site are deletedonly after all of the target sites that need those files have copied and importedthem.

When you send the Import Done message, Exchange checks whether there areany rejected Import Done messages and if so, sends them, too. The sequence inwhich 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 bedelivered to the source site, Exchange writes the Import Done message to therejected Import Done messages and logs an error message.

Exchange needs to have the following information so that it can create and sendan Import Done message:

n Source environment, company, exchange scheme, and batchn The run number and try number of the exportn Target environment, company, exchange scheme, and batch

IMPORTANTNOTE

Page 79: U7137A US

Multisite control

Exchange User Guide

5-5

When Exchange receives the Import Done message at the source site, Exchangeremoves the stored current Export Done message to which the Import Donemessage refers.

When you are ready to clean up the ASCII files, you can check whether alltargets that have subscribed to the source have already processed the files. A filemust only be deleted when the run and try that created it do not occur in thecurrent Export Done messages.

How to set up a multisite exchangeTo set up a multisite exchange, you start by defining all the source environmentsand 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 thatyou can link the target environment and source environment.

After the exchange links are defined, you must activate them using theActivate/Deactivate Exchange Links (tuxch4201m000) session. You can onlyuse multisite functionality when all the links are present and linked.

The Multisite Control sessionsThese are the sessions used in the Multisite Control business object:

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

Environments (tuxch4100m000)

To set up a multisite exchange, you need to define all the source environmentsand target environments that are used in the multisite exchange. Use theEnvironments (tuxch4100m000) session to find, list, and maintain sites to beused to exchange data between different sites.

Even though this session is especially designed for data exchanges betweendifferent sites, you can also use this session if you are using multisite exchangein a single BSE environment. The target environment and source environmentare then the same.

Page 80: U7137A US

Multisite control

Exchange User Guide

5-6

Follow this procedure to set up an environment:

1 Enter the name of the environment.

2 Enter the system on which the environment resides, and the path for thedirectory of the environment.

Figure 33, Environments

Environments (tuxch4100m000)

Field Description

Environment Enter the name of the environment.

System Enter the system on which the environment resides.

BSE Path Enter the path for the directory of the environment.

Exchange Links (tuxch4501m000)

After you have defined the source environments and target using theEnvironments (tuxch4100m000) session, you need to define the exchange linksand subscriptions so that you can link the target environment and sourceenvironment.

Use the Exchange Links (tuxch4501m000) session to view a list of the exchangelinks you have already defined. Use the details session to create new links. Theexchange link code defined at the target site must be the same as the subscriptiondefined at the source site.

You can only delete an exchange link if its status is inactive at both the sourceand target site.

For more information about activating and deactivating exchange links, see theActivate/Deactivate Exchange Links (tuxch4201m000) session.

Page 81: U7137A US

Multisite control

Exchange User Guide

5-7

The Specific menu contains the following:

n Activate (Ctrl+Shift+A)Activates a single exchange link.

n Deactivate (Ctrl+Shift+D)Deactivates a single exchange link.

n Activate/Deactivate Exchange LinksActivate or deactivate a range of exchange links.

n Batches to ImportView or delete the batches to import.

n Rejected Import Done MessagesView the Rejected Import Done Messages.

Follow this procedure to set up an exchange link:

1 Choose FileÅNew to display the Exchange Links (tuxch4101s000) detailssession.

1 Enter a name and description for the link that you are creating.

2 Enter the target exchange scheme and batch.

3 Enter the source information.

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

Figure 34, Exchange Links

Page 82: U7137A US

Multisite control

Exchange User Guide

5-8

Figure 35, Exchange Links, Details session

Exchange Links (tuxch4101s000)

Field Description

Exchange Link Use the Exchange Link field to enter a name for the linkthat you are creating.

Description Enter a description for this exchange link.

Target ExchangeScheme

Enter the name of the target exchange scheme.

Target Batch Enter the batch number of the target exchange scheme.

SourceEnvironment

Enter the source environment.

Source Company Enter the number of the source company.

Source ExchangeScheme

Enter the name of the source exchange scheme.

Source Batch Enter the batch number in the source exchange scheme.

Exchange LinkStatus

This field is shown as inactive until links at both the targetand source sites are set up, and you activate this exchangelink.

Exchange LinkText

Indicates whether this exchange link includes text.

Page 83: U7137A US

Multisite control

Exchange User Guide

5-9

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 themin a multisite exchange. You use the Activate/Deactivate Exchange Links(tuxch4201m000) session to activate and deactivate a range of exchange linksbetween the source and target batches. The link must be active to make theexchange link available at the target site and the subscription available at thesource 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 tothe source site. The subscription is checked and stored at the source site. Afterthat, whenever the batch defined in the subscription is carried out, the source sitesends an Export Done message to the target site. If this message is not processedsuccessfully, the link is stored at the target site, but the status is changed toinactive.

When you deactivate an exchange link at the target site, Exchange sends anUnsubscribe message to the source site. The subscription is then deleted and thetarget batch can no longer automatically process data from the source site. TheCurrent Export Done messages are also deleted.

You can only delete an exchange link if its status is inactive at both the sourceand target site.

This process can also run as part of a job.

Follow this procedure to activate or deactivate an exchange link:

1 Under Action Type, choose whether to activate or to deactivate the link.

2 Under Selection Type, choose how to make a selection of links.

3 Define a range of exchange links, or choose the Detailed tab where you canmake a more detailed selection.

Page 84: U7137A US

Multisite control

Exchange User Guide

5-10

4 Click (De)activate to start the process.

Figure 36, Activate/Deactivate Exchange Links, General tab

Figure 37, Activate/Deactivate Exchange Links, Detailed tab

Page 85: U7137A US

Multisite control

Exchange User Guide

5-11

Activate/Deactivate Exchange Links (tuxch4201m000)

Field Description

General tab

Action Type

Activate Select to activate a range of exchange links. Specify therange in Selection by Exchange Link.

Deactivate Select to deactivate a range of exchange links. Specify therange in Selection by Exchange Link.

Only Links HavingStatus “Inactive(Target Only”

Select to deactivate only the links in the specified rangewith the status Inactive (Target Only).

Selection Type

Selection byExchange Link

Select to be able to enter a range of links in the ExchangeLink field under Selection by Exchange Link.

Detailed Selection Select to be able to make a more detailed selection ofexchange links on the Detailed tab.

Selection by Exchange Link

Exchange Link Enter a range of exchange links. This field is only activatedif Selection by Exchange Link is set On.

Detailed tab

Detailed Selection

Target ExchangeScheme

Enter a range of target exchange schemes for which youwant to activate or deactivate the exchange links.

Target Batch Enter a range of target batches for which you want toactivate or deactivate the exchange links.

SourceEnvironment

Enter a range of source environments for which you want toactivate or deactivate the exchange links.

Source Company Enter a range of source companies for which you want toactivate or deactivate the exchange links.

Source ExchangeScheme

Enter a range of source exchange schemes for which youwant to activate or deactivate the exchange links.

Source Batch Enter a range of source batches for which you want toactivate or deactivate the exchange links.

Page 86: U7137A US

Multisite control

Exchange User Guide

5-12

Resend Rejected Messages (tuxch4203m000)

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

n Current Export Donen Import Donen Subscription Destroyed

Messages can be rejected because of the following reasons:

n The target system does not use Baan Exchange.n The target system is not operational.n Network connections are slow.n There is no remote user in the target environment or in the source

environment.n 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 sendingsite and receives the status rejected.

Follow this procedure to resend the rejected message:

1 Select one or more message types in the Messages To Resend group box.This activates the appropriate range tab.

2 Use the check boxes in the Selection Type group box to either make a globalor a detailed selection of messages to resend.

3 Define the range on the appropriate range tab.

4 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 youdo this regularly, you do not have to check manually for rejected messages.

Page 87: U7137A US

Multisite control

Exchange User Guide

5-13

Figure 38, Resend Rejected Messages, Selection tab

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

Page 88: U7137A US

Multisite control

Exchange User Guide

5-14

Figure 40, Resend Rejected Messages, Import Done Messages tab

Figure 41, Resend Rejected Messages, Subscription Destroyed Messages tab

Page 89: U7137A US

Multisite control

Exchange User Guide

5-15

Resend Rejected Messages (tuxch4203m000)

Field Description

Selection tab

Messages to Resend

Current ExportDone Messages

Select to activate the fields contained on the Current ExportDone Messages tab.

Import DoneMessages

Select to activate the fields contained on the Import DoneMessages tab.

SubscriptionDestroyedMessages

Select to activate the fields contained on the SubscriptionDestroyed Messages tab.

Selection Type

Global Selection Select to activate the global selections on each tab and seeeverything for each exchange link or subscription.

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 Enter a range of subscriptions.

TargetEnvironment

Enter a range of target environments.

Target Company Enter a range of target companies.

Detailed Selection

Source ExchangeScheme

Enter a range of source exchange schemes.

Source Batch Enter a range of source batches.

TargetEnvironment

Enter a range of target environments.

Target Company Enter a range of target companies.

Target ExchangeScheme

Enter a range of target exchange schemes.

Target Batch Enter a range of target batches.

Import Done Messages tab

Global Selection

Exchange Link Enter a range of exchange links.

Detailed Selection

Target ExchangeScheme

Enter a range of target exchange schemes.

Page 90: U7137A US

Multisite control

Exchange User Guide

5-16

Target Batch Enter a range of target batches.

SourceEnvironment

Enter a range of source environments.

Source Company Enter a range of source companies.

Source ExchangeScheme

Enter a range of source exchange schemes.

Source Batch Enter a range of source batches.

Subscription Destroyed Messages tab

Global Selection

Subscription Enter a range of subscription from the source sites.

TargetEnvironment

Enter a range of target environments.

Target Company Enter a range of target companies.

Detailed Selection

Source ExchangeScheme

Enter a range of source exchange schemes.

Source Batch Enter a range of source batches.

TargetEnvironment

Enter a range of target environments.

Target Company Enter a range of target companies.

Target ExchangeScheme

Enter a range of target exchange schemes.

Target Batch Enter a range of target batches.

Subscriptions (tuxch4502m000)

After you have defined the source environments and target using theEnvironments (tuxch4100m000) session, you need to define the exchange linksand subscriptions so that you can link the target environment and sourceenvironment.

You can use the Subscriptions (tuxch4502m000) session to view and maintainsubscriptions. The subscription at the source site is equivalent to the exchangelink at the target site. The codes for both the subscription and the exchange linkmust be the same.

When a subscription is deleted, the source site sends a Subscription Destroyedmessage to the target site. This deactivates the exchange link.

Page 91: U7137A US

Multisite control

Exchange User Guide

5-17

The Specific menu contains the following options:

n Current Export Done MessagesAllows you to view the Export Done messages.

n Rejected Subscriptions Destroyed MessagesAllows you to view the rejected Subscription Destroyed messages.

Follow this procedure to set up a subscription:

1 Enter a name for the link that you are creating.

2 Enter the source exchange scheme and batch.

3 Enter the target information.

Figure 42, Subscriptions

Subscriptions (tuxch4502m000)

Field DescriptionSubscription Enter a name for the link that you are creating.Source ExchangeScheme

Enter the source exchange scheme.

Source Batch Enter the source batch.TargetEnvironment

Enter the target environment.

Target Company Enter the target company.Target ExchangeScheme

Enter the target exchange scheme.

Target Batch Enter the target batch.

Page 92: U7137A US

Multisite control

Exchange User Guide

5-18

Receive Remote Procedure Calls (tuxch4200m000)

Run the Receive Remote Procedure Calls (tuxch4200m000) session on the targetsite to read the remote procedure calls. Remote procedure calls are used toindicate that messages have been received regarding the export or import.

Follow this procedure to receive remote procedure calls:

1 Click Start Receiving to read the messages.

2 Click Stop Receiving to stop the end reading the messages.

3 Click Clean Up to remove the messages that were not automatically removedafter reading the messages.

Figure 43, Receive Remote Procedure Calls

Receive Remote Procedure Calls (tuxch4200m000)

Field Description

Start Receiving Select to begin receiving remote procedure calls.

Stop Receiving Select to stop receiving remote procedure calls.

Page 93: U7137A US

Exchange User Guide

6-1

IntroductionYou can use the Exchange (XCH) module to exchange data between two or morecompanies in an organization. The Generate Exchange Schemes business objectlets 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).

n 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 mastercompany to one or more dependent companies. If the data is to be imported intomore than one company, you should create a batch for each company. You mustalso create the corresponding import table and field relations. Refer to the CopyExchange Scheme (tuxch0201m000) session in the Exchange Å MiscellaneousÅ Tools module for more information.

In the second situation, you also execute the export and import proceduressequentially. This is called consolidation because the data is consolidated fromsubcompanies to a master company. As in the dissemination strategy, you createmultiple batches for the export companies. You create one batch for the importcompany.

6 Generate Exchange Scheme

Page 94: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-2

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

subcompany 1

subcompany 2

subcompany 3

Export Export Export

ASCIIfiles

ASCIIfiles

ASCII files

Import Generation ofExchange Scheme

mastercompany

Figure 44, Using Exchange to consolidate data across Baan companies

To set up an exchange between companies, you must identify the mastercompanies and subcompanies. Use the Exchange Companies (tuxch0150m000)session to record master companies. You can split the import and exportprocesses 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 exportingcompany per table. Then you can use the Field Details (tuxch0153m000) sessionto specify which fields are maintained locally for each table.

You can create import tables and their fields for the exchange group and mastercompany using the Import Tables (tuxch0154m000) and the Import Fields(tuxch0155m000) session.

After everything is set up for your exchange scheme, use the Generate ExchangeScheme (tuxch0251m000) session to automatically generate the exchangescheme, ASCII files and their formats, batch lines, and import table and tablefield data.

Page 95: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-3

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

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

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

Exchange Companies(tuxch0150m000)

Exchange Groups(tuxch0151m000)

Table Details(tuxch0152m000)

Field Details(tuxch0153m000)

Import Tables(tuxch0154m000)

Import Fields(tuxch0155m000)

Generate Exchange Scheme

(tuxch0251m000)

Generate Authorizations(tuxch0256m000)

Import from different company numbers

Figure 45, Mandatory sessions for setting up an exchange scheme

Page 96: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-4

The Generate Exchange Scheme sessions

Exchange Companies (tuxch0150m000)

Use the Exchange Companies (tuxch0150m000) session to record mastercompanies. A master company is used to import data from subcompanies. Foreach master company, you specify whether the import data has been exportedfrom one company or from multiple company numbers.

You then create an exchange scheme to import the data from the subcompaniesto the master company. Usually the table definitions of the subcompanies and themaster company are the same. It is best to define the structure and organizationof a multisite company before you generate an exchange scheme.

Figure 46 shows an example of a multisite structure in which the mastercompany 100 is an importing company. Company 100 imports data fromSubcompany 200 and Subcompany 300.

Master Company 100

Subcompany 300Subcompany 200

Figure 46 Example of a multisite structure

Page 97: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-5

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

1 Enter the company code and company name of the master company.

2 If data is received from more than one source, select Data from MultipleSources.

Figure 47, Exchange Companies

Exchange Companies (tuxch0150m000)

Field Description

Company Number Enter the number of the master company.

Company Name Enter the name of the master company.

Data from MultipleSources

Select if the data is received from more than one source.

Page 98: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-6

Exchange Groups (tuxch0151m000)

You can make imports and exports easier to manage by breaking them intological groups. For example, you can create submodules such as sales orders andpurchase orders, or distribution, export, and transportation. You can use theExchange Groups (tuxch0151m000) session to split the import process intosmaller parts.

The exchange groups are converted to the exchange scheme that is created in theGenerate Exchange Scheme (tuxch0251m000) session.

Figure 48, Exchange Groups

Exchange Groups (tuxch0151m000)

Field Description

Exchange Group Enter the name of the exchange group you want to create.

Description Enter a description of the exchange group.

Text Indicates whether this exchange group includes text.

Page 99: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-7

Table Details (tuxch0152m000)

Use the Table Details (tuxch0152m000) session to specify the exportingcompany per table. You can only use this session if the importing companyobtains data from a single exporting company, and not from multiple sources.Refer to the Exchange Companies (tuxch0150m000) session to see whether datais imported into the master company from a single company or from multiplesources.

The Specific menu contains these options:

n Update Table DetailsStarts the Update Table Details (tuxch0250m000) session, which allows youto import a range of tables. This is a convenient way to enter many tables.

n Generate Reference Tables (Ctrl+Shift+G)Creates the reference tables.

Follow this procedure to create the table details:

1 Enter all BaanERP tables of the master company.

2 Enter the company number in a BaanERP table that is used to export tabledetails to the master company.

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

Figure 49, Table Details

Page 100: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-8

Table Details (tuxch0152m000)

Field Description

Baan Table Enter the names of the Baan tables of the master companyinvolved in the exchange process.

Description Enter a description of the table.

Export Company Enter the number of the company to which this table is tobe exported.

Text Indicates whether this table includes text.

Field Details (tuxch0153m000)

Use the Field Details (tuxch0153m000) session to specify which fields aremaintained locally for each table for an import company that does not havemultiple sources. Locally-maintained fields are not overwritten by the exportingcompany. You can skip this session if all the table fields are the same.

Refer to the Exchange Companies (tuxch0150m000) session to see whether datais imported into the master company from a single company or from multiplesources.

Per BaanERP table and per master company, you can specify the table fields andexporting company. The exporting company contains data that is imported fromanother site to the master company.

The Specific menu contains this option:

n Update Field DetailsStarts the Update Field Details (tuxch0253s000) session, where you canselect a company to overwrite the table fields in the master company.

Page 101: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-9

Follow this procedure to specify the table field details:

1 Enter all BaanERP table fields of the BaanERP table in a master company.

2 Use the check box to specify if this field is a local field in an exportingcompany.

3 Enter the company number of the export company.

Figure 50, Field Details

Field Details (tuxch0153m000)

Field Description

Baan Field Enter the fields for the specified Baan table.

Description Enter a description of the field.

Local Field Select if this is a local field in an exporting company.

Export Company Enter the number of the company to which this table is tobe exported.

Text Indicates whether this field detail includes text.

Page 102: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-10

Import Tables (tuxch0154m000)

Use the Import Tables (tuxch0154m000) session to create import tables for theexchange group and master company. The tables are grouped by exchange groupto split the exchange of data into logical units. The tables created in this sessionare imported when the exchange process starts.

If you are importing from a single source, you can use the Sequence field tospecify the sequence of the tables to be imported. These tables must be specifiedin the Table Details (tuxch0152m000) session.

If you are importing from multiple sources, you use this session to specify thetables and sequence of the tables to be imported. The tables are not specified inthe Table Details (tuxch0152m000) session.

The Specific menu contains these options:

n Update Table Data per Exchange GroupStarts the Update Table Data per Exchange Group (tuxch0254m000) session,which automatically creates a range of tables per exchange groups.

n Generate sequence numbers and reference tables (Ctrl+Shift+A)Begins generating the sequence numbers and reference tables.

n Generate reference tables (Ctrl+Shift+G)Begins generating the reference tables.

Page 103: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-11

Follow this procedure to create the import tables:

1 Specify the exchange group and master company.

2 Define per BaanERP table the sequence number and export company.

Figure 51, Import Tables

Import Tables (tuxch0154m000)

Field Description

Baan Table Enter the name of the table to be imported.

Description Enter the description.

Sequence Select to specify the sequence of the tables to be imported.You can only use this if you are importing from a singlesource (multiple data sources = no).

Export Company Enter the company from which the data for each table is tobe exported.

Text Indicates whether this table includes text.

Page 104: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-12

Import Fields (tuxch0155m000)

Use the Import Fields (tuxch0155m000) session to create the fields in the importtables. The fields are grouped by exchange group to split the exchange of datainto logical units. The fields created in this session are imported when theexchange process starts.

If importing is done from a single source, you can use this session to specify thesequence of the tables to be imported. These tables must be specified in the TableDetails (tuxch0152m000) session.

If importing is done from multiple sources, you can use this session to specifythe tables and the sequence order of the tables to be imported. In this case, thetables are not specified in the Table Details (tuxch0152m000) session.

The Specific menu contains this option:

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

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

1 Specify the exchange group and master company and BaanERP table.

2 Define the BaanERP table field, sequence number and export company.

Figure 52, Import Fields

Page 105: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-13

Import Fields (tuxch0155m000)

Field Description

Baan Field If the fields of a table have multiple sources, enter the fieldnames to be imported.

Description Enter a description of the Baan field.

Local Field Select if the source is a local field in an export company.

Export Company Enter the number of the export company.

Text Indicates whether this field includes text.

Update Field Data per Exchange Group (tuxch0255s000)

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

Figure 53, Update Field Data per Exchange Group

Update Table Data per Exchange Group (tuxch0254s000)

Field Description

ExportingCompany

Enter the number of the export company.

Options

OverwriteRecords

Select to overwrite the existing table fields.

Page 106: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-14

Generate Exchange Scheme (tuxch0251m000)

Exchange uses the information entered in the previous steps of this module togenerate components of the Master Data and Import modules. Use the GenerateExchange Scheme (tuxch0251m000) session to automatically generate theexchange scheme, ASCII files and their formats, batch lines, and import tableand table field data. You can customize these components by appendingcondition scripts.

The generated exchange schemes and batches are identified by adding thenumber of the master company to the code of the exchange group and batchcode. For example:

<Exchange group><master company number>

<Batch><master company number>

Follow this procedure to generate exchange schemes:

1 Enter a range of exchange groups.

2 Enter the number of the master company.

3 Define a character to separate the ASCII file fields.

4 Enter a path to store the programs and files created during this process.

5 Click Generate to start the process.

Figure 54, Generate Exchange Scheme

Page 107: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-15

Generate Exchange Scheme (tuxch0251m000)

Field Description

Selection Range

Exchange Group Enter the exchange group to be generated.

ImportingCompany

Enter the number of the importing company.

Details

Separator Enter the character used to separate variable-length ASCIIfile fields.

Path for Files Enter the path name of the directory where the programsand files created during the exchange process are to bestored.

Generate Authorizations (tuxch0256m000)

Users who create the exchange scheme as well as users who execute theexchange scheme must be able to read and create files. It is therefore importantthat you set up proper security permissions. In a UNIX system, the user shouldcreate files with write permissions for the group level (umask 022). It is best toconsult the system administrator because the way the information is establisheddepends on the installation.

Use the Generate Authorizations (tuxch0256m000) session to generate userauthorizations for the exporting companies in a multisite environment. Theauthorizations are generated for Normal Users for all BaanERP table fields. Thefields are divided into Local fields and Imported fields.

The authorizations for Local fields must exceed or be equal to the authorizationsof the imported fields. For example, if the user has a read authorization on Localfields, 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 theauthorizations, you must perform a convert to run time process to activate theauthorizations for the user.

Follow this procedure to generate authorizations:

1 Use the All Exporting Companies check box to generate authorizations forall exporting companies. If the authorizations have to be created for one ormore companies, enter the number of the companies.

2 Enter a valid range of exporting company numbers.

3 Enter the names of the users that are to be authorized.

Page 108: U7137A US

Generate Exchange Scheme

Exchange User Guide

6-16

4 Enter the number of the master company.

5 Define the authorizations for the local and imported fields.

6 Click Generate to start the process.

Figure 55, Generate Authorizations

Generate Authorizations (tuxch0256m000)

Field Description

All ExportingCompanies

Select to generate authorizations for all exportingcompanies. Clear to use the fields under Selection Rangeto specify the companies for which you want to generateauthorizations.

Selection Range

ExportingCompany

Enter the range of exporting companies.

User Enter the names of the users to be authorized.

Importing Company

ImportingCompany

Enter the code for the master company. The mastercompany is used to import data from subcompanies.

The master company is created in the ExchangeCompanies (tuxch0150m000) session.

Authorizations

Local Fields Define the user authorizations for the local fields.

Imported Fields Define the user authorizations for the imported fields.

Page 109: U7137A US

Exchange User Guide

7-1

The sessions in the Miscellaneous business object provide useful utilities andsessions related to the status of the export and import processes performed. Theutilities do not belong to a specific procedure but they can be used at any time inthe Exchange Module.

The functions in the Miscellaneous module are divided into the followinggroups:

n LoggingThe Logging functions let you set up and maintain a log table, so that you canmonitor what is happening during the exchange process.

n ToolsThe Tools functions allow you to perform administrative activities onexchange schemes, ASCII files, ASCII file fields and relations, Baan fields,definition files, and conditions. You can also view a list of predefinedfunctions and variables.

n ConversionThe Conversion sessions guide you through converting a Baan applicationfrom Version 6.1.a to a newer release or version.

The Logging sessionsThe Logging functions enable you to track the activities during an exchange bymaintaining and monitoring a log table. The Logging sessions are comprised ofthe following:

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

7 Miscellaneous

Page 110: U7137A US

Miscellaneous

Exchange User Guide

7-2

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 PrintLog File (tuxch0215m000) session to print the log file that is created duringprocessing of the Import Data (Non-Regular) (tuxch0223m000) or the ImportData (on a Regular Basis) (tuxch0224m000) session. Using this session, the logfile 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 Enter the type of exchange.

2 Enter a range of exchange schemes.

3 Enter a range of batches.

4 Enter a range of run numbers.

5 Enter a range of try numbers.

6 Enter a range of table relations.

7 Enter the error type.

8 Enter a range of error codes.

9 Select one of the check boxes to print the error report. You have the option toprint 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

Page 111: U7137A US

Miscellaneous

Exchange User Guide

7-3

Print Log File (tuxch0215m000)

Field Description

Selection Range

Type of Exchange Enter whether this is a regular or non-regular export orimport.

ExchangeScheme

Enter the exchange scheme to be logged.

Batch Enter the batch number of the exchange scheme.

Run Number Enter the run number of this batch.

Try Number Enter the try number of this batch.

Batch Line Enter the batch line.

Error Type Use this to specify a type of error, if preferred.

Error Code Enter the error code, if known.

Print Options

Print Short ErrorDescription

Select if you want to see an overview of all the errorsshowing only the first 30 characters of the error message.This option is easy to read but it might not display enoughinformation, for example, referential errors. To make surethat you have a complete error report, select Print LongError Descriptions.

Print Long ErrorDescription

Select to see the entire error description.

SuppressMessages forNon-existing Files

Select if you do not want to see messages regarding logfiles that you have already deleted or that no longer exist.

Clear if you want to see an error message for each log filein the specified range that no longer exists.

Page 112: U7137A US

Miscellaneous

Exchange User Guide

7-4

Remove Log Files (tuxch0216m000)

Use the Remove Log Files (tuxch0216m000) session to clean up your system byremoving log files that you no longer need. This session removes the log filesthat are created in the Import Data (Non-Regular) (tuxch0223m000) and theImport Data (on a Regular Basis) (tuxch0224m000) sessions. This process canalso run as part of a job.

Follow this procedure to remove the log files:

1 Define the type of exchange.

2 Enter a range of exchange schemes.

3 Enter a range of batches.

4 Enter a range of run numbers.

5 Enter a range of try numbers.

6 Click Remove to start the process.

Figure 57, Remove Log Files

Remove Log Files (tuxch0216m000)

Field Description

Selection Range

Type of Exchange Enter whether the log files of regular or non-regular exportsor imports are to be removed.

ExchangeScheme

Enter the exchange scheme whose log file is to beremoved.

Batch Enter the batch number of the exchange scheme.

Run Number Enter the run number of this batch.

Try Number Enter the try number of this batch.

Page 113: U7137A US

Miscellaneous

Exchange User Guide

7-5

Log Table (Batch Level) (tuxch0508m000)

Use the Log Table (Batch Level) (tuxch0508m000) session to view the log tablecontaining 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 Enter the type of exchange, whether it’s a regular or non-regular import orexport.

2 Enter the exchange scheme name and run number.

3 Confirm that the other information is correct.

Figure 58, Log Table (Batch Level)

Page 114: U7137A US

Miscellaneous

Exchange User Guide

7-6

Log Table (Batch Level) (tuxch0508m000)

Field Description

Type of Exchange Enter whether this is a regular or non-regular export orimport.

ExchangeScheme

Enter the exchange scheme of the log file.

Run Number Enter the run number of the batch.

Try Number Confirm the try number of this batch.

Batch Confirm the batch number of this exchange scheme.

SequenceNumber

Confirm the sequence number.

Processing Type Confirm the processing type.

Control Type Confirm the control type.

User Name Confirm the user name.

Company Confirm the company code.

Page 115: U7137A US

Miscellaneous

Exchange User Guide

7-7

Log Table (Batch Line Level) (tuxch0509m000)

Use the Log Table (Batch Line Level) (tuxch0509m000) session to view the logtable 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 Enter whether this is a regular or non-regular export or import.

2 Enter the exchange scheme of the log file. Enter the batch information.

3 For each table relation, Exchange displays the import or export information.

Figure 59, Log Table (Batch Line Level)

Page 116: U7137A US

Miscellaneous

Exchange User Guide

7-8

Log Table (Batch Line Level) (tuxch0509m000)

Field Description

Type of Exchange Enter whether this is a regular or non-regular export orimport.

ExchangeScheme

Enter the exchange scheme of the log file.

Run Number Enter the run number of the batch.

Try Number Enter the try number of this batch.

Batch Enter the batch number of this exchange scheme.

Table Relation Confirm the table relation.

SequenceNumber

Confirm the sequence number.

Baan Table Confirm the Baan table.

ASCII File Confirm the ASCII file.

Records Read Displays the number of records read.

RecordsProcessed

Displays the number of records processed.

Error Rejected Displays the number of rows that were not processed dueto errors.

ConditionsRejected

Displays the number of records having problems withcondition scripts.

Records Skipped Displays the number of records skipped.

Batch Line EndDate and Time

Displays the batch line end date and time.

Page 117: U7137A US

Miscellaneous

Exchange User Guide

7-9

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 usedlater, it is recommended that you keep the highest run number of both the importand export.

This process can also run as part of a job.

Follow this procedure to clear the log tables of a specified range:

1 Define the type of exchange.

2 Enter a range of exchange schemes.

3 Enter a range of run numbers.

4 Enter a range of batch end dates.

5 Use the check box if you want to clear the log data of the last run.

6 Click Clear to start the process.

Figure 60, Clear Log Table

Clear Log Table (tuxch0208m000)

Field DescriptionSelection RangeType of Exchange Enter whether this is a regular or non-regular export or

import.ExchangeScheme

Enter the exchange scheme of the log table.

Run Number Enter the run number of the batch.Batch End Date Enter the date of the end of this batch.OptionsAlso Clear LastRun

Select to clear the last run as well as the log table.

Page 118: U7137A US

Miscellaneous

Exchange User Guide

7-10

The Tools sessionsThe Tools functions enable you to work at a more detailed level and fullycustomize the Exchange module to meet your business needs. The Tools sessionsare comprised of the following:

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

Copy Exchange Scheme (tuxch0201m000)

Using the Copy Exchange Scheme (tuxch0201m000) session, you can copy anexchange 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 forexport. Certain elements of the structure can also be selectively copied. You cancopy 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 useparent exchange schemes in multilevel exchange schemes. The process can alsorun as part of a job.

Follow this procedure to copy exchange schemes:

1 Use the check boxes under Attachments how to copy the exchange schemes.

2 Enter the company number to where you want to copy the exchange schemes.

3 Select the exchange schemes, batches and table relations for import or export,depending on the chosen option.

Page 119: U7137A US

Miscellaneous

Exchange User Guide

7-11

4 Click Copy to start the process

Figure 61, Copy Exchange Scheme

Copy Exchange Scheme (tuxch0201m000)

Field Description

Copy Choose whether you want to copy the complete exchangescheme, batch, or relations. When you copy an exchangescheme, existing target exchange schemes are deleted andoverwritten.

If the conditions codes or relation codes used in therelations are not already present in the new exchangescheme, the condition code/conversion relation code isinitialized as empty.

Copy to CompanyNumber

Enter the company number to which you want to copy thisexchange scheme. The default is the current companynumber.

You can also copy part of the exchange scheme.

Selection

ExchangeScheme

Enter the source and target exchange schemes.

Batch If you specified Batch in the Copy field, you can enter thebatch name here.

Table Relation(Import)

If you specified Relations in the Copy field, you can enterthe table relation name here.

Table Relation(Export)

If you specified Relations in the Copy field, you can enterthe table relation name here.

Page 120: U7137A US

Miscellaneous

Exchange User Guide

7-12

Delete Exchange Scheme (tuxch0222m000)

The Delete Exchange Scheme (tuxch0222m000) session deletes a selected rangeof exchange schemes for the current company. If there are still files, batches, andrelations defined in an exchange scheme, you cannot delete the exchange schemeusing the Exchange Scheme (tuxch0101m000) session. The Delete ExchangeScheme session offers you the option to delete selected elements of the exchangestructure or to delete the entire exchange scheme with all components. Theprocess can also run as part of a job.

Follow this procedure to delete the exchange scheme, or part of the exchangescheme:

1 Use the check boxes under Attachments to specify how to delete theexchange scheme.

2 Select the exchange schemes, batches and table relations for import or export,depending on the chosen option.

3 Click Delete to start the process.

Figure 62, Delete Exchange Scheme

Page 121: U7137A US

Miscellaneous

Exchange User Guide

7-13

Delete Exchange Scheme (tuxch0222m000)

Field Description

Delete Choose whether you want to delete the complete exchangescheme, batch, or relations.

Selection Range

ExchangeScheme

Enter a range of exchange schemes.

Batch If you specified Batch in the Delete field, you can enter thebatch name here.

Table Relation(Import)

If you specified Relations in the Delete field, you can enterthe table relation name here.

Table Relation(Export)

If you specified Relations in the Delete field, you can enterthe table relation name here.

Rename ASCII File (tuxch1202m000)

Use the Rename ASCII File (tuxch1202m000) session to rename logical ASCIIfiles, if necessary, in an exchange scheme. The codes of the logical ASCII filesare 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 Enter the exchange scheme.

2 Enter the old ASCII file code and the new ASCII file code.

3 Click Rename to start the process.

Figure 63, Rename ASCII File

Page 122: U7137A US

Miscellaneous

Exchange User Guide

7-14

Rename ASCII File (tuxch1202m000)

Field Description

ExchangeScheme

Enter the exchange scheme to be renamed.

Selection

ASCII File Enter the old name of the ASCII file and enter the newname you want it to have.

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 CreateASCII File Fields and Relations (tuxch0203m000) session to generate ASCII filefields 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 tabledefinitions, but the definition files have precedence over the BaanERP tabledefinitions.

During an import procedure, if a BaanERP field and an ASCII file field do notmatch, the BaanERP table field receives the value based on default. For example,if the ASCII file contains fewer fields than the BaanERP table, the valuespecified 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.

Page 123: U7137A US

Miscellaneous

Exchange User Guide

7-15

Follow this procedure to generate ASCII file fields and relations:

1 Enter the code of the exchange scheme.

2 Select a range of ASCII files.

3 Use the check boxes to define how to create the ASCII file fields.

4 Use the check boxes to define how to create the Table and Field relations.

5 Click Generate to start the process.

Figure 64, Create ASCII File Fields and Relations

Page 124: U7137A US

Miscellaneous

Exchange User Guide

7-16

Create ASCII File Fields and Relations (tuxch0203m000)

Field Description

ExchangeScheme

Enter the exchange scheme.

Selection range

ASCII File Enter the range of ASCII files for which you want to createfile fields and relations.

ASCII File Fields

Overwrite ASCIIFile Formats

Select to overwrite the existing file formats.

Create fromDefinition Files

Select to create the ASCII file from definition files.

Create Based onTable Definitions

Select to create the ASCII file based on table definitions.

Table and Field Relations

Create Batch Select to create a batch. The import and export relationsare defined in the batch.

Create ImportRelations

Select to create table and field relations for import of data.

Create ExportRelations

Select to create table and field relations for export of data.

Overwrite ExistingRelations

Select to allow this process to overwrite the existing tableand field relations.

Create Definition Files (tuxch0204m000)

Use the Create Definition Files (tuxch0204m000) session to create definitionfiles automatically. This session dumps the ASCII file structure into sequentialfiles. The sequential files are specified in the ASCII file code table in the ASCIIFiles (tuxch0102m000) session. Definition files can be used in otherenvironments where you copy them using the Create ASCII File Fields andRelations (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, thepath 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 isidentified 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 filesare transferred to the importing site.

Page 125: U7137A US

Miscellaneous

Exchange User Guide

7-17

Existing definition files are overwritten.

This process can also run as part of a job.

Follow this procedure to create definition files:

1 Enter the code of the exchange scheme.

2 Enter the code of the ASCII files.

3 Click Create to start the process.

Figure 65, Create Definition Files

Create Definition Files (tuxch0204m000)

Field Description

Selection Range

ExchangeScheme

Enter a range of exchange schemes for which you want tocreate definition files.

ASCII File Enter a range of ASCII files whose structure you want tocopy into sequential files.

Page 126: U7137A US

Miscellaneous

Exchange User Guide

7-18

Print ASCII File (tuxch0202m000)

Use the Print ASCII File (tuxch0202m000) session to print an ASCII file withASCII file fields of an exchange scheme. You can use this session to test thereadability of an ASCII file prior to importing. You can also use it to look at thecontents of a file created by the Export module.

This session uses the ASCII file format of the exchange scheme. Therefore, theMaster 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 anASCII file is being examined prior to import, the table relations (import) can beuseful but are not required. Because table relations are not required, you mustspecify the physical ASCII file name.

If the field numbers to be printed are not specified, all the fields in the ASCII fileare printed.

This process can also run as part of a job.

Follow this procedure to print the ASCII file and ASCII file fields:

1 Enter the code of the exchange scheme and ASCII file. The physical ASCIIfile is automatically entered.

2 If you want to print part of the physical ASCII file, enter range field numberswith a valid range of values.

3 Define the field numbers that have to be printed.

4 Click Print to start the process.

Figure 66, Print ASCII File

Page 127: U7137A US

Miscellaneous

Exchange User Guide

7-19

Print ASCII File (tuxch0202m000)

Field Description

ExchangeScheme

Enter the exchange scheme to be printed.

ASCII File Enter the ASCII file within that exchange scheme.

ASCII File Name Baan automatically enters the ASCII file name.

Selection Range

Field Number If you only want to print part of the physical ASCII file, entera range of field numbers.

Print What

Field Numbers If you only want to print part of the ASCII file, enter a rangeof field numbers of the ASCII file.

Remove ASCII Files (tuxch2202m000)

Use the Remove ASCII Files (tuxch2202m000) session to delete the physicalASCII files used by an exchange process. This does not affect the log files thatwere created by the exchange process.

The physical ASCII files used or created by the selected exchange runs aredeleted. 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 Define the type of the exchange.

2 Enter a range of exchange schemes.

3 Enter a range of run numbers.

4 Enter a range of try numbers.

5 Enter a range of code of the batches.

6 Enter a range of table relations.

7 Specify a time period between two dates.

Page 128: U7137A US

Miscellaneous

Exchange User Guide

7-20

8 Click Continue to start the process.

Figure 67, Remove ASCII Files

Remove ASCII Files (tuxch2202m000)

Field Description

Exchange Type Enter whether this is a regular or non-regular export orimport.

ExchangeScheme

Enter the exchange scheme of the transaction to bechecked.

Run Number Enter the run number of this batch.

Try Number Enter the try number of the batch.

Batch Enter the batch number of this exchange scheme.

Batch Line Enter the line number of this batch.

Date 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 thesyntax of a range of condition scripts used in an exchange scheme. You can usethis session instead of compiling the conditions individually in the Conditions(tuxch0111m000) session. If errors occur during compilation, this session candisplay the errors.

The errors found in the condition script are stored in the path condition errorsspecified in the Exchange Schemes (tuxch0101s000) session. The error filenamelooks like e<condition>. The errors found in the condition script are alsodisplayed on screen.

Due to the limitations of this session, and because the conditions are checkedindividually, irrelevant errors may be reported.

Page 129: U7137A US

Miscellaneous

Exchange User Guide

7-21

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

Figure 68, Check Syntax of Conditions

Check Syntax of Conditions (tuxch0206m000)

Field Description

ExchangeScheme

Enter the name of the exchange scheme.

Selection Range

Condition Enter the range of conditions for which you want to checkthe syntax.

Options

Display Errors Select to display the syntax errors.

Predefined Functions/Variables (tuxch0510m000)

The Baan Tools programming language is used in condition scripts. Certainfunctions and variables are also available to write condition scripts in Exchangethat overrules generated condition scripts.

You can use the Predefined Functions/Variables (tuxch0510m000) session todisplay these predefined functions, variables, and libraries.

Page 130: U7137A US

Miscellaneous

Exchange User Guide

7-22

Note that, with the exception of import.company, export.company andstartup.company, the variables are implemented as a define, and cannot directlybe 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 thenclick on the name of the individual function or variable. For detailed informationabout the functions, variables and libraries use the hypertext feature. Select thefunction/variable/library for which you want to see more information.

Functionsget.xch.schemeget.batchget.batch.lineget.default.dateformatqdb.searchread.tableread.table.onceread.table.companylog.messdo.not.log.conditiondo.not.export.record

Variablestriton.tabletriton.fieldelement.noascii.fileascii.file.namerun.numbertry.numberxch.typeredo.typecntl.typeimport.companyexport.companystartup.companyno.rec.readno.rec.writeno.err.rejectsno.cond.rejectsno.rec.skip

Page 131: U7137A US

Miscellaneous

Exchange User Guide

7-23

Main Librariestudllcommontudlldate-linetudlldate_timetudllfile_pathtudlllink_comtudlllink_deftudlllink_filetudlllink_runtudllloggingtudllmultilinetudll_predefinetudllxch2

Figure 69, Predefined Functions/Variables

Page 132: U7137A US

Miscellaneous

Exchange User Guide

7-24

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 (tablefields) to the import field relations. You can use this list to check the Baan fieldsthat do not occur in the exchange scheme. Undefined fields remain empty if anew 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 Enter a range of exchange schemes.

2 Enter a range of batches.

3 Enter a range of table relations (import).

4 Click Print to start the process.

Figure 70, Print Exception Report for Baan Fields

Print Exception Report for Baan Fields (tuxch0423m000)

Field Description

Selection range

ExchangeScheme

Enter a range of exchange schemes.

Batch Enter a range of batch numbers.

Table Relation(Import)

Enter a range of table relations to import for which you wantto print exception reports.

Page 133: U7137A US

Miscellaneous

Exchange User Guide

7-25

The Conversion sessionsIf you are converting from 6.1.a to a new version or release of Baan, you can usethe Convert Exchange Schemes from 6.1a (tuxch9211m000) and Conditionsfrom 6.1a (tuxch0511m000) sessions.

If you are converting from another version of Baan, refer to the genericdescription contained in the next section, “The procedure for converting data.”

The following sessions are included in the Conversion module:

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

The procedure for converting dataUsing the Exchange module, you can convert data from a prior Baan version orrelease to a new version or release. If the data includes customized table anddomain definitions, you need to alter the conversion procedure to accommodatethe changes in the data dictionary.

By using this procedure, data entered in the older version of Baan can be used inthe newer Baan version, which saves on reentering data. Please note that thisprocedure 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 structureof tables, such as fields, field types, lengths, and the sequencing of fields in thedatabase. When you upgrade the Baan environment, new fields can be appendedto existing tables and existing fields can have changed attributes.

Before you can upgrade the Baan environment, you must convert the data toadhere to this new structure. Depending on release requirements, a conversioncan have either a reconfiguration of tables and exchange, or only an exchange.

The first type, conversion with a reconfiguration of tables and exchange, occurswhen you install an update release in an existing Baan environment. To convertthe data, you change the package combination of the company. This procedurereconfigures the tables to meet the new specifications. However, if the newversion requires new data, you also need to provide an exchange scheme.

The second type, a conversion with exchange only, occurs when you install anew version and a new Baan environment. The conversion procedure must theninclude steps on both the previous and new versions. In this case, Baan providesexchange schemes for you.

Page 134: U7137A US

Miscellaneous

Exchange User Guide

7-26

The procedure and result for both types of conversion are the same; that is, thedata 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 deliversexchange schemes with the new Baan version.

For the old release, you usually install the exchange schemes using the importprogram provided in the database tools. You must change the company numbersin the batches of the exchange schemes to export the data for the companies to beconverted. You might need to execute some conversion-specific sessions at thistime. These sessions prepare the data required in the new release. The data isthen exported to ASCII files. As an alternative, you can use the database tool,Create Sequential Dump of Table (ttaad4226m000) session instead of anexchange scheme. The method of exporting data is described in detail in therelease-specific conversion procedure.

For the new release, you usually install the exchange scheme using the importprogram provided in the database tools. You must change the company numberin the batches of the exchange scheme. You can modify the exchange scheme sothat the exports associated with the old release are imported using an exchangescheme.

Exchange schemes

XCH - export

BAAN (old version)

XCH - import

BAAN (new version)

BAANdata

BAANdata

dump

Figure 71, An overview of the conversion procedure

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

Page 135: U7137A US

Miscellaneous

Exchange User Guide

7-27

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 youhave 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 canperform the Baan conversion. This is described in detail in books written abouteach specific conversion. In the new Baan environment, you follow the samesteps, which are shown in Figure 72, The conversion procedure.

Create Table fromSequential 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 someadditional steps. You need to modify the remaining sessions in the Master Datamodule and the Table Relations (tuxch0121m000 for import and tuxch0131m000for export) and Field Relations (tuxch0122m000 for import and tuxch0132m000for export) sessions. Refer to Chapter 3 "Import module" and Chapter 4, "Exportmodule," for more information about these sessions.

You must also extend the import exchange schemes with the steps described inthis section.

You can modify table definitions using development tools. The bookProgramming (7377US) covers the subject of tables and domains.

Page 136: U7137A US

Miscellaneous

Exchange User Guide

7-28

After you have made these modifications, you must reconfigure the existing databased on the old definitions according to the new definitions. If you havechanged table or domain definitions, you can use the Exchange module tomodify the existing data according to the new customized definitions.

The relationships between the modules used for this conversion are shown inFigure 73, The conversion procedure with customization.

Master data

Export

Table and Domainmodifications

Import

Figure 73, The conversion procedure with customization

Use the sessions contained in the Master Data module to enter or modify theASCII file and formats. Use the sessions contained in the Export module tomodify the export data.

After data is exported, you can apply the domain and table definitions to the newrelease. You can usually reuse the information for the import in the Master Datamodule, and only specify the table and field relations in the Import module.Finally you compile the import script, and the actual import starts.

Page 137: U7137A US

Miscellaneous

Exchange User Guide

7-29

Convert Exchange Schemes from 6.1a(tuxch9211m000)Use the Convert Exchange Schemes from 6.1a (tuxch9211m000) session toconvert 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 otheroptions that you want for the second run.

Only select Clear Old Conditions if the results of the conversion of conditionshave been checked. Conditions can contain errors, and you need the oldcondition texts to correct them. You can view the original conditions using in theConditions from 6.1a (tuxch0511m000) session. The condition errors are loggedin 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 alsorun as part of a job.

Follow this procedure to convert exchange schemes:

1 Use the check boxes under Attachments to define how to convert theexchange schemes.

2 Enter the log file and separator character under Details. The log file can onlybe entered if at least one of the Convert Conditions and Replace Conditionsare selected. The separator character can only be defined if the ConvertDomains and Separators check box are selected.

3 Enter a range of exchange schemes and ASCII files.

4 Click Convert to start the process.

Domains

Make sure that the domain check on database level is disabled before youconvert domains.

The conversion of domains in the first run can influence the selection range ofsuccessive session runs. The range of exchange schemes or ASCII files may haveto be changed on the second run. For example, during a conversion of thedomains, exchange scheme Scheme-1 to Scheme-1 will be converted toScheme_1. The hyphen (-) is an illegal character in the exchange scheme name.It is converted to the underscore character(_). During the conversions of startpositions 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.

Page 138: U7137A US

Miscellaneous

Exchange User Guide

7-30

Click Display Log File to view the contents of the log file.

More characters and character combinations are illegal for the following domainsthan for previous versions of Baan Exchange. These illegal characters arereplaced by legal characters during the conversion. The following domains arechanged in version 6.1 b of the Baan Exchange:

n tuxch.cxch for exchange schemesn tuxch.casf for ASCII files

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

n cxch: first field in most tables*, 001.mxchn 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 conflictingnames. This is necessary to avoid a condition or table relation being movedinadvertently to another exchange scheme. If there is a name conflict, a numberis added to the cxch or casf field code.

Only a maximum of 11 conflicting names, for example scheme#, scheme_, andscheme+, can be handled.

Separator

The separator character, consisting of the Separator Character field and theControl Character check box, has been moved from the ASCII files table(tuxch002) to the exchange scheme (tuxch001) table. Therefore, if the ControlCharacter and Separator Character fields have been filled in version 6.1 a, it willno longer be correct in version 6.1 b.

If Separator is selected, a new separator character is added to each exchangescheme in the range that has no separator character.

Convert Conditions

Because a condition is no longer directly linked to an ASCII file, the conditionscript does not recognize fields of the ASCII file. You must therefore useparameters. The name of the parameters should be the same for different ASCIIfiles for which the condition is used. To enforce this, a parameter should be thesame 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 begenerated for each variable that is used (but not declared) in the script and is afield of the ASCII file.

Page 139: U7137A US

Miscellaneous

Exchange User Guide

7-31

Parameters are stored in the Parameters by Condition table.

The log file lists all converted conditions, remarks, error messages, and warningmessages. Error messages will be logged in the log file if:

n An error occurred on reading or writing a conditions text.

n A condition could not be compared to an existing condition to check if theexisting condition is the same and could therefore be reused (error caused byto read or write problem).

n Conflicting update.field.(x) commands occur within one script.

n The return type of a condition is not correct for all the places where thecondition 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.

n In the condition, a return statement is missing.

n The syntax of a condition could not be checked. The directory for sourceobject could not be created or source file could not be written.

n A converted condition contains syntax errors.

Warning messages will be logged in the log file if:

n A unique name had to be generated for the condition. The old conditions codecould not be used because of name conflicts.

n A condition is used in tuxch022.ccon to fill a BaanERP date field. The dateformat might be changed in Baan Exchange version 6.1 b.

n A condition with a correct syntax results in the following warning messageStatement 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 toreplace another condition if the conditions are equivalent.

No message will be logged for:

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

For most subfunctions of convert.conditions(), the log file must be open forwriting and function log.file.init() must have been called.

After calling the convert.conditions() function, the program should call theremove.tmp.include.file(). This is because a temp.include file is used forcompiling the converted conditions.

Page 140: U7137A US

Miscellaneous

Exchange User Guide

7-32

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, andanother condition, also called C1, is used in ASCII files A4, A5, and A6, the lastone 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 Table Relations (Import) (fields econ, acon, ocon, ucon, dcon, scon).n Field Relations (Import) (fields ccon, rval, uval).n Field Relations (Export) (field ccon).

The fields of these tables, which previously contained old conditions, refer nowto the new conditions.

In Baan Exchange version 6.1 b, two additional update conditions are added. Therelevant fields are copied from the already existing overwrite conditions. Fourfields are copied:

n Overwrite Record? is copied to Update Recordn Overwrite Condition is copied to Update Conditionn Overwrite field is copied to Update Fieldn Overwrite Condition is copied to Update Condition

List all replacements in the log file except overwrite conditions that are copied toupdate conditions. An error is logged if no new condition could be found tocorrespond an old condition in the converted conditions table (tuxch017).

For most subfunctions of replace.conditions.where.used(), the log file must beopen for writing and function log.file.init() must have been called.

Log file

Error messages are logged if:

n Errors occur during the reading or writing of condition texts.n A condition cannot be compared to an already existing condition, to make

sure that the condition codes are not identical.n The return value of a condition is not true for all places where the condition is

used.n A return statement is missing in the condition script.n The syntax of a condition can be checked.n Converted conditions contain syntax errors.n A condition cannot be replaced because it is not converted.

Page 141: U7137A US

Miscellaneous

Exchange User Guide

7-33

Warning messages are logged if:

n A unique code is generated for a new condition to avoid code conflicts.n 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 anotherequivalent condition.

Figure 74, Convert Exchange Schemes from 6.1a

Page 142: U7137A US

Miscellaneous

Exchange User Guide

7-34

Convert Exchange Schemes from 6.1a (tuxch9211m000)

Field Description

Options

Convert Domainsand Separators

The first time you run a conversion, select only this optionand clear the others. This converts the domains and setsthe separators.

Control Character Select to add a new control character to each exchangescheme in the specified range that has no separator, andtherefore no control character.

Reset StartPositions ASCIIFiles

Select to reset the start positions of ASCII file fields.

In versions before the 6.1 b ASCII file, the fields could startat position 1 or 2. In version 6.1 b, they always start atposition 1. If the start positions of a range of ASCII files areconverted, the ASCII File Fields table will be updated forthe ASCII files in the specified range. If the start positionsare reset, the lowest start position for each ASCII file will beequal to 1.

ConvertConditions

Select to replace existing conditions in the old version withconditions in the new version. In version 6.1.a, conditionswere stored by ASCII file and had to be duplicated to beused by more than one ASCII file. In newer versions this isnot necessary because conditions are no longer stored byASCII file.

Conditions were defined by cxch/casf/ccon in BaanExchange version 6.1 a, but are defined by cxch/ccon inBaan Exchange version 6.1 b.

Redo ConvertedConditions

Select to convert the conditions again when you repeat theprocess. The new condition is deleted and the old conditionis converted again.

ReplaceConditions

Select to replace old conditions that were used in the firstconversion.

Replacements are put in the log file, except overwriteconditions that update conditions. An error will be logged if,for an old condition, a new condition could not be found inthe converted conditions table (tuxch017).

Page 143: U7137A US

Miscellaneous

Exchange User Guide

7-35

Clear OldConditions

Select to remove old conditions that were successfullyconverted and replaced.

This option also deletes the conditions from the temporaryConverted Conditions table. From the old ConvertedConditions table, only the conditions that are in theconversion table will be deleted. Therefore, if a conditionhas not been converted at all, for example because a logfile could not be opened, the old condition will not bedeleted.However, if the condition has been converted, it will bedeleted even if the new conditions contain syntax or othererrors.

Details

Logfile Enter the name of the logfile to which error messages arewritten.

Separator Enter the separator character to be used in every exchangescheme that does not have a separator character.

Selection Range

ExchangeScheme

Enter a range of exchange schemes.

ASCII File Enter a range of ASCII files.

Page 144: U7137A US

Miscellaneous

Exchange User Guide

7-36

Conditions from 6.1a (tuxch0511m000)

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

Figure 75, Conditions from 6.1a

Conditions from 6.1a (tuxch0511m000)

Field Description

ExchangeScheme

Enter the name of the exchange scheme.

ASCII File Enter the name of the ASCII file.

Condition Confirm the old condition.

Description Displays the description of the condition.

Type Displays the type of condition.

Script Indicates whether the condition includes a script.

Syntax OK Indicates whether the syntax of the condition wasacceptable.

Page 145: U7137A US

Exchange User Guide

8-1

Baan has developed a Generic Exchange Scheme that you can use to installstandard exchange schemes delivered by Baan or Baan partners. You can alsouse it to copy customer specific exchange schemes to other companies orsystems, for example, in a multisite environment.

The Generic Exchange Scheme contains two batches:

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

You must complete the following steps before you can use the Generic ExchangeScheme:

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

To install the Generic Exchange SchemeThe 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 toenter the correct directory when you install these files. If you use FTP to copy thefiles, use ASCII mode. To install the Generic Exchange Scheme take thefollowing steps:

1 Choose Baan ToolsÅDatabase ManagementÅDatabase Utilities, andstart the Create Table from Sequential Dump (ttaad4227m000) session.

2 On the Details tab, define the company where you want to store and run theexchange scheme. This can be either your current company or anothercompany 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

8 Generic Exchange Scheme

Page 146: U7137A US

Generic Exchange Scheme

Exchange User Guide

8-2

3 On the Files tab, select Sequential File has Fixed Record Length. On thistab 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 donot already have an exchange scheme called ‘generic’ in the specifiedcompany, because that is the name of the Generic Exchange Scheme that willbe created. If you already have an exchange scheme ‘generic’ you can renameit 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 addsthe 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 displayedbelow. Note: the company range should be the same as the one selected forthe previous session.

5 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 theGeneric Exchange Scheme to your environment and create the export/importprogram.

Page 147: U7137A US

Generic Exchange Scheme

Exchange User Guide

8-3

Customize the Generic Exchange Scheme1 Run the Batches (tuxch0104m000) session in the Exchange module.

2 The field details are displayed in Figure 76, Batches, using the GenericExchange Scheme. Change the field Company to your current workingcompany 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, soyou 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 SchemeTo export one or more exchange schemes you must first run the Create ExportPrograms (tuxch0228m000) session for exchange scheme generic, batch‘EXPORT’. Then you can run the actual export or import using the Export DataNon-Regular (tuxch0233m000) session or the Export or Import Data on aRegular Basis (tuxch0234m000) sessions. Both sessions are located in the BaanExchange, Export Module.

To import one or more exchange schemes you must first run the Create ImportPrograms (tuxch0227m000) session for exchange scheme generic, batch‘IMPORT’. Then you can run the actual import using the Import Data Non-Regular (tuxch0223m000) session or the Export or Import Data on a RegularBasis (tuxch0224m000) session. Both sessions are located in the Baan Exchange,Import Module.

Page 148: U7137A US

Generic Exchange Scheme

Exchange User Guide

8-4

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