UpdateRoutingQuantityandDate

Update Routing Quantity and Date

Minor Business Rule

Object Name: B3100200

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

Purpose:
This business function will update the WO Routing table (F3112) for a given Work Order Number with 
the new Quantity and Date. This is used to update the Parts List when the Work Order Quantity or 

Requested Dates change. This function will return a code '1'in the errorcode field if not successful and '0' 

if successful.



Edits:
If the Old Order Quantity is equal to New Order Quantity and The Old Start Date is equal to New Start 
Date exit with a return code of '0'.


Retrievals:

a. Initialise all Wk parameters passed to business function (B3100240)
Wk Hours per Day.

Wk Prev Overlap.

Wk Bal Hours.

Wk Prev Hours.

Wk Prev Run Hours.

Wk No of  Operations.

Wk WO Start Date.

Wk WO Req Date = Input New Requested Date.

Wk Oper Start Date.

Wk Oper Req Date.

Wk Begin Date.

Wk Prev Error = '0'.

b. Get total number of operations in the Routing table.

    Wk No Of Operations = 0.

    If Lead Time Level = 'F'

Read all the rows in F3112 table using WLDOCO and WLOPSQ ( =  99999)

   as keys in descending  sequence.

Increment Wk No of Operations if  WLOPSC = Blanks.

    Endif.




c.Process the Routing table (F3112) rows.

   Set the file pointer to the Routing table (F3112) using WLDOCO and WLOPSQ (= 99999) as keys.

   Read all the rows of  the Routing table (F3112) using WLDOCO as the key.

   If row is found and WLOPSC = Blanks

If  New Order Qty <> Old Order Quantity

WLRUNL = WLRUNL * New Order Qty / Old Order Qty.

WLRUNM = WLRUNM * New Order Qty / Old Order Qty.

WLUORG = New Order Qty.

Endif

 If Input Unit of Measure = Blanks

If WLSTRT = 0

WLSTRT = New Start Date

Endif.

If WLDRQJ = 0

WLSTRT = New Requested  Date

Endif.

Else

If WLMCU <> IWMCU

Read Work Centre Master table (F30006) using WLMCU as the key.

Endif

If WLMOVD = 0

WLMOVD = IWMOVD

Endif

If WLQUED = 0

WLQUED = IWQUED

Endif

If Wk Prev Error = '0'

Load Parameters to the Schedule Operation Dates as given below.

Schedule Type= 'B'

Beginning Date=  Wk Begin Date.

Cost Centre=  WLMMCU

Work Centre=  WLMCU

Unit of Measure=  Input Unit Of Measure.

Lead Time Type=  Input Lead Time Type.

Lead Time Level=  Input Lead Time Level.

Prime Load Code=  IWPILC.

No of Employees =  IWQMAD.

No of Machines =  IWNOMA.

Move Hours  =  WLMOVD.

Queue Hours=  WLQUED.

Run Labor Hours=  WLRUNL.

Run Machine Hours=  WLRUNM.

Setup Hours=  WLSETL.

Hours per Day=  Wk Hours per Day.

Operation Overlap=  WLPOVR.

Prev Oper Overlap =   Wk Prev Overlap.

Hours Balance=   Wk Bal Hours.

Hours Previous=   Wk Prev Hours.

Hours Run=   Wk Prev Run Hours.

No of Operations =   Wk No of  Operations.

WO Start Date =   Wk WO Start Date.

WO Req Date=   Wk WO Req Date.

Oper Start Date=   Wk Oper Start Date.

Oper Req Date        =   Wk Oper Req Date.

Error Code=   Blanks.

Call Schedule Operation Dates (B3100240) with the above parameters.

If Error Code <> '0'

Wk Prev Error = '1'

Endif

Endif

If Wk Prev Error = '0' and Error Code = '0'

WLSTRT = Oper Start Date.

WLDRQJ = Oper Req Date.

Wk Beg Date = WO Req Date.

Wk Hours per Day= Hours per Day.

Wk Prev Overlap = Prev Overlap.

Wk Hours Balance= Bal Hours.

Wk Prev Hours= Prev Hours.

Wk Hours Run= Prev Run Hours.

Wk Beg Date= WO Req Date.

Else

If WLSTRT = 0

WLSTRT = New Start Date

Endif.

