Routines - Imports

The Imports routine allows you to import the contents of text files, previously saved in the proper format, into the Company you are working with. Usually, only new records will be added during the import process, and there is no danger that you will get duplicate data of any kind into your database. However, if you import a setting that is a set of fields and check boxes (e.g. the Account Usage S/L and Account Usage P/L settings), the imported setting will overwrite the existing setting.

To begin importing, click the [Routines] button in the Navigation Centre and then the [Imports] button in the 'Routines' window. Alternatively you can use the Ctrl-Shift-I (Windows and Linux) or ⌘-Shift-I (Mac OS X) keyboard shortcut at any time (even if the Navigation Centre is hidden). The 'Imports' list window will be opened, where you can specify what is to be imported. The options available in the 'Imports' list window will vary, depending on the active module. Double-click the option that you need and then, when the 'Open File' dialogue box opens, locate and open the import file in the normal way.

You must save or cancel all changes before trying to import information. If you are modifying a record or setting (i.e. at least one window is open with the title 'Update'), you will be told 'Some records/blocks are locked' when you attempt to use the Imports routine.

In multi-user systems, you can only use the Imports routine when you are the only user logged in.

You should use the 'Imports' function to restore your Standard ERP database from a back-up and when updating to a new version of the program. For full details of how to do this, please refer to the Restoring from a Back-up page.

You should also use the Imports routine to import information previously exported from another Standard ERP database or from a text file created by another computer program. In the latter instance, you should ensure the text file is correctly formatted (contains the information in the correct order) before importing. This format information is available from your local HansaWorld representative, and can also be found in the Export/Import Format report in the Technics module.

Usually, you will use the 'Automatic' or 'Manual file search' import functions in the System module to import information in this way. These functions require the following lines to appear at the beginning of the import file:

1    46    1    0    1    44    0    /

codepage    UTF-8
The numbers in the second line should be separated by tabs. There should be at least one empty line before the codepage. The word "codepage" and the codepage should be separated by a tab.

The numbers in the second line are parameters that inform the import procedure about the contents of the import file. The parameters are:

  1. Date Order

  2. Decimal Separator

  3. Import Mode

  4. Replace Mode

  5. String Type

  6. Thousands Separator

  7. Escape Character

  8. Date Separator
These parameters are now described in detail:
Date Order
The first parameter tells the import procedure what date format you have used in the text file. You can use the following values:






Hijri (Arabic)

Decimal Separator
The second parameter uses ASCII codes to tell the import procedure what decimal separator you have used in the text file. Typical values are:

full stop
Import Mode
Use the third parameter to specify the platform on which you created the text file, as follows:
Mac OS X, AIX, iSeries

Windows, Linux
The import procedure will use the default codepage for the platform specified here for string conversion, if the fifth parameter (String Type) is 0 and if there is no "codepage" line at the beginning of the file.

Replace Mode
The fourth parameter tells the import procedure what to do if information in the text file duplicates what is already in the database.
Any duplicate information in the text file will not be imported. Records in the database will not be replaced.

Duplicate information in the text file will be imported, overwriting existing records in the database. This applies to entire records. For example, there is an existing Customer 001 in the database with the name Customer A and Payment Terms 30 days, and in the import file Customer 001 has the name Customer AA and no Payment Terms. The import procedure will overwrite the entire record for Customer 001, so the result will be that it has the name Customer AA and no Payment Terms. Records in the database with no duplicate in the text file will not be touched.
Note that blocks will always be overwritten with duplicate information from a text file, irrespective of whether this parameter is 0 or 1. There are two types of block: the setting that is a set of fields and check boxes (e.g. Account Usage S/L, Account Usage P/L, Locking); and the setting that is a series of rows (e.g. Payment Modes, VAT Codes).

String Type
Use the fifth parameter to specify the character set used in the text file:
The text file contains characters belonging to a single character set (e.g. ASCII, KOI-8R [Russian Cyrillic], ISO-8859-1 [Western European]).

The text file contains Unicode characters.
If this parameter is 0 and if there is no "codepage" line at the beginning of the file, the third parameter will determine the codepage/character set.

By default, text files exported from a Standard ERP database will contain Unicode characters. You can change this by specifying a Default Export Codepage in the Local Machine setting in the User Settings module.

Thousands Separator
The sixth parameter uses ASCII codes to tell the import procedure what thousands separator you have used in the text file. Typical values are:
no thousand separator




