You are here: Development Standards > Routines > Application-SpecificRoutines > INUPD.PUB

# INUPD.PUB

INUPD.PUB is a public program that updates Inventory files for a transaction. INUPD.PUB should be called only through the INUPD routine.

`0058 ENTER FILE[ALL],INUPD1$,INUPD2$,INUPD3$,INCJ$,INLD$,INHI$,INHS$,INLH$,INLP$,`
`0058:INLT$,INPP$,INPS$,INQL$,INQT$,INSH$,INSN$,INUM$,INUP$,INVE$,OSSE$,O2$,MSG$`

Variable | Description
FILE[ALL] | Standard file array used for the data file channel number
INUPD1$ | INUPD current-values template (see table below)
INUPD2$ | INUPD old-values template (see table below)
INUPD3$ | File array template for INUPD.PUB (see table below)
INCJ$ | INCJxxx file template (GL Adjustments file)
INLD$ | INLDxxx file template (Location Detail file)
INHI$ | INHIxxx file template (Detail History file)
INHS$ | INHSxxx file template (Summary History file)
INLH$ | INLHxxx file template (Lot History file)
INLP$ | INLPxxx file template (Location Pricing file)
INLT$ | INLTxxx file template (Lot Numbers file)
INPP$ | INPPxxx file template (Promotional Pricing file)
INPS$ | INPSxxx file template (Price Structure file)
INQL$ | INQLxxx file template (Quantity Locations file)
INQT$ | INQTxxx file template (Quantity Totals file)
INSH$ | INSHxxx file template (Serial History file)
INSN$ | INSNxxx file template (Serial Numbers file)
INUM$ | INUMxxx file template (Units of Measure file)
INUP$ | INUPxxx file template (Unit Pricing file)
INVE$ | INVExxx file template (Items file)
OSSE$ | OSSE file template (Sequence Numbers file)
O2$ | Inventory options string
MSG$ | Returns a message string if an error occurs

Exit Points | Explanation
EXIT | INUPD.PUB normally exits without an error.
EXIT ERR | An error is returned when an error occurs.

The INUPDSET.PUB program DIMensions and assigns some of the variables in the INUPD1$, INUPD2$ and INUPD3$ strings.

INUPD1$ and INUPD2$ String Template Definition

The INUPD1$ and INUPD2$ string templates are identical. The values contained in the string represent the new and previous values (if any) for the transaction. The template contains the fields defined in the following table:

