Use this function to set up sequence numbers to be used throughout the system.

Each sequence number counter is identified by an alphanumeric code. You use this function to define the structure of each sequence number counter to suit your organization. Once you have defined the structure of your sequence numbers you use the sequence number Assignment function (GESTCA) to assign the sequence number to a specific type of document.

For example, your organization produces sequentially-numbered quotations from different sites, each prefixed with the site code. You use this function (Structures) to create a sequence code for each individual site such as SQSA, SQSB, SQSC (where SQ represents Sales quotation, and SA, SB and SC represent site A, site B and site C respectively), each with a numerical sequence number component and a site code prefix. Having defined the components that make up the structure of each sequence code you use the Assignment function to assign the appropriate sequence code to the document type Quote for each site or company.

The maximum length permitted for the combined components that make up each sequence code structure is displayed. Your structure can use fewer characters but you must not exceed the maximum permitted length.

Each sequence code must be unique, however multiple document types can be assigned the same sequence code. You must ensure, therefore, that you do not duplicate the structure for document types that must have unique keys as this can result in the cancellation of a transaction.

You can set the sequence number start value either by selecting the Reset to zero check box (ZERO) or you can use the Sequence number values function (MODCPT) to set the start value for each component of the counter. This function is particularly useful should data recovery be actioned as you can define the next chronological number for a system restart.

Sage advises that the Sequence number values function (MODCPT) is removed from the menu when your system or a new module has "gone live". This will ensure the sequence numbers will remain chronological.

Prerequisites

SEEREFERTTO Refer to documentation Implementation

Screen management

The Structures function comprises a single tab subdivided into key elements of the sequence code.

Entry screen

Presentation

Each block represents a key element that you must define for your sequence code. The Components block, however, is variable. You use this block to define the components that make up the structure of the sequence number for your organization.

Close

 

Fields

The following fields are present on this tab :

Block number 1

This code identifies a counter which is referenced when generating an automatic number for a document. A counter is an alphanumeric field of between 1 and 20 characters. It comprises a series of components which are concatenated from left to right to form the counter value.

  • Description (field DES)

Enter the description of the relevant record.

This long description is used as a title in screens and reports.

Definition level

  • Definition level (field NIVDEF)

Use this radio button to define if this sequence number series is available for the whole folder, for a single company or for a single site.

To avoid duplication of numbers Sage suggests that you use comments appropriate to the counter in the code or the description. This is especially important for company and site sequence numbers.

RTZ level

  • RTZ level (field NIVRAZ)

Use this radio button to determine if there is a unique value in the counter at a particular time, or by month or by year, financial year or accounting period.

To avoid duplication, this assumes that the appropriate components are defined in the counter, specifically for the year, the month, the week or the day.

This field combined with the Definition level field with the use of an additional field code (see Additional field) defines how many numbering sequences will be assigned to the sequence number counter (this will be a unique sequence for a sequence by month, by site and by additional value).

As a function of these two values, it is possible to introduce components to avoid duplication of numbers. In this way for example, if an annual RTZ level is defined, the year must be a component of the sequence number series. Similarly, if the sequence number series is defined by company, the site or company must be a component of the sequence number series.

Type

  • Type (field TYP)

A counter always produces alphanumeric keys. If you define the Type as Numeric the leading zeros are deleted when the value is returned. A counter that has been declared as numeric with 6 numbers will therefore start with the value "1", whilst an alphanumeric counter with 6 characters will start with the value "000001".

If the counter is defined as numeric and alphanumeric components are declared in the structure of the counter, no control will be carried out at the creation. When utilized, only the numeric part of the counter will be returned.

Grid Components

  • No. (field NUMLIG)

Line number.

  • Component type (field POSTYP)

Define each type of component that is to be used to make up the structure of the sequence number counter.

  • Length (field POSLNG)

See the explanation of each type of component that is to be used to make up the structure of the sequence number counter.

Each component has a predetermined or maximum length, as follows:

  • Constant = 10 characters.
  • Year = 1, 2 or 4 characters.
  • Month = 2 characters for a number or 3 characters for the English abbreviation of the month.
  • Week = 2 characters.
  • Day = 1, 2 or 3 characters to represent a day, the day of the month or the day of the year respectively.
  • Company = 1 to 5 characters.
  • Site = 1 to 3 characters.


  • Formula (field POSCTE)

Type in a fixed character string. You can type in any alphanumeric characters including special characters such as / and %. Do not use single or double quotes around the value.

Block number 6

  • Sequence type (field SEQ)

Sage recommends you set this radio button to Normal. For a detailed explanation of this field see Sequence types.

This field is populated when the Sequence type is set to Database sequence. It displays the name of the table associated with the numbers.

  • No. of numerals (field SEQNBR)

This field is populated when the Sequence type is set to Grouped. It displays how many numbers will be assigned simultaneously.

Miscellaneous

  • Chronological control (field CTLCHR)

Select this check box to activate chronological control for documents where current legislation requires numbers by date to be in chronological order. This is a requirement for some legislations such Italy.

Chronological control is only activated when an invoice is created in the Sales, Purchasing and AP-AR accounting modules.

  • Length (field LNG)

This field displays the maximum permitted length of this sequence number counter.

  • Reset to zero (field ZERO)

Select this check box to set the sequence number start value to zero. The first generated sequence number will start at 1.

This field displays the legislation code for the country, for example FRAfor French legislation.

This code is attached to a company and assigns predetermined rules and parameters necessary to fulfill country-specific legal requirements. It can include calculation rules, legal reports, legal declarations, tax management, and so on.

Legislations are defined in Miscellaneous table 909. General parameters can also be defined at the legislation level.

Close

 

Component type

Explanation

Constant

Fixed character string. The value must be entered in the Formula column. Do not use single or double quotes around the value.

Year

Length = 1 represents the last number of the year (0 - 9).
Length = 2 represents the last two numbers of the year (00 - 99).
Length = 4 represents the full year.

Month

Length = 2 represents the month as a number (00 - 12).
Length = 3 represents the first three characters of the name of the month in English (JAN, FEB, MAR etc.).

Week

Length = 2 represents the week number (00 to 53).

Day

Length = 1 represents the day in the week as a number (1 - 7).
Length = 2 represents the number of the day in the month (01 - 31).
Length = 3 represents the number of the day in the year (001 - 366).

Company

Company code to which the transaction is assigned (in one to five characters).

Site

Site code to which the transaction is assigned (three characters).

Sequence number

Incremental part of the sequence number structure. This value increments by 1. The initial value is 1.

Complement

Additional component. The value depends on the module that is using the sequence number component.

Fiscal year

The fiscal year number is defined using one to three digits (for the first open fiscal year the value is equal to 1). The value of this component is evident where there are offset fiscal years. When this situation occurs there is a break in the number when the year changes. This can occur in the middle of a fiscal year.

Period

The period number is represented by one to three digits (starting with 1, up to the maximum number of periods in a fiscal year).

Formula

Used to insert a formula into the sequence number structure. This is essentially an independent series of characters inserted into the generated sequence number. The formula can be alphanumeric, a number or a date, and up to a maximum of 20 characters. Note that alphanumeric characters are converted to uppercase and then formatted to the exact number of planned characters.

Important information

Additional field

The additional field code is used to define a sequence number segment depending on the context, without having to define two sequence number counters. It is important to understand that in this situation there is a chronological sequence for each different value stored by the additional field code.

Using the additional field code depends on the context used for each function.

For the Supervisor functions the additional field code can be used for the sequence number counter of the lot numbers in the import-export temporary storage space. It contains the code of the import-export template being used.

A list of the additional field codes used in the business modules is defined in the attached documentation.

In all other cases, the additional field number is not assigned. You can however use a dedicated entry point to give a specific value to the additional field number in a given context.

You can integrate the additional field code in a numbering sequence without using a different sequence by counter value. In order to achieve this you must include the Formula component type with the formula [L]ADDITIONAL FIELD (ADDITIONAL FIELD) as the local variable known to the number sequence subprogram that stores the current value of the additional field.

Sequence types

The Sequence type can be important for customer installations with a large number of workstations that create a large number of a given type of document. According to the sequence type that is used there can be transactional conflicts linked to obtaining numbers from the sequence number counters.

Normal counter: Use

The allocation of the number, usually when creating a document (order, posting, invoice, etc.), is carried out in the creation transaction itself. This means that the number will not be lost in the event a transaction is cancelled by a rollback. As long as the creation transaction (which can last several seconds) is not completed all concurrent creation transactions will fail for the same type of document as they cannot obtain a number. A rollback of the concurrent transaction will be carried out followed by a new attempt (that starts if the first transaction is completed).

The number of successive attempts carried out as a result of this type of lock before cancellation of the transaction on error can be set up using the ROLLBACK definition from the SUP chapter. Should a conflict occur the value of this definition can be increased. You must be aware, however, that consumption of data server resources can increase to the detriment of performance. You can adjust the sequence type to improve this.

Conversely, the normal sequence number counter guarantees the respect of sequential order in time: Two successive calls in time to a given sequence number counter will provide incremental numbers, all conditions linked to the structure of the sequence number counter (company, site, period, supplement) being equal. In addition, no number loss relative to the lock can occur. This type of sequence number counter is therefore recommended for legal documents for which strict sequences with no number sequence "gaps" are demanded.

Grouped counter: Use

The numbers are allocated using a group of N numbers (where N is a definition). Contention is therefore less important because only an assignment to N can cause a contention with the other assignments using an available number.

Conversely, the sequential assignment of numbers is not guaranteed, and a loss of numbers is possible for the sequence number counter depending on the month or the period. For example, where N is equal to 10, the number 1 to 8 is already assigned and 3 creation transactions are in process. The first will be assigned to the number 9, the second to number 10, the third cannot find an available number in the first group of 10 numbers. The range 11 to 20 will then be created which will lead to the first available number being assigned as 11. If in the meantime the first transaction fails for other reasons, the number 9 will become available for a new transaction. If no further transaction is started the situation arises where all the numbers between 1 and 11, excluding 9 are used, and where the next numbers to be assigned will be (in order) 9, then 12 etc. Therefore there is not a strict adherence to the number sequence. If no other document creation takes place during a day, and if a document is created the next day, there will be a document dated for day D numbered 11 and a document dated for D+1 numbered 9. Finally, if the sequence number counters contain the number of the month and this situation occurs at the end of the month, there will be a gap in the number sequence (but it is possible to trace this as the number is found in the list of numbers to be assigned).

Database sequence counter: Use

The number assignment is made outside of the transaction, that is, there is no contention, but no backward return is possible (if the number is not used it is permanently lost). This type of sequence number counter relies on the database sequence. Safe X3 creates, for each table in the database, a sequence that is normally associated with it to obtain a technical number. It is important to note that this numbering is never reset to 0 (therefore you must plan for a large number of digits associated with the numbering sequence in the serial number sequence). It is also strictly sequential (the order of assigned numbers always increases), however it is possible to have gaps in the sequence without either justifying or recovering them. This characteristic is used from the moment there is a need for a unique technical number, for which no justification for gaps in the sequence is necessary.

Sequence type: Summary

The advantages and drawbacks of the different types of sequence number counters are summarized in the following table:

Type of sequence number counter

Increasing sequence

Number loss

Multi-user conflicts

Normal

Always

Never

Strong

Grouped

Not always

At the end of the period, but justifiable (list of lost numbers)

Average (more reliable when N is large)

Database sequence

Always

Yes, without justification

Nil

Actions spécifiques

Click the Copyaction to copy this sequence code and structure to a different folder.

Error messages

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

2 sequence numbers

An attempt has been made to define a sequence number series with two components of the type Sequence number (a single sequence number is authorized by the sequence number series).

Incorrect value

The length requested is not compatible with the definition (for example, a year with 8 digits or a month with 5 characters).

Length too great

The total length of the sequence number series exceeds 20 characters, or the sum of the lengths of the components is different to the total permitted length.

Incorrect expression / Illegal character

The calculation formula that has been entered has an incorrect syntax.

Table type: system:

A counter based on a sequence relies on a table existing in the current folder. This is not the case for this type of table.

Sequence type possible at folder level
Sequence type authorized without RTZ

A counter based on a database sequence can only allow one numbering sequence (therefore at folder level) and cannot be reset to zero.

Tables used

SEEREFERTTO Refer to documentation Implementation