tables · table
onlinerej_dtl
The onlinerej_dtl table serves as a transactional detail record for "Online Rejections" within the production environment. It tracks specific instances where items are identified as scrap during various manufacturing operations. Each record captures the quantity scrapped, the specific item involved, the operation code where the rejection occurred, and the underlying reason. This table is critical for calculating WIP (Work-In-Progress) stock accuracy, Cost of Poor Quality (COPQ), and inventory balances.
Row count
12,461
Last entry
2026-01-16
Source
tables
Columns
12| Column | Type | Nullable | Meaning |
|---|---|---|---|
index | integer | NO | Primary Key |
compcode | string | YES | Company Identifier |
onlinerej_no | integer | YES | Rejection Header ID |
onlinerej_date | datetime | YES | Transaction Date |
scrap_qty | number | YES | Scrapped Quantity |
itemcode | string | YES | Item Identifier |
reason | string | YES | Descriptive Reason |
rettosupplier | string | YES | Return to Supplier Flag |
rejcode | integer | YES | Rejection Type Code |
oprcode | string | YES | Operation Code |
curoprcode | string | YES | Current Operation Code |
ProdQty | string | YES | Production Batch Qty |
Full documentation
### 1. Overview The `onlinerej_dtl` table serves as a transactional detail record for "Online Rejections" within the production environment. It tracks specific instances where items are identified as scrap during various manufacturing operations. Each record captures the quantity scrapped, the specific item involved, the operation code where the rejection occurred, and the underlying reason. This table is critical for calculating WIP (Work-In-Progress) stock accuracy, Cost of Poor Quality (COPQ), and inventory balances. ### 2. Column Dictionary | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage | | :--- | :--- | :--- | :--- | :--- | :--- | | **index** | integer | NO | Primary Key | Auto-incrementing | Internal unique identifier. | | **compcode** | string | YES | Company Identifier | e.g., "DAS", "BAM" | Primary filtering column for multi-tenant data. | | **onlinerej_no** | integer | YES | Rejection Header ID | | Foreign key to `onlinerej_hdr`. | | **onlinerej_date** | datetime | YES | Transaction Date | | Used for chronological reporting and month-end closing. | | **scrap_qty** | number | YES | Scrapped Quantity | | The metric for loss; subtracted from WIP or FG balances. | | **itemcode** | string | YES | Item Identifier | | Joins with `itemmas` or `saleitemmas`. | | **reason** | string | YES | Descriptive Reason | e.g., "OVER SIZE" | Textual explanation for the rejection. | | **rettosupplier** | string | YES | Return to Supplier Flag | "Y", NULL | Indicates if scrap is being debited to a vendor. | | **rejcode** | integer | YES | Rejection Type Code | | Joins with `rejectionmas`. | | **oprcode** | string | YES | Operation Code | e.g., "STRAIGHT" | Identifies the production stage of rejection. | | **curoprcode** | string | YES | Current Operation Code | e.g., "ODF" | Joins with `oprmas` for operation names. | | **ProdQty** | string | YES | Production Batch Qty | Likely | Contextual quantity of the larger production run. | ### 3. Relationships & Join Map #### Parent Table * **onlinerej_hdr**: Joins on `onlinerej_no` and `compcode`. The header determines the `rejflag` (e.g., 'R' for Rejection, 'S' for Scrap) which dictates how `scrap_qty` affects stock logic. #### Reference Tables * **itemmas**: Joins on `itemcode` and `compcode`. Used to retrieve `itemname`, `partno`, and `finishwt` for weight-based reporting. * **oprmas**: Joins on `oprcode` or `curoprcode` and `compcode`. Used to fetch the descriptive operation name (e.g., "Milling", "TPH"). * **rejectionmas**: Joins on `rejcode` and `compcode`. Provides specific rejection reason categories. * **itemopr**: Joins on `itemcode` and `oprcode`. Used to retrieve `oprweight` for calculating the total weight of scrap. #### Downstream Usage (Likely) * **Inventory Reports**: Subtracted from `goodsbal` or `fgtowip` quantities in stored procedures like `FGStock` and `TotalItemStock`. * **COPQ Analysis**: Combined with `podtl` rates to calculate the financial impact of scrap in procedures like `Online_Rejection_DrNote_Report`.