Field | Type | Len | Description
TASK$ | C | 2 | Update task: P1 - PO new order P2 - PO receive goods P3 - PO return goods P4 - AP invoice P5 - AP debit memo S1 - SO new order S2 - SO shipped order S3 - SO verify order S4 - AR invoice S5 - AR credit memo S6 - AR/SO post invoice S7 - AR/SO post credit memo S8 - AR/SO post misc. credit from Returned Items S9 - SO verify order, 'Yes' to ship-all T1 - AP material requisition T2 - AP return material requisition T3 - Inventory transfer from T4 - Inventory transfer to B1 - Build from B2 - Build to B3 - Unbuild from B4 - Unbuild to A1 - Quantity adjustment increase A2 - Quantity adjustment decrease UC - Unit conversion QT - Get INQTxxx record CT - Get INLDxxx cost (locks record) CS - Get cost of sale PR - Get price of sale TC - Get cost of transfer WT - Calculate weight of item
ITEM | C | 20 | Item ID
LOCA | C | 6 | Location ID
LOTN | C | 16 | Lot number
SERN | C | 35 | Serial number
GLCD | C | 2 | GL account code
CMNT | C | 35 | Comment (serial numbers)
PRID | C | 6 | Price ID
CLVL | C | 6 | Customer level
CUST | C | 6 | Customer ID
UNIT | C | 5 | Unit of measure
SREP | C | 3 | Sales rep
PENT | N | 1 | Penalty type
ODAT | N | 7 | Order date
IVDAT | N | 7 | Invoice date
RDAT | N | 7 | Receipt date
TPER | N | 2 | Transaction period
TYR | N | 4 | Transaction year
PROM | C | 6 | Promotion used in price calculation
HISTFL | N | 1 | Update history flag (set to 1 for update or 0 for no update)
INHISQ | C | 6 | INHIxxx sequence number
INLHSQ | C | 6 | INLHxxx sequence number
INSHSQ | C | 6 | INSHxxx sequence number
APP | C | 2 | Application ID
BATCH | C | 6 | Batch ID
TRAN | C | 8 | Transaction ID
LINE | C | 3 | Line number
SRCE | C | 6 | Source ID
SREF | C | 8 | Reference ID
JOB | C | 6 | Job ID
PHASE | C | 6 | Phase ID
CCODE | C | 3 | Cost code
ITYP | C | 1 | Item type
LOTS | N | 1 | 1 if item is lotted or 0 if not lotted
KITS | N | 1 | 1 if item is a kit or 0 if not a kit
DEL | N | 1 | 1 if deleting a line or 0 if not
UCST | B | 8 | Unit cost, in base unit of measure
ECST | B | 8 | Extended cost
TCOST | B | 8 | Transfer cost
SUCST | B | 8 | Selling unit cost (returned)
SECST | B | 8 | Selling extended cost (returned)
CONV | B | 8 | Conversion factor
PENA | B | 8 | Penalty amount
OQTY1 | B | 8 | Original quantity (in selling or purchasing units)
OQTY2 | B | 8 | Shipped/received quantity (in selling or purchasing units)
OQTY3 | B | 8 | Backordered quantity (in selling or purchasing units)
BQTY1 | B | 8 | Original quantity (in base units)
BQTY2 | B | 8 | Shipped/received quantity (in base units)
BQTY3 | B | 8 | Backordered quantity (in base units)
QTQTY1 | B | 8 | On-hand quantity from INQTxxx
QTQTY2 | B | 8 | Committed quantity from INQTxxx
QTQTY3 | B | 8 | In-use quantity from INQTxxx
QTQTY4 | B | 8 | On-order quantity from INQTxxx
QTQTY5 | B | 8 | Available quantity (on-hand - in-use - committed)
PRC1 | B | 8 | Unit price
PRC2 | B | 8 | Extended price
PRC3 | B | 8 | Calculated price before promo
PRC4 | B | 8 | Minimum price
CST1 | B | 8 | Standard cost from INLDxxx
CST2 | B | 8 | Average cost from INLDxxx
CST3 | B | 8 | Base cost from INLDxxx
CST4 | B | 8 | Last cost from INLDxxx
VAL1 | B | 8 | Total cost of item from INQTxxx
VCOST | B | 8 | Unused
KIT2 | N | 1 | Component of a kit. Flagged so average price on a component is not recalculated, because pricing is done on the kit level.
OJOB | C | 1 | Flags if item belongs with a PO with a job ID

INUPD3$ String Template Definition

The INUPD3$ string template is defined below. The values in the string represent information about the FILE[ ] array elements for various Inventory data files.

Field | Type | Len | Description
FLCJ | N | 2 | File[x] value for INCJxxx file (GL Adjustments file)
FLLD | N | 2 | File[x] value for INLDxxx file (Location Detail file)
FLHI | N | 2 | File[x] value for INHIxxx file (Detail History file)
FLHS | N | 2 | File[x] value for INHSxxx file (Summary History file)
FLLH | N | 2 | File[x] value for INLHxxx file (Lot History file)
FLLP | N | 2 | File[x] value for INLPxxx file (Location Pricing file)
FLLS | N | 2 | File[x] value for INLSxxx file (Lot/Serial Transactions file)
FLLT | N | 2 | File[x] value for INLTxxx file (Lot Numbers file)
FLPP | N | 2 | File[x] value for INPPxxx file (Promotional Pricing file)
FLPS | N | 2 | File[x] value for INPSxxx file (Price Structures file)
FLQL | N | 2 | File[x] value for INQLxxx file (Quantity Detail file)
FLQT1 | N | 2 | File[x] value for INQTxxx file (Quantity Totals file).
FLSH | N | 2 | File[x] value for INSHxxx file (Serial History file)
FLSN | N | 2 | File[x] value for INSNxxx file (Serial Numbers file)
FLUM | N | 2 | File[x] value for INUMxxx file (Unit of Measure file)
FLUP | N | 2 | File[x] value for INUPxxx file (Unit Pricing file)
FLVE | N | 2 | File[x] value for INVExxx file (Items file)
FLVI | N | 2 | File[x] value for INVIxxx file (Vendor Information file)