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.
The following prerequisites must be met in order to use the ERP Number Generator:
Activate the key
erp_export_ts
undererpcustom.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.
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
.
Make sure your PARTsolutions version contains the "Sequencer" table "CNSSEQ". If needed, use the following corresponding command lines.
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;
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;
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
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
.
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.
Choose a part which does not yet have a number.
Click the Add record to link database [Add dataset to link database] button.
-> 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.
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
.
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.
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.
The associated catalog, directory or project path is defined for each generator in the EPR_NRGENERATOR_CONDITIONS block.
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
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.
Shows maximum limit for the number generation
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".
Name in order to differentiate between counters in the database table
The following table shows how to configure the conditions.
The separator between the individual values is the colon.
Requirements depending on roles
You can also define requirements based on user-role dependencies.
[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”.