All tables
tables · table

pmchdr2

The pmchdr2 table serves as the Production Issue Header for 2nd Operations. It records the issuance of semi-finished items to specific machines (mccode) for subsequent manufacturing processes (oprcode). In the production workflow, this table tracks quantities (pcs), specific batches (lotno, heatno), and operational parameters before they are recorded as finished production in the product1 table.

Row count
792,883
Last entry
2026-01-15
Source
tables

Columns

21
ColumnTypeNullableMeaning
indexintegerNoPrimary Key
compcodestringNoCompany Code
issuenointegerNoIssue Number
prdatedatetimeNoProduction/Process Date
mccodestringNoMachine Code
itemcodestringNoPart/Item Identifier
lotnostringYesBatch/Lot Number
pcsnumberYesQuantity in Pieces
weightnumberYesQuantity by Weight
remarksstringYesInternal Notes
itemcode1stringYesRequired/Parent Item Code
oprcodestringNoOperation Code
usernamestringYesEntry User
printflagstringYesPrinted Status
sublotnostringYesSub-Batch Identifier
heatnostringYesRaw Material Heat Number
variantstringYesProduct Variant
uomstringYesUnit of Measure
cwnumberYesConversion Weight
locationstringYesPhysical Location Code
TrfFromProdNostringYesTransfer Source

Full documentation

### 1) Overview
 The `pmchdr2` table serves as the **Production Issue Header for 2nd Operations**. It records the issuance of semi-finished items to specific machines (`mccode`) for subsequent manufacturing processes (`oprcode`). In the production workflow, this table tracks quantities (`pcs`), specific batches (`lotno`, `heatno`), and operational parameters before they are recorded as finished production in the `product1` table.
 
 It is frequently used in conjunction with `mchdr` (which typically handles 1st/Initial operations) to provide a complete view of the manufacturing history and work-in-progress (WIP) status of an item across multiple stages.
 
 ### 2) Column Dictionary
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary Key | | Internal identifier. |
 | **compcode** | string | No | Company Code | e.g., "DAS", "BPL" | Filter for multi-tenant data. |
 | **issueno** | integer | No | Issue Number | | Unique ID for the issue document; links to production logs. |
 | **prdate** | datetime | No | Production/Process Date | | Used for chronological reporting and month-end audits. |
 | **mccode** | string | No | Machine Code | e.g., "TRB1", "CNC50" | Joins to `dbo.machine` to identify physical equipment. |
 | **itemcode** | string | No | Part/Item Identifier | e.g., "CP-058" | Primary link to `dbo.itemmas`. |
 | **lotno** | string | Yes | Batch/Lot Number | | Tracks material traceability. |
 | **pcs** | number | Yes | Quantity in Pieces | | The total count issued for the operation. |
 | **weight** | number | Yes | Quantity by Weight | | Secondary unit of measure tracking. |
 | **remarks** | string | Yes | Internal Notes | | Audit or process exceptions. |
 | **itemcode1** | string | Yes | Required/Parent Item Code | | Often used in views to show the "Item Required" vs "Item Produced". |
 | **oprcode** | string | No | Operation Code | e.g., "CNC1", "MS" | Joins to `dbo.oprmas` to identify the manufacturing step. |
 | **username** | string | Yes | Entry User | | Audit tracking. |
 | **printflag** | string | Yes | Printed Status | | Tracking document generation. |
 | **sublotno** | string | Yes | Sub-Batch Identifier | | Detailed traceability. |
 | **heatno** | string | Yes | Raw Material Heat Number | | Link to metallurgical properties. |
 | **variant** | string | Yes | Product Variant | | Differentiation within a part number. |
 | **uom** | string | Yes | Unit of Measure | "PCS", "KGS" | Defines how `pcs` and `weight` are interpreted. |
 | **cw** | number | Yes | Conversion Weight | | Used to calculate piece counts when weight is provided (PCS = Wt * 1000 / CW). |
 | **location** | string | Yes | Physical Location Code | | Joins to `dbo.PhyLocation`. |
 | **TrfFromProdNo**| string | Yes | Transfer Source | | Tracks material movement from a prior production run. |
 
 ### 3) Relationships & Join Map
 
 #### Primary Links (Header to Detail/Production)
 * **dbo.product1**: Joins on `issueno` and `compcode`. This is the most critical relationship, linking the "Issue" of material to the "Resulting Production" (Accepted, Rejected, and Scrap quantities).
 * **dbo.pmcdtl2**: Joins on `issueno` and `compcode`. Provides specific attributes (grade, hardness) for the issue header.
 
 #### Master Data Joins
 * **dbo.itemmas**: Joins on `itemcode` (or `itemcode1`) to retrieve descriptions, part numbers, and weights.
 * **dbo.machine**: Joins on `mccode` and `compcode` to identify the specific machine or work center where the issue was allocated.
 * **dbo.oprmas**: Joins on `oprcode` and `compcode` to retrieve operation descriptions (e.g., "Milling", "CNC Turning").
 * **dbo.itemopr**: Joins on `itemcode` AND `oprcode` to retrieve the standard operation routing and piece weights (`oprweight`).
 
 #### Likely Inventory/WIP Joins
 * **dbo.job**: Joined in outward views (e.g., `viewlotnooutward`) to compare in-house production issues against job-work issues sent to vendors.
 * **dbo.onlinerej_dtl**: Linked via `itemcode` and `oprcode` in balancing procedures to calculate remaining WIP by subtracting scrapped or rejected units from the issued amount.