If WLDRQJ = 0

WLSTRT = New Requested  Date

Endif.

Wk Message Code = '2'

Endif.

Endif.

   Endif.

   If Input Hold Code <> Blanks and WLRORN <> 0 

Read F4301 using Business function (B4300110) 

    using WLRORN,WLRCTO,WLRKCO and '000' as Order Suffix as keys.

If Error 

Input Hold Code = Blanks.

Else

PHHCOD = Input Hold Code

Call Business function (B4300080) with HCRPER, PHAN8, PHTRDJ, PHPDDJ

   HCCYTP and PHSFXO in the Data Structure.

Update F4301 with Hold code. 

Endif.

   Endif.

   Update the row in F3112 with User Id, Program Name, Job Id, Date and Time.

d. Read F4801 using Input Document as key

    If found

If WASPRT = '1' or '2'

WASPRT = ' '

Endif

If WASPRT = ' '

If WASTRT <> WLSTRT and Input MSG1 = '1'

WASPRT = '1'

Endif

If WASPRT = ' ' and Input MSG2 = '1'

WASPRT = Wk Message Code

Endif

Endif

    Endif

Returns:

If the all the rows are successfully updated return with a '0' in the Error Code otherwise return a 
'1'. 

^

Data Structure

D3100200 - Update Routing Quantity and Date

Parameter NameData ItemData TypeReq/OptI/O/Both
mnDocumentNumberDOCOMATH_NUMERICNONENONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

mnOldOrderQuantityUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

mnNewOrderQuantityUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

jdOldStartDateSTRTJDEDATENONENONE

The start date for the order. You can enter this date manually, or have the system calculate it using a backscheduling routine. The routine 
starts with the required date and offsets the total leadtime to calculate the appropriate start date.

jdNewStartDateSTRTJDEDATENONENONE

The start date for the order. You can enter this date manually, or have the system calculate it using a backscheduling routine. The routine 
starts with the required date and offsets the total leadtime to calculate the appropriate start date.

jdOldRequestedDateDRQJJDEDATENONENONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

jdNewRequestedDateDRQJJDEDATENONENONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

cLeadTimeTypeMRPPcharNONENONE

A code that determines whether the system uses fixed or variable leadtimes. This code works in conjunction with the value from either the 
Level Leadtime field or the Leadtime Per Unit field. Valid codes are:    F Fixed leadtime - The system calculates work order start dates using the 
value from the Leadtime Level field.    V Variable leadtime - The system calculates work order start dates using the value from the Leadtime 
Per Unit field.

mnLeadTimeLevelLTLVMATH_NUMERICNONENONE

A value that represents the leadtime for an item at its assigned level in the production process, as defined on Plant Manufacturing Data. 
The system uses this value to calculate the start dates for work orders using fixed leadtimes. Level leadtime is different for purchased and 
manufactured items: Purchased - The number of calendar days required for the item to arrive at your branch/plant after the supplier receives your 
purchase order. Manufactured - The number of workdays required to complete the fabrication or assembly of an item after all the 
components are available. You can enter level leadtime manually on Manufacturing Values Entry, or you can use the Leadtime Rollup program to 
calculate it. To calculate level leadtime using the Leadtime Rollup program, you must first enter a quantity in the Manufacturing Leadtime Quantity 
field in the Item Branch table (F4102).

szHoldCodeHCODcharNONENONE

A user defined code (42/HC) that identifies why an order was placed on hold (for example, credit, budget, or margin standards were 
exceeded).

szUnitofMeasureUMcharNONENONE

A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box, 
cubic meter, liter, hour, and so on.

cErrorCodeERRCcharNONENONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

cMessageType1EV01charNONENONE

An option that specifies the type of processing for an event.

cMessageType2EV02charNONENONE

An option that specifies the type of processing for an event.

szProgramIDPIDcharNONENONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

szLineIdentifierLINEcharOPTNONE

A number that defines a production line or cell. Detailed work center operations can be defined inside the line or cell.

cQueueHrsSchedulingMethodEV01charOPTNONE

An option that specifies the type of processing for an event.

Related Functions

B3100240 Schedule Operation Dates
B4001100 Write Hold Code
B9800100 Get Audit Information

Related Tables

F30006 Work Center Master File
F3112 Work Order Routing
F4301 Purchase Order Header