Articles

Coding Rules


1. The Cornerstone of Enterprise Data Management

In the process of introducing an ERP system, many people focus on functional modules or reports, but ignore the most basic and critical task—Coding Rules. A code is like the ID number of enterprise data. If the rules are not set well, future queries, statistics, and even system integration will face great difficulties. A good coding rule must be "unique," "extensible," "readable," and "consistent." Below are practical suggestions for the two most commonly used types of codes: customers/suppliers, and goods/raw materials/semi-finished products.

2. Coding Rules for Customer and Supplier Numbers

Customers and suppliers are external partners. It is recommended to use "serial numbers" or "classified serial numbers." To ensure system stability and report consistency, it is recommended that the code length not exceed 10 characters.

  • Simple serial number (e.g., C00001, S00001): The prefix C stands for Customer, S for Supplier, followed by a fixed number of digits. It is short, fast to input, and will not lose meaning due to company name changes.
  • Classified serial number (e.g., C-HK-0001): If there are many customers or suppliers, a classification code can be added (e.g., C-HK for Hong Kong customers). However, too many classification codes will increase input burden and error rates.
  • Practical advice: Never use Chinese names or phone numbers as codes. Once a code is generated, it should be regarded as a permanent identifier.

3. Coding Rules for Goods, Raw Materials, and Semi-Finished Products

Goods coding is the most complex part of the ERP system. To be compatible with international barcode standards, it is recommended that the code length not exceed 26 characters. In practice, the coding of goods, semi-finished products, and materials usually incorporates three key attributes: "size," "color," and "main material" to allow "knowing the item by its code."

  • Meaningful coding (Smart coding): Directly encode attributes into the number. Example: FG-PL-100-R represents "Finished Good, Plastic, 100cm, Red" (11 characters). The disadvantage is poor extensibility.
  • Meaningless coding (Serial number): This is the most recommended method by ERP consultants. The number itself carries no meaning; detailed attributes are stored in the "Item Master" file. Example: P000001 for finished goods, M000001 for raw materials. The advantage is strong extensibility.
  • Practical advice: Use "category prefix + serial number" (e.g., P for Product, M for Material, S for Semi-finished). Make good use of the "Item Master" to store specifications, sizes, materials, and supplier item numbers. Reserve space for barcodes (Barcode / QR Code) during coding.

💡 Experience Sharing: Bad Coding Leads to Endless Troubles

In practice, we often see enterprises making serious mistakes in product coding for convenience. Some companies stuff all attributes like size, color, and supplier into the item number, resulting in a 20-30 character code. Frontline staff cannot remember such long numbers, and reports often truncate the key information at the end. On the contrary, if all products only use serial numbers, sales and warehouse staff cannot distinguish what the item is when looking at reports, and can only rely on names or descriptions.

In fact, identical products from different suppliers only need one shared item number. The correct approach is to establish a "Supplier Item Number Mapping Table" to link supplier part numbers with internal item numbers, avoiding infinite expansion of codes.

Another issue is the uniform use of serial numbers for documents. If invoices, receipts, and payment vouchers all share the same 0001, 0002 serial numbers, not only is it impossible to tell what type of document it is, but when these documents are posted to the general ledger, duplicate numbers will cause data to overwrite each other, leading to chaotic financial accounts. Enterprises must set specific prefixes for different document types.

Articles

About the Author (Andy Tam): Senior Consultant at Key Champion Computer Limited. Over 40 years of experience in ERP development and IT infrastructure planning.

Copyright © 1991 - 2026 Key Champion Computer Limited. All Rights Reserved. | Sitemap | Privacy Policy