Setup > Usage > Imports / exports > Import/export templates 

This function is used to define the file formats used by the object import and export functions in order to import or extract data from the software database.

A file that can be used by the import module and generated by the export module is a file with one of the following structures:

  • flat file with fixed length fields.
  • flat file with separator between the fields (and records).
  • XML file.

The import/export module uses the notion of object in order to update the database. An object is defined by a group of tables and screens, as well as the standard actions associated with the fields and the update. There is thus the guarantee that all the controls and actions needed during the database update are carried out: a single description of the object is indeed used to both generate the code relative to an on-line update and to an update by import.

When an object only updates one table, the import template describes its list of fields to be integrated, based on the fact that a block of data of the file to be imported or exported contains the data of a record. When several tables are updated by an object (e.g. the header and lines), several blocks of data will be found for an instance of the object to be integrated (e.g. a block defining the header and N blocks with one block for each line).

It should be noted that it is also possible to import a table without associating the notion of an object with it. For this purpose, the object field is left blank and the table and fields concerned are simply entered in the grid of the second tab. The import is then carried out without any control apart from those induced by the formats associated with the data types of the fields.

Prerequisites

SEEREFERTTO Refer to documentation Implementation

Screen management

Header

Presentation

An import/export template is identified by an alphanumeric code. Other than a title, two tabs are used to define the technical characteristics of the template.

Close

 

Fields

The following fields are present on this tab :

This code identifies the import-export template.

  • Description (field INTIT)

[object Object]

  • Active (field ENAFLG)

Select this check box to activate the current record.

Disabled records keep their content and setup but cannot be used (by recalling their code) on other records (documents, settings ...), or for mass processes.

The authorizations to a given function can prohibit the creation of an active record. In this case, the check box is disabled by default. It can only be modified by an authorized user or through a signature Workflow.

Close

 

Tab Header

Presentation

This tab defines the general characteristics of the template, that is to say:

  • the data that must be exported
  • the general structure of the file (format, coding, data group definition)
  • additional parameters

Close

 

Fields

The following fields are present on this tab :

General

It Indicates the object code to be imported or exported. In the case of export, this field is optional; the main table name to be exported is indicated in the identifying block.

It is used to initialize the context (especially if the same object is used by several functions) and check the access rights. Indeed, users must have the appropriate rights to access the function to be able to use the template.

This field is mandatory.

  • Module (field MODULE)

[object Object]

An activity code is used to:

  • make optional an element in the dictionary if the value associated with the activity code is null.
  • identify the specific/custom elements if they are marked with a code starting with X, Y or Z.
  • size a maximum number of lines when the activity code marks elements from a grid.

In this way, if the activity code is disabled, the marked element will not be useable, and the associated code (if any) will neither be generated nor can be activated.

This access code makes it possible to prohibit access to the current record for some users.

As a matter of fact, if the field is completed, only the users having this access code with read rights (respectively write rights) can view (respectively modify) the concerned record.

The execution right associated with a user code is processed in a particular way in the case of the import-export templates : if a user has not been granted the execution right, they cannot use the template to import or export data.

  • Standard script (field TRTIMP)

It defines the standard process which includes the labels of those actions called in the import-export processes.

These processes are used to carry out initializations, additional controls and, if required, updates. The structure of such a programme can be found in the technical appendix. It should be noted that the standard processes usually named IMPXXX, XXX being the import code, are supplied for a certain number of imports.

For additional information on these actions, refer to the corresponding appended documentation.

  • Specific script (field SPEIMP)

It defines the specific/custom process which is called before the standard process, and which is used to carry out the same actions by de-activating if necessary what is carried out by the standard process.

The possible actions are, among others, initializations, additional controls and updates, if required.

For additional information on these actions, refer to the corresponding appended documentation.

Structure

  • File type (field TYPFIL)

It defines the structure used to manage the data in the file to be imported or exported. For further information, refer to the corresponding paragraph.

  • Field separator (field SEPFLD)

It defines the separator between two fields.

To enter a non-printable character, it is necessary to enter a '\' (back slash) followed by 3 numbers representing the ascii code of the character in decimal base.

  • Record separator (field SEPREC)

It defines the separator between two records (data groups).