full stop
Escape Character
The seventh parameter is not currently (version 8.0) used by the import procedure. You should place a 0 (zero) in this position as shown in the example at the beginning of this section.

Date Separator
The eighth parameter will tell the import procedure what date separator you have used in the text file. This parameter should be the actual character, not the ASCII code. Typical values are:
System default (set in the Company Date and Numeric Format setting in the System module)



Use the "codepage" line to name the character set that you have used in the text file. This line should contain the appropriate value taken from the left-hand column in the following table:
UTF-8UTF-8 (Unicode)
ISO-8859-1ISO 8859-1 (Western Europe)
ISO-8859-4ISO 8859-4 (Baltic)
ISO-8859-5ISO 8859-5 (Cyrillic)
ISO-8859-15ISO 8859-15 (Western European with Euro sign)
CP437DOS CP 437 (US)
CP850DOS CP 850 (Western Europe)
CP1250Windows codepage 1250 (Central Europe)
CP1251Windows codepage 1251 (Cyrillic)
CP1252Windows codepage 1252 (Western Europe)
CP1257Windows codepage 1257 (Baltic)
KOI8-RKOI8-R (Cyrillic)
MACINTOSHApple Western Europe
ACEApple Central Europe
ACYRApple Cyrillic

Generating Unique Numbers

If you are importing Quotations, Orders, Invoices, Purchase Invoices or Transactions, the import file may already contain Quotation, Order, Invoice or Transaction Numbers. However, you may want new numbers to be assigned to each record as part of the import process. If so, enter "-99" in the import file in the space where each Quotation, Order, Invoice, Purchase Invoice or Transaction Number would otherwise appear. When each record is imported, it will be given the next number in the relevant Number Series, as if you had entered it yourself.

If you use this feature, take great care over the following two points:

  1. In the case of Invoices and Purchase Invoices, the Invoice Number is determined by the Transaction Date, not the Invoice Date. The Invoice Number will be the first unused number in the Number Series for the year or other period in which the Transaction Date of the Invoice falls. Quotation Numbers are determined by the Quotation Date, Order Numbers by the Order Date and Transaction Numbers by the Transaction Date. Make sure you include these dates for each record in your import file, otherwise the imported records could be placed in the wrong number sequence.

  2. Make sure there are sufficient unused numbers in the relevant Number Series for the number of records that will be imported. If there are not enough unused numbers in the relevant Number Series, some records will not be given numbers at all.

Importing Information Automatically

It is possible to have information imported to your Standard ERP database automatically. To use this feature, follow these steps:
  1. Make sure there is a folder or directory named 'Import' in the folder containing the Standard ERP application. In multi-user systems, this folder should be on the server.

  2. Open the Optional Features setting in the System module and choose the Autoscan Import folder option.

  3. Restart your Standard ERP application. In multi-user systems, you will need to restart the server application.
Having followed these steps, any file that you place in the 'Import' folder will be imported automatically, usually within a few minutes. After being imported, the file will be deleted. If you place more than one file in the 'Import' folder at the same time, they will be imported in the alphabetical order of their filenames. Unlike imports initiated using the Imports routine, an automatic import will take place if more than one user is logged in, but only providing none of them is modifying a record or setting (i.e. providing no window is open with the title 'Update'). The automatic import will wait for all changes to be saved or cancelled. When the file is being imported, no users will be able to work, so you may find it easier to import several small files periodically, rather than one large file.

If you have more than one Company, you can specify in the import file the Company into which it is to be imported. To do this, the first lines in the text file should be:

1    46    1    0    1    44

compnr    x

1    46    1    0    1    44

codepage    UTF-8
where x in the "compnr" line is the position in the Company register of the Company into which the information is to be imported. For example, if you have Companies with Codes 1, 3, 5, 7, 9 and x is 3, the information will be imported into Company Code 5 as this is the third one in the list.

"compnr" and x should be separated with a Tab.

The "compnr" line should be sandwiched between "format" lines, and there should be at least one empty line between the first "format" line and the "compnr" line, and also between the "compnr" line and the second "format" line.

Massive Cache

If you will be importing information regularly to your Standard ERP database, you may find it advantageous to increase the cache size. Please refer to the 'Massive Cache' section on the Reports page for details.

Individual Import Functions

Please click the links for details about the individual import functions in the following modules:
Go back to: