4.12.1.2.4.1.  ERP Number Generator - erpcustom.cfg -> Blocks [ERP_NRGENERATOR] and [ERP_NRGENERATOR_CONDITIONS]

The ERP Number Generator gives you the opportunity to set ERP numbers after a freely configurable key (prefix - number - postfix) - also possible for different catalogs, directories or projects.

4.12.1.2.4.1.1. Prerequisites

The following prerequisites must be met in order to use the ERP Number Generator:

  • Activate the key erp_export_ts under erpcustom.cfg -> Block [LOAD].

    [LOAD]
    ;Generate ERP on Export
    erp_export_ts=$CADENAS_SETUP/scripts/erp/erp_export_ts.vbb

  • The CNSSEQ table must be created in the LinkDB.

    PARTlinkManager -> Menu "Extras [Extras] " -> Database -> Edit additional tables -> CNSSEQ

    PARTlinkManager -> Menu "Extras [Extras] " -> Database -> Edit additional tables -> CNSSEQ

    If the table does not exist, you can use the corresponding command lines in the following section to add the table.

  • The ERP number generator must be activated in the configuration file erpcustom.cfg.

4.12.1.2.4.1.1.1. SQL commands for applying the "Sequencer" table in the LinkDB

Make sure your PARTsolutions version contains the "Sequencer" table "CNSSEQ". If needed, use the following corresponding command lines.

  • MSSQL

    CREATE TABLE CNSSEQ (
      TOPIC VARCHAR(50) NOT NULL,
      PREFIX VARCHAR(50) NOT NULL,
      COUNTER INTEGER NOT NULL,
    PRIMARY KEY(TOPIC,PREFIX,COUNTER)
    );
    grant all on dbo.CNSSEQ to public;

  • MySQL

    CREATE TABLE CNSSEQ (
      TOPIC VARCHAR(50) NOT NULL,
      PREFIX VARCHAR(50) NOT NULL,
      COUNTER INTEGER NOT NULL,
    PRIMARY KEY(TOPIC,PREFIX,COUNTER)
    );
    grant all on dbo.CNSSEQ to public;

  • Oracle

    CREATE TABLE CNSSEQ (
      TOPIC VARCHAR(50) NOT NULL,
      PREFIX VARCHAR(50) NOT NULL,
      COUNTER INTEGER NOT NULL,
      PRIMARY KEY(TOPIC,PREFIX,COUNTER)
    );
    CREATE PUBLIC SYNONYM CNSSEQ FOR SYSTEM.CNSSEQ;
    GRANT ALL ON CNSSEQ

4.12.1.2.4.1.1.1.1.  CNSSEQ Table

In the LinkDB, the respectively next counter for the generation is saved in the "CNSSEQ" table.

PARTlinkManager -> Menu "Extras [Extras] " -> Database -> Edit additional tables -> CNSSEQ

PARTlinkManager -> Menu "Extras [Extras] " -> Database -> Edit additional tables -> CNSSEQ

If needed, as many counter names (GEN1, GEN2,...) as possible may be used in order to differentiate between the counters in the LinkDB.

4.12.1.2.4.1.1.2. Activating ERP Number Generator

Before you can use the ERP number generator, you must make the necessary settings in PARTadmin.

Open in PARTadmin in the dialog area Category under CADENAS_SETUP the configuration file erpcustom.cfg.

Set the settings as follows:

  • TIMESTAMPNR=0

  • ERPNR_ENABLED=0 (Activate the key - if needed - per right-click on the key name)

  • erp_nrgenerator (Activate the key per right-click on the key name)

Save changes.

The two keys ERP_NRGENERATOR and ERP_NRGENERATOR_CONDITIONS are now used.

With both these keys you define the pattern after which the ERP numbers are to be generated.

4.12.1.2.4.1.2.  Assign/display ERP number in PARTdataManager
  1. Choose a part which does not yet have a number.

  2. Click the Add record to link database [Add dataset to link database] button.

  3. Fill out the input fields.

    [Note]Note

    The ERP no. [ERPNo] input field is deactivated as the ERP number is generated automatically.

  4. Click Ok.

    -> The number is inserted in the link database (productive environment in LinkDB, Training in PLDBDEMO) according to the specified key and displayed in the characteristic attribute table.

4.12.1.2.4.1.3.  Further number generations based on the example of the default setting

The numbers are set consecutively, regardless of the setting for special catalogs or directories.

Prefix and postfix are set specifically according to the setting in PARTadmin in the configuration file erpcustom.cfg.

Standard part: Number 00001, 00002, 00005

Standard part: Number 00001, 00002, 00005

Manufacturer catalog part: 00003, 00004

Manufacturer catalog part: 00003, 00004

The parts with counters 00001 and 00002 were set consecutively in the standard parts catalog.

Afterwards, the counters 00003 and 00004 were set in the supplier catalog.

Then the counter 00005 is again inserted into the standard parts catalog.

4.12.1.2.4.1.4.  Adjust conditions for number generation

The following figure shows the default setting.

The generator names with the special generation pattern are defined in the ERP_NRGENERATOR block. Any number of variants can be created.

  • GENERATOR_1

  • GENERATOR_2

  • etc.

The associated catalog, directory or project path is defined for each generator in the EPR_NRGENERATOR_CONDITIONS block.

ERP_NRGENERATOR

The following table shows the syntax for the entry of the generating pattern and explains the meaning of the individual values.

The separator between the individual values is the colon.

Two generation modes (GENERATOR_1 and GENERATOR_2) are defined in the standard environment.

Example value for GENERATOR_1: STD:0:0:5:-std:GEN1

Example value for GENERATOR_2: CAT:0:100:5:-cat:GEN1

Key name Prefix Minimum Maximum Number of jobs Postfix Counter name

GENERATOR_1

STD005-stdGEN1

GENERATOR_2

CAT01005-catGEN1

  • Key name

    The name can be freely chosen.

    Please note that when specifying the path in the ERP_NRGENERATOR_CONDITIONS key, exactly this value is referenced to.

  • Prefix

    Any text specification

  • Minimum

    Numerical value

    Shows the starting value

    Per default the starting value is set to 00000.

  • Maximum

    Numerical value

    Shows maximum limit for the number generation

    0 means that there is no limit.

    100 means that counting ends at 100.

  • Number of jobs

    Numerical value

    For an example value of '5', the '0' is shown as '00000'; the number '101', for example, as '00101'.

    The following figure shows an example of a counter as seen for "Minimum", "Maximum" and "Counter name".

  • Postfix

    Any text specification

  • Counter name

    Name in order to differentiate between counters in the database table

    Any entry

    Usually this entry is left alone

ERP_NRGENERATOR_CONDITIONS

The following table shows how to configure the conditions.

The separator between the individual values is the colon.

Condition number Neutral connoisseur Path specification Key name from ERP_NRGENERATOR
1PRJnorm/ GENERATOR_1
2PRJ * GENERATOR_2
Number the requirements with consecutive numbers. (1, 2, 3, ...)'PRJ' is a fixed value which is carried on consecutively.

Enter the catalog, directory or project path here.

'/norm' means that these requirements are used for all parts of the standard catalog.

'*' means that these requirements are used for all other parts, for example for all manufacturer catalogs, as well.

Make sure that the key name under ERP_NRGENERATOR is referenced here.

Requirements depending on roles

You can also define requirements based on user-role dependencies.

The syntax is:

[ERP_NRGENERATOR_CONDITIONS(rolename)]

Call up the Add block command via the context menu. Then insert the required keys. You can find detailed information on this under Section 1.6.1.4, “Editing blocks and keys”.