To enter a non-printable character, it is necessary to enter a '\' (back slash) followed by 3 numbers representing the ascii code of the character in decimal base.

The following is often used :

  • the line feed character (\010), which corresponds to the end of the line in text files in Unix
  • the combination of the two characters carriage return, line feed (\013\010)n which corresponds to the end of the line in Windows text files.
  • Field delimiter (field FLDLIM)

The field delimiter (usually the character ") is added in the first and last position for alphanumeric fields. For numeric and date fields there is no requirement for a delimiter.

It is usually one of the following characters :

  • 'simple quote'
  • "double quote"
  • File format (field CODDBA)

It defines the format of the characters used in the file :

  • ascii is the standard format where a character is equivalent to a byte in the file. This type of format is used to deal with traditional occidental characters, with different possible character sets, defined in the corresponding field.
  • utf8 corresponds to a UNICODE format where the number of characters varies (from 1 to 4, 1 corresponding to the non-accentuated latin character set). This format makes it possible to deal with all types of characters, for instance the Chinese characters.
  • ucs2 corresponds to Microsoft's standard format where characters are systematically stored on 2 bytes.

Export

  • Export (field EXPORT)

If this field is checked, it will be possible to use this template in the export of data.

  • Export sequence no. (field CHRNUM)

This field, only displayed, stores the value of the sequence number when the last export took place. When performing chronological exports, this is useful to process only what has been modified since the last export took place.

Transcoding

  • Character set (field OPTCHA)

When the ascii character set is being used, it is possible to use various standardized formats :

  • The ISO 8859 code (which is also Adonix internal set when using the ascii format)
  • The IBM PC code
  • The ASCII 7 bits code (without accents : The accentuated letters are converted into the corresponding minuscule.)
  • Decimal separator (field SEPDEC)

It defines the decimal separator used for numbers. If this field is empty, the system will consider that the decimal separator is '.' (full stop).

  • Date format (field OPTDAT)

It defines how the date type fields are coded (order and number of characters for the year). 

Only the order of characters and the number of characters in the year can be specified. Upon import, any separation characters between fields are filtered; in this way, the dates in the form 29-05-59 or 09/04/1991 are correctly decoded.

The decoding sub-program takes into account the engine adxdcs variable, documented via the DCS setup that is found in the general parameters in order to define the manner in which a year is decoded over two characters. DCS represents the "pivot" year that defines the century change.

For instance, if DCS is set to 1940, any year made up of two numbers less than or equal to 40 will be considered to be part of the 21st century and any year greater than 40 will be considered to be part of the 20th century. It will therefore be possible to express the years between 1940 and 2039 with two numbers.

The AAAA-MM-JJ format is kept only for XML exports.

  • field LIBDAT

Title associated to the previous code.

  • Local menu format (field OPTMNL)

The fields of type "local menu" are stored under the form of a number representing their rank in the table.

According to the value of this field the template will export (or expect to find in import).

  • 0 : 0 : in this case, the choice is in the form of a number that indicates the rank of the menu in the table : 1 for the first choice, 2 for the second etc. This also corresponds to the internal format under which the local menu is stored in the database.
  • 1 : 1 : the choice is entered using the code (on one character) associated with each choice of local menu. This code is not visible in local menu management. It can be defined in the development functions in message management : there is the possibility to enter this internal code (which is only used for that purpose, unlike for earlier character versions, when it was used as an entry accelerator).
  • n : (n>1) the first n characters of the label displayed in entry. When using this option, the search algorithm searches for the first character, then the second and so on, until a single corresponding title exists. Thus if a search is carried out to find CHQ in a local menu where the titles are Cash, Transfer, Check, Draft, Bank/credit card, the algorithm will find Check (the only title whose first two letters correspond).

Taking into account the fact that the local menu titles are only the labels used in display, the value stored in the database being the rank in the table, it is entirely possible to change the title of the local menus at the time of an import, in order for the search algorithm to operate correctly. However be aware that the fact of changing the local menu titles can only be made in single user mode, also it is not designed for regular or automatic transfers.

  • field LIBMNL

Title associated to the previous code.

Import

  • Import (field IMPORT)

If this field is checked, it will be possible to use this template for the import of data.

  • Update allowed (field OPTUPD)

It makes it possible to modify an already existing record during import.

  • Temp storage space (field AOWSTA)

When this box is checked, the data import feeds the import-export storage space with the wrong data. The fact that the storage space is fed does not prevent the creation of an error file.

  • Special import (field OPTSPE)

It indicates that the data integration into the database is made using specific/custom actions defined in the process whose name is given in the Import process field. This specific/custom process includes a restricted number of entry points and therefore requires the writing of a process including all the controls that should be carried out.

Its use resides in the fact that it is possible to group the controls in order to optimize the import program. The structure of the specific/custom imports is described in appendix. The following actions, among others, should be found :

  • a label $RAZCRE that is directly called by the import.
  • a label $SAIMSK that is directly called by import for each record read and replaces the standard Call SAIMSK (allocation and control of the mask fields starting from class [F]).
  • Authorized creation (field OPTCRE)

When this box is checked, the import-export template can be used to create new records in the database.

  • Workflow (field ENAWRK)

If this box is not checked, the workflow events relating to the basic operations (creation, modification in object management mode) are not called any longer. In this way, if imports are started and generate mass updates, the release of a multitude of events of this type is avoided, which could impair the performances of the import and cause the mass sending of messages.

This does not means nevertheless that the workflow events relating to the release of the import are disabled.

Grid Identifiers

  • No. (field NUMFLG)

 

  • Level (field FLGLEV)

It defines the group's overlapping level. Level 1 is the main level, a N+1 level defines a sub-level of the preceding N level.

  • Indicator (field FLGREC)

It identifies the group by a code containing a maximum of 5 characters, this code will be mentioned in the field grid of the following tab, and in the file itself, as group header.

This indicator grid defines the structure of the record groups. Refer to the corresponding paragraph.

  • Key (field FLGKEY)

It defines the key of the linked table used to access the detail of the group records, from values of the upper level tables used in the link expression.

  • Link (field FLGLNK)

It defines the link expression, in other words, a series of values separated by a semicolon which gives the key values linking the detail table to the header record.

  • Length (field RECLEN)

In the case of a file with fixed length, it is necessary to indicate the number of characters for each record.

Close

 

Tab Fields

Presentation

The different fields to be imported are defined in this grid, organized in groups identified by the Code column, in which is found one of the codes defined in the indicator grid of the first tab (the field can remain blank if no table has been defined).

This tab contains the grid defining the detailed structure of the groups existing in the first tab. It should be noted that:

  • It is not mandatory to define fields in all the groups (in fact, some groups are simply "technical groups" defining links). Imagine for example that the fields from the order header and the fields from the pay-by customer record are to be exported and all this in a single group of data (no separator for the data group). In this case it will be necessary to define two groups (the first defining the orders, the second associated with the customer with the appropriate link). However, only the lines associated with the second group are entered in the field tab. These lines can include both the information extracted from the customer and from the order header (since both are on line).
  • It is imperative to define for each group the position where the group separator is located in the case of a template that can be used for imports and with multiple groups. It is the pseudo field/ (slash) that makes this definition possible.
  • The blocks must be ordered sequentially: when a block exists for a lower level, it must follow the block to which it is linked.

Close

 

Fields

The following fields are present on this tab :

Grid Fields

  • No. (field NUMLIG)

 

  • Indicator (field TYP)

This field is only entered if the group indicator grid in the previous tab is not empty. It is used to attach the information to be exported or imported to a group of data.

Defined here is the database table where the data to be imported or exported is defined. It should be noted that:

  •  This field is mandatory even if it of no particular use (if in the export template and a calculated expression is defined, this can reference fields coming from several tables).
  • The table in question is not necessarily the main table associated with the group, but it can be a table linked to the main table in this group or one of the previous groups in the superior level. If no link is found, a warning message is displayed : Automatic link no managed. This means that for the import or export process (entered in the first tab) it is necessary to carry out this link manually (by declaring for instance the table in the IMP_OUVRE action, and the read of the table in the IMP_LIENS action).
  • Field (field FLD)

It is used to indicate the name of the field of the table to be imported or exported. Different syntaxes are possible here in order to define the information to be extracted or integrated :

  • The character / (slash) means that a group indicator is written upon export or searched for during import. In a template used for the import, when several groups exist, this separator is mandatory for each group. The group separator is supposed to be a normal field (enclosed by field separators and delimiters if the template type Delimited is used).
  • The most simple syntax is FIELD(index), when a field coming from the table declared in the previous column is imported or exported. A selection window is used to display the possible fields.
  • If a constant string of characters enclosed between double-quotes ( " ) is entered here, the field will be written as it is in the file to be exported and ignored in the import.
  • If nothing is entered, it means that there will be an empty field in the exported file (enclosed by field delimiters if the template is of the type Delimited). In import mode, it means that the corresponding field must be ignored.
  • The syntax *N, where N is a number between 1 and 99, is also possible. This can be used to assign (in import) or to read (in export) the GIMP(N) variable. GIMP is a global variable, of the character string type, with a maximum length equal to 100, that must be assigned in a specific/custom process associated with the import or export.
  • The last possibility, only used in export, consists in defining any calculated expression preceded with the sign equal ( = ). This expression, which can call constants, functions, variables, operators and fields coming from on-line tables, is syntaxically verified upon entry (the control of the context, in particular the fact that the variables exist, cannot obviously be verified).
  • Description (field COM)

Add a comment to make it easier to understand parameterization.

  • Range (field SEL)

Three choices are possible in this field :

  • Not enteredmeans that no start-end range will be entered for this field when launching the export.
  • Enteredmeans that a start-end range will be entered for this field when launching the export.
  • Not transferredmeans that a start-end range can be entered for this field when launching the export, but that the field will not be transferred during an import or an export.
  • Position (field LOC)

This column is only useful in the case of a fixed length format ; in this case, the position gives the gap with respect to the start of the block or the record (positions given in number of bytes, 1 signifying that it is the start of the section or record). The positions must be compatible with the size of the record.

  • Length (field LNG)

This field determines the length of the field for a sequential file.

  • Format (field FMT)

This column is only entered if the format is fixed length. For numeric amounts, the format entered is defined in the form of nnn or nnn.mmm, remembering that these numbers can be prefixed by < or > (left or right framing being completed with zeros, the right alignment must be used by default), prefixed or suffixed by the character + (mandatory sign before/after the number), and prefixed by the character * (the decimal separator must not appear). The grid below displays examples of the formatting for a given amount (the spaces are replaced here by #).

Format

Amount

Result of the formatting

7.2

123.456

####123.45

7.2

-123.456

### -123.45

>7.2

123.456

0000123.45

>7.2

-123.456

-000123.45

<7.2

123.456

123.45####

<7.2

-123.456

- 123.45###

6.2+

123.456

###123.45+

>6 .2+

123.456

000123.45+

<6.2+

-123.456

123.45-###

For an alphanumeric format, the only formatting directives that are possible are < or > (left or right alignment, remembering that the character strings are completed with spaces).

  • Pattern (field PATTERN)

This field is used when imports/exports are carried out under the XML format.

Indeed, when a XML file is created, some more information are required, especially in order to create a XSD file describing the structure of the XML file and then, to control its validity with syntax check tools integrated to the different ETL software.

This field defines whether a template has to be associated to the description entered in the XSD description.

If this field is entered, the XSD field will contain a specification of type:

pattern value="value_entered_in_the_pattern_field"

It is possible to find in the online tutorials (like this one) the syntaxes that can be used for the patterns.

  • Tag (field BAL)

This field is used when imports/exports are carried out under the XML format.

Indeed, when a XML file is created, some more information are required, especially in order to create a XSD file describing the structure of the XML file and then, to control its validity with syntax check tools integrated to the different ETL software.

This field defines the code of the tag describing the field exported in the template, as it appears in the XML file.

  • Mandatory (field OBL)

This field is used when imports/exports are carried out under the XML format.

Indeed, when a XML file is created, some more information are required, especially in order to create a XSD file describing the structure of the XML file and then, to control its validity with syntax check tools integrated to the different ETL software.

This field defines whether the field is mandatory or not. If the value of this field is set to Yes, the XSL file will contain a specification of minOccurs="1" type

This number, if it exists, refers to a transcoding table used to transcode the field that is read and make it comply with the expected format.

File generation

  • field TYPEXP

 

  • Data file (field FILEXT)

It is used to define the path of a default data file that will be proposed during the launch of the import or export (and used in automatic fashion when launching an import or export chain). This file path can be relative, in this case, the database directory is supposed to be the database directory for the installation of the software).

The path can include the character #. If this is the case, there will be a sequential number management :

  • In import mode, this means that all the files where the template corresponds to the path will be searched, with # representing 5 numbers (the files are integrated in increasing order of the numbers)
  • In export mode, this means that a file is created integrating the formatted value of the sequence number counter [C]EXPORT on 5 numbers. This normally goes with checking the Sequence Number Management box during the launch of the export function.

For instance, if the export sequence number is equal to 156, /u/tmp/fil# makes it possible to generate the /u/tmp/fil156 file.

  • Final directory (field REPFIN)

It is used to force a final directory to which the file will be transferred after having been imported. Should there be no value, the directory mentioned in the import/export general parameters is used.

Close

 

Action icon

Select a Field

Fields

The following fields are included in this window :

Block number 1

It defines the table for which the fields to be inserted must be selected.

Grid

  • No. (field NUMLIG)

 

  • Field (field CODZONE)

In this column the field name for the table is defined as it will be expressed in the software (a field with the name NOMCHAMP defined in an ABV abbreviation table can be accessed using the syntax [F:ABV]NOMCHAMP ).

For custom/specific fields, the field name must start with X_, Y_ or Z_.

In the database, each zone corresponds to one or more fields (according to whether or not the zone is sized : the corresponding fields are called NOMCHAMP_0, NOMCHAMP_1, NOMCHAMP_2…)

To enter and display the corresponding field on a screen, it is given the same name in the screen dictionary and the screen and the table will be used simultaneously in object management.

  • Description (field INTITCOURT)

Title associated to the previous code.

  • Selection (field SELECT)

If the field is equal to Yes it is inserted into the main table. By default, the fields that are not in the main table are proposed to be set to Yes, and those that are in the main table are proposed to be set to No.

Close

This is used to globally insert from the current line in the grid, a group of fields coming from a table of a template.

Indicator position re-calculation

This function is only present for templates with a fixed length file types. It is used to re-calculate the position of each of the fields in the current data group (sharing the same line indicator). The re-calculation is carried out from position 1 in the first field of the group and then adding the length of each field to obtain the position of the next field.

 

Close

 

Reports

By default, the following reports are associated with this function :

 PRTSCR : Screen print

This can be changed using a different setup.

Specific Buttons

The following fields are included on the window opened through this button :

Block number 1

  • field OBJET

 

  • field CLES

 

Block number 2

  • From folder (field DOSORG)

Indicate the folder from which the record is going be copied. The possible syntaxes are described in the dedicated appendix.

  • All folders (field TOUDOS)

This option is used to copy the record to all the folders defined in the dictionary (ADOSSIER table from the current solution).

  • To folder (field DOSDES)

Indicate the folder in which the record is going be copied. The possible syntaxes are described in the dedicated appendix.

Close

This button is used to copy the record definition from or to another folder.

The following fields are included on the window opened through this button :

Grid Range

  • Field (field BNOM)

It defines the name of the field for which a range can be entered

  • First value (field BDEB)

It is used to enter start and end ranges for each field defined as an entered or not displayed criterion in the field grid. If an empty field is documented, ranges are considered to be unavailable. These ranges will be suggested by default during export.

  • Final value (field BFIN)

 

Grid Criteria

The tables used in the import/export template are listed here in order to enable any filtering of the exported data.

  • Criterion (field FLGEXP)

It is used to define a logical condition using the table fields. Only those lines meeting this condition will be exported.

Close

This button gives access to a screen in which it is possible to define the default values for the criteria to filter the exported data. When the export is launched, the criteria are displayed and can be modified; when a chain of exports is launched, the criteria are automatically applied without entry, for each of the templates in which they have been defined.

Menu Bar

Options / Export schema of a template

This function, which can be accessed when the export format is XML, is used to create an XSD file that describes the file structure created by the template. This file is created in the sub-directory following the directory where the folders are, in the application server:

 X3_PUB/FOLDER/GEN/ALL/WEBS    (FOLDER being the name of the current folder)

The file name is WWIMPTEMPLATE.xsd  (TEMPLATE being the name of the import-export template).

This XSD file is used to define the data format in order to carry out a preliminary syntax validity check using ETL tools. The syntax obtained includes (besides standard headers) lines such as:

  • Lines describing groups and lines (here an ADI template and the CODE and NUMTAB fields with the ADI_CODE and ADI_NUMTAB tags).

<xs:complexType name="ADI">

<xs:sequence>

<xs:element name="ADI_NUMTAB" type="ADI_NUMTAB" minOccurs="1" maxOccurs="1"/>

<xs:element name="ADI_CODE" type="ADI_CODE" minOccurs="0" maxOccurs="1"/>

...

</xs:sequence>

</xs:complexType>

  • Lines describing the data types:

<xs:simpleType name="ADI_NUMTAB">

<xs:restriction base="xs:int">

<xs:minExclusive value="-32768"/>

<xs:maxExclusive value="32767"/>

</xs:restriction>

</xs:simpleType>

<xs:simpleType name="ADI_CODE">

<xs:restriction base="xs:string"/>

<xs:maxLength value="5"/>

<xs:pattern value="{[A-Z]}*"/>

</xs:restriction>

</xs:simpleType>

Here are examples of numerical fields, and then alphabetical fields. A few comments on the way this syntax is managed:

  • Each field name (here ADI_CODE and ADI_NUMTAB) corresponds to the content of the "tag" column of the template.
  • The pattern heading is directly originating from the "pattern" column in the template (here, the suggested syntax corresponds to any number of alphabetical characters in uppercase).
  • The headings minOccurs and maxOccurs are entered, taking into account the "mandatory" column of the template
  • The data types, that can be "xs:string", "xs:int", "xs:decimal", "xs:date", "xs:base64Binary","xs:boolean", are originated from the corresponding X3 data, as well as the maxLength, maxExclusive, minExclusive, maxInclusive, minInclusive headings depending on the case.

Documentation / Paragraphs

This choice of menu allows to zoom to the documentation management, on the first documentation paragraph (if it exists) related to the current record.

Documentation / Links

This choice of menu allows to zoom on the dictionary link management function. This function allows to establish links between the current record and other records (for example links between functions and parameters). These links, dedicated for documentation purpose, allows the generation of documentation structure.

Documentation / Generation

This choice of menu allows to generate the documentation. Three types of generation can be separately or simultaneously started :

  • the generation of the structure of documentation from dictionary (tables ADOCUMENT, ADOCBLB, ADOCCLB).
  • the generation of the documentation itself from the previous table (they have been normally completed after the first generation).
  • the field help documentation generation.

The ranges and parameter proposed by default are defaulted according ti the current record, but they can be changed during the execution.

Error messages

In addition to the generic error messages, the following messages can appear during the entry :

Import not possible for this object

The object has not been defined for importing (checkbox Import not checked in the Miscellaneous tab).

Code already exists in line nnn

The same code associated with different groups has already been entered.

ZZZ non-existent field (XXXXXX, YYYYY, ... )

This message is displayed when a link has been expressed in the group grid using a field ZZZ that is not referenced in any of the tables (XXXXX, YYYYY, ...) defined in the previous lines.

G separator (/) not referenced in the fields. Prohibited in an import template

In the field grid, for the G group, there is no line indicating the place where the group identifier is found (syntax /).

Link not possible. Prohibited in an import template

An attempt has been made in the lines describing the fields, to insert a field coming from a table that has not been linked to the main table in the group.

Incorrect length nnn<>mmm

The length defined by the numeric format (mmm) is different from the length of the field defined in the previous column (nnn).

Note:

No directory existence test is made on the file path defined by default in the template (the directory may not yet exist: this test is only made upon launching an import or export).

Basic principles

SEEREFERTTO Refer to documentation Implementation

Implementation advice

Basic principles

When an import template is set up, it is necessary to consider the following principles:

  • The import allows creation and modification actions.
  • To determine the action to be carried out on the imported record, the system carries out an existence test of the object to be processed. This test is carried out by loading the primary key for the object with the information in the imported record.
  • As a consequence, if the main key is not set up, all the records will switch to creation mode (and only work if the key for the object to be created can be assigned automatically, for example by means of a sequence number counter).
  • An import corresponds to an entry simulation for all the screens linked to the imported object.
  • It processes all the fields in the screen by carrying out the same checks as an interactive entry.
  • It does not take into account the fields that cannot be entered in the screen. (except in specific and referenced cases). As a consequence, the fields set up in a template corresponding to a field that cannot be entered are not imported.
  • The order in which the fields are set up within the record does not matter. The import loads all the fields of the file and then imports them in the order of the fields in the screens.

Standard templates supplied

If data exports are always possible regardless of the object, this is not always the case for the import. The automatic mechanisms for decoding data flows and the call to the conditions linked to the object, greatly automate the import. However, this is not sufficient for an automatic import of complex objects. Thus, not all objects can be imported.

In the reference folder, an import template (modifiable) is supplied for each object for which the import is possible. But this import can also be linked to specific features: this is defined in the on-line help associated with the import templates for which specific cases exist (this help is accessible by Alt + F1 when the template is loaded).

The list of corresponding helps (sorted by module) can be found from the next link.

Indicators grid

Choosing the structure of the files to be imported or exported depends on the extraction or integration possibilities that are found in the external software.

In all cases, the data must be organized in logical groups of lines, which can be of different types (e.g. header, detail, sub-detail) or a single type. The organization of these groups is defined in the grid of identifiers located in the first tab of the template.

Each group is associated with one of the tables in the database (the first being the main table of the object; the others are defined by the links from the previous tables). When using the template to carry out an object export, it is possible to define the links with any table in the database in which a theoretic link exists, in order to extract the linked data. On the other hand for an import template, only the tables updated by the object are actually usable: it is not possible to simultaneously import the order and the customer, for instance. The order object was not designed for this.

It is important to note that this grid can be blank if a data structure to be imported or exported is based on the use of only the main table (in this case, the Code column for the next page will remain blank). It is also not necessary to create several data groups if several linked tables have to be exported simultaneously. In fact, if fields extracted from different tables are displayed in a single data group, the export process will attempt to resolve the links between tables using the link structure described in the dictionary. Of course, this implies that there is only one link possible from the main table in the group to the described table (if not, the first link encountered will be used, even if it is not the correct one).

There is specific case where it is necessary to create at least one group: if the template is defined with a fixed length (in this case, it is in fact necessary to define the record length somewhere from the table of groups). If the group indicator is not mandatory in the list of fields, defining this group with an empty code is sufficient: only one group can then be defined and the Code column will no longer be entered in the next tab.

The identifier grid is only accessible if the object is of the single type. If group indicators are defined, each is associated with a level, a table and the link conditions that make it possible to create links between them.

The main table is set to level 1 for import or export (this table is not entered in the grid, but is deduced from the object associated with the template).

The level of any table linked to a previous table is equal to the level of the previous table if a one-to-one link exists between these two tables, and corresponds to this level plus one if several records are linked to a record in the previous table. The link is characterized by the key for the destination table to be read and by the key segment expression whose value defines the linked lines.

Imagine for instance that groups are defined according to the following example:

Level

Group

1/

A

2/

B

2/

C

3/

E

The following information overlapping will then be obtained:

Group A record 1

 

 

 

Group B record 1.1

 

 

Group B record 1.2

 

 

...

 

 

Group B record 1.N

 

 

Group C record 1.1

 

 

 

Group D record 1.1.1

 

 

Group D record 1.1.2

 

 

...

 

 

Group D record 1.1.M

 

Group C record 1.2

 

 

 

Group D record 1.2.1

 

 

...

 

Group C record 1.Q

 

 

 

Group D record 1.Q.1

 

 

...

 

 

Group D records 1.Q.R

Group A record 2

 

 

 

Group B record 2.1

 

 

...

 

Group example

To illustrate this setup the following example takes a template (export only) including the companies and sites:

  • The main table COMPANY is level 1.
  • Imagine that information linked to the accounting currency (ACCCUR field) is required in the exported file. In this case, it is not necessary to define a new group linked to the company table, but simply to define the fields of the TABCUR table in the group. The export engine will then run through the dictionary to search for the link between the COMPANY and TABCUR tables.  Since there are several links, it is the first link that will be used (in this case, it is the one required).
  • If the purpose had been to export information related to the currency of the company stock capital (RGCCUR field), it would have been necessary to create a second block of data, also of level 1, based on the TABCUR table, and showing RGCCUR in the link column. This is also what would have to be done if the link was not explicit. For instance, the CREUSR field, which corresponds to the code of the user who created the record, uses a generic type (A) which does not allow the link to be made automatically. As a consequence, if information concerning the user who created the record had to be displayed, it would have been necessary to define the link by a group.
  • Then, suppose that the list of sites linked with the company needs to be displayed. A level 2 group is then created, using the FACILITY table, with a link based on the FCY index taking the value of the CPY field of the main table.
  • Eventually, if the setup values directly related to each company need to be extracted, a second level 2 group of data will be created, using the ADOVAL table, with a link based on the ADW0 index, taking the value of the CPY field of the main table.

The grid below sums up the gid of Identifiers as they would be entered:

Level

Code

Table

Key

Link

1/

CPY

COMPANY

CPY0

 

 main group record

1/

CUR

TABCUR

TCU0

[CPY]RGCCUR

 1 linked record

2/

FCY

FACILITY

FCY1

[CPY]CPY

 N linked records

2/

ADP

ADOVAL

ADW0

[CPY]CPY

 M linked records

The various file formats

The file formats are determined by the type, which can take one of the values below:

Field separators:

This is a field with variable length, where all the fields are separated by a separator (the separator field being SC).

Field 1 record 1

SC

Field 2 record 1

SC

...

Field N record 1

SC

Field 1 record 2

SC

Field 2 record 2

SC

...

Field N record 2

SC

Record separator

This is a file with variable length, where all the fields are separated by a separator (the field separator). When the record is complete, another separator (the line separator SL) replaces the field separator.

Field 1 record 1

SC

Field 2 record 1

SC

...

Field N record 1

SL

Field 1 record 2

SC

Field 2 record 2

SC

...

Field N record 2

SL

Delimited format

This is a file with variable length of the same type as the record separator file (two distinct separators). But in addition, the fields of character string type are contained by a field delimiter (called DC, in the example below, the second field is of alphanumeric type ).

Field 1 record 1

SC

DC

Field 2 record 1

DC

SC

...

Field N record 1

SL

Field 1 record 2

SC

DC

Field 2 record 2

DC

SC

...

Field N record 2

SL

Fixed length format

This is a file where the fields are defined with a fixed length, without a field separator. The total length of the record must therefore be given in a setup. There may be a line separator. In this case, its length must not be counted in the record length.

In the same way, the length of each group is defined when blocks of data are defined in the grid of indicators.

Fld 1 rec 1

< ---------Field 2 record 1------------ >

...

< --Field N record 1-- >

SL

Fld 1 rec 2

< ---------Field 2 record 2------------ >

...

< --Field N record 2-- >

SL

XML format

It is a format where data are defined in XML tags.

Upon export, the file contains a large number of information related both to the model and the extraction. The menu Options/Export schema of a template is also used to export a XSD file describing the structure of the file created by the template.
Upon import, the useful data is less important, it is thus possible to limit this data in the file to be imported.

Flat A Format

This format is the variable format 'Record separator' or the delimited format (if the field Field delimiter is entered).

If in the import/export template several levels are defined, only one line is generated.

Level 1 flag

Field 1 record 1

SC

DC

Field 2 record 1

DC

SC

...

Level 2 flag

Field 1 record 2

 

SC 

DC

Field 2 record 2 

SL

During import, the use of this format type implies a grouping of all detail lines of a specific level under the same header if all the fields in the header are strictly identical.

Header format

This format is the same format as the 'A flat' format with an additional header line corresponding to the titles of the template fields.

This format is used, for instance, in Germany for GDPDU files.

Technical appendices

For further information see the following technical appendices: