Occasionally, it may be necessary to convert item codes for use in IFP. This may relate to converting codes when importing, copying data files, exporting or running reports. For example, the code for a cost centre or a product may change.
Creating the Code Conversion Table
Before creating a set of rules you will first need to create the Item Code Conversion Table. To do this, proceed as follows:
- From IFP Home, select Codes Maintenance > Code Conversion Tables
- Select the folder you wish to create the conversion table in and click Add from the toolbar
- Enter the source code length (this must be at least the length of the item codes you wish to convert. This can be longer and can also be different to the Target Code length)
- Enter the source variable name, this is for reference only
- Enter the target code length (must equal the length of the item code in the database)
- Enter the target variable name, this is for reference only.
- You can then enter the rules by selecting the Rules tab
Creating / Maintaining Rules
(To edit rules in an existing table, from IFP Home select Codes Maintenance > Code Conversion Tables, select the folder and conversion table you wish to update and click Properties.)
- Select the Rules tab
- Rules should be maintained as follows:
- Source Code - This is the code which currently exists in IFP
- Target Code - The is the new code you wish to convert the data to
- Factor - This is the factor the values will be multiplied by when converting the item code. E.g. for simply converting one code to another (old to new, say), Factor can be ignored.
- Description - The description of the item code being converted
Note - If the Target Code set in the table does not currently exist in IFP and the table is used when importing or copying data, this will show an error message when running the task. This Item Code should then be added manually or with the use of an Exceptions template (if available) before running the process again.
Rule Application Logic
It is important to take account of the logic used by IFP when using conversion tables.
- A rule is only applied for an item code if the source code matches the item code being used
- Rules are applied in strict sequence starting from the first rule to the last
- Once a matching rule is found, the same source code will only be considered if the next consecutive rule also uses the same Source (e.g if being used for allocation rules). If there is a gap between rules then only the first rule will be used.
- Hence, it is essential that individual rules appear before any general rules or those which convert everything else.
Using the Item Code Conversion Table
Item Code conversion tables can be used during importing, copying (using the advanced options tab) and exporting (by selecting the relevant table in the wizard) data files.
Should you wish to apply the conversion table when running a report this can be done by selecting Advanced Options on the Custom File Selection screen and selecting the relevant conversion table.