CalculateLeadTime

Leadtime Calculate

Major Business Rule

Object Name: N3003300

Parent DLL: CMFGBASE

Location: Client/Server

Language: NER

1.Functional Description

1.1Purpose

This function takes the item number, passed in data structure as input, and verifies the stocking type of that item. If the item is Manufactured then it 

calculates "Level Leadtime" and "Leadtime/Unit" for that item and the "Manufacturing Leadtime" and "Cumulative Leadtime" are set to zero. If the item 

is Purchased then the "Manufacturing Leadtime" is set to zero and "Cumulative Leadtime" is set equal to "Level Leadtime".  It then updates the 

values for respective item/branch in F4102 table.


The function uses "Branch/Plant" and "AsOfDate" supplied by user in the input data structure. The AsOfDate is used to validate the effectivity of that 

record. A blank value of AsOfDate defaults to today's date. If the Branch/Plant field is blank then function updates all Branch/Plants that contain the 

item in input data structure. 



1.2Setup Notes and Prerequisites

This function is expected to be used in conjunction with "Leadtime Rollup" (N3003320). See the description for N3003320 for more information.


1.3Special Logic

This NER contains one other member function "Process Routing" which is used to calculate the hours required in manufacturing of a given item. This 

function calculates these hours using the Routing found for that particular item in Routing table F3003. This function is called by "Leadtime 

Calculation" to process appropriate routing for the item/branch. The appropriate routing for an item/branch is selected by the calling function "Leadtime 

Calculation" according to criteria described in a following section.



2.4.1Processing (N3003300 - Leadtime Calculation) 


0. Look for the Branch/Plant value passed from processing options. If the value is a blank or "*", open F4102 and sequentially read all the records 
for given item number. The following processing is done for all the records fetched from F4102. If a Branch/Plant value is found in processing options, 

only the record for that Item/Branch is fetched and processed.

1. Retrieve Stocking type of the item from F4102.

2. If the item is Purchased, copy value of "Leadtime Level" field to "Leadtime Cumulative" field and update these fields in Table F4102. MRP Net 

Change Flag is set.

3. If the item is Manufactured '85

a)Get branch manufacturing constants from table F3009.
'b7If a Branch has "Master Routing" then the function tries to find a cross-reference item in Table F4104.
'b7If a cross-reference item is found, function verifies that the cross-reference item has a routing. 

'b7If the cross-reference item has a routing, than the cross-reference item is selected to get routing information.

'b7Otherwise the original input item is used to get routing information.


b)A routing is searched in Table F3003, for the batch quantity specified for an item in the Bill of Material. 
'b7If a routing is found for specific batch quantity, this routing is used.
'b7Otherwise, function searches for routing with a batch quantity of zero (batch quantity of zero suggests a general purpose routing). If 

a general purpose routing is found, it is used.

'b7If no routing is found, than the functions sends and error message to Work Center and returns.


c)If a routing is found, "Process Routing" is called with the item number and batch quantity for which the routing search was successful. 
"Process Routing" returns the total (accumulated) value of Setup, Move/Queue, and Run hours for the routing. 


d)The values for Leadtime/Unit, Leadtime Level are calculated using the Setup, Move/Queue, and Run Hours, and Batch Quantity (using 
appropriate unit conversions). 


e)Leadtime Manufacturing and Leadtime Cumulative values are set to Zero. These fields will be updated by "Leadtime Rollup" business 
function using the "Leadtime Cumulative" values of lowest level purchased items.


f)Table F4102 is updated with new values of Leadtime/Unit, Leadtime Level, Leadtime Manufacturing, Leadtime Cumulative. MRP Net Change 
Flag is set.



2.4.2Processing (N3003300 - Process Routing) 


0.Get selected routing. Retrieve routing records sequentially. Skip all the records not valid on user supplied AsOfDate (o today's date, in case user 
did not supply this date), or with an operation code of "A", "R", or "T". All the rest of records are processed according to following logic.

1.If Move and Queue Hours values are blank in Routing Master record, than get their default values from Work Center Master Table F30006.

2.Get Work Center Efficiency and Utilization from F30006 and divide by 100 to get fraction value. Default the values to 1 if not found in F30006.

3.Check for intermediates and, if found, adjust intermediate quantity to cumulative yield percentage (CPYP). Round up to whole number if Round 

Flag is on for the item in F4101.

4.Setup, Move/Queue, and Run hours are calculated according to the calculations specified in "Leadtime Calculation" specifications document.

5.Values are copied into BF (Data structure) fields to return to calling program.




Data Structure

D3003300 - Leadtime Calculate

Parameter NameData ItemData TypeReq/OptI/O/Both
mnIdentifierShortItemITMMATH_NUMERICREQINPUT

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szCostCenterMCUcharOPTINPUT

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

jdAsOfDateASDE1JDEDATEOPTINPUT

The date used for effectivity checking. Enter a specific date to display documents (orders, bills of material, routings, as applicable) that are 
effective on or after that date. The current system date is the default, but you can enter any future or past date.

idPPATMessage_GENLNGGENLNGIDOPTINPUT

General purpose ID variable.

szUserIdUSERcharOPTINPUT

The code that identifies a user profile.

szWorkStationIdJOBNcharOPTINPUT

The code that identifies the work station ID that executed a particular job.

jdDateTodayASDE1JDEDATEOPTINPUT

The date used for effectivity checking. Enter a specific date to display documents (orders, bills of material, routings, as applicable) that are 
effective on or after that date. The current system date is the default, but you can enter any future or past date.

mnTimeOfDayTDAYMATH_NUMERICOPTINPUT

The computer clock in hours:minutes:seconds.

szProgramIdPIDcharOPTINPUT

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.

cPOQueueHoursFlagEV01charOPTINPUT

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

cPOMoveQhrsFrmWCEV01charOPTINPUT

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

cPOOverrideNoOfEmpEV01charOPTINPUT

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

Related Functions

None

Related Tables

None
ProcessRouting

ProcessRouting

Leadtime Calculate

Major Business Rule

Object Name: N3003300

Parent DLL: CMFGBASE

Location: Client/Server

Language: NER

Data Structure

D3003310 - Leadtime - Process Routing

Parameter NameData ItemData TypeReq/OptI/O/Both
szCostCenterAltMMCUcharREQINPUT

A code that represents a high-level business unit. Use this code to refer to a branch or plant that might have departments or jobs, which 
represent lower-level business units, subordinate to it. For example:     o Branch/Plant (MMCU)     o Dept A (MCU)     o Dept B (MCU)     o Job 123 
(MCU) Business unit security is based on the higher-level business unit.

mnIdentifierShortItemITMMATH_NUMERICREQINPUT

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szTypeRoutingTRTcharREQINPUT

A user defined code (40/TR) that indicates the type of routing. You can define different types of routing instructions for different uses. For 
example:    M    Standard Manufacturing Routing    RWK  Rework Routing    RSH  Rush Routing You define the routing type on the work order 
header. The system then uses the specific type of routing that you define in the work order routing. Product Costing and Capacity Planning systems 
use only M type routings.

mnUnitsBatchQuantityBQTYMATH_NUMERICREQINPUT

The quantity of finished units that you expect this bill of material or routing to produce. You can specify varying quantities of components 
based on the amount of finished goods produced. For example, 1 ounce of solvent is required per unit up to 100 units of finished product. 
However, if 200 units of finished product is produced, 2 ounces of solvent are required per finished unit. In this example, you would set up batch 
quantities for 100 and 200 units of finished product, specifying the proper amount of solvent per unit.

jdAsOfDateASDE1JDEDATEOPTINPUT

The date used for effectivity checking. Enter a specific date to display documents (orders, bills of material, routings, as applicable) that are 
effective on or after that date. The current system date is the default, but you can enter any future or past date.

mnOriginalItemITMMATH_NUMERICOPTINPUT

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

mnTotalRunTimePerUnitMN29D9MATH_NUMERICOPTOUTPUT

This is a generic field used as a work field in Everest.

mnAccMoveAndQueueHoursMN29D9MATH_NUMERICOPTOUTPUT

This is a generic field used as a work field in Everest.

mnAccSetupHoursMN29D9MATH_NUMERICOPTOUTPUT

This is a generic field used as a work field in Everest.

mnF3009WorkHoursPerDayWRHRMATH_NUMERICOPTNONE

The number of work hours that the manufacturing plant operates per day.

mnF4102BatchQuantityMLQMATH_NUMERICOPTNONE

The quantity that determines the leadtime level for a manufactured item. Each of the routing steps for the item are extended by this quantity. 
For the system to calculate the leadtime level, the quantity in this field must be a value other than zero.

mnAccLeadtimeLevelLTLVMATH_NUMERICOPTNONE

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).

cPOQueueHoursFlagEV01charOPTNONE

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

cPOMoveQhrsfrmWC_EV01EV01charOPTNONE

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

mnTotalRunTimePerUnitDaysMN29D9MATH_NUMERICOPTOUTPUT

This is a generic field used as a work field in Everest.

cPOOverrideNoOfEmpEV01charOPTNONE

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

Related Functions

None

Related Tables

None