1.Functional Description
This business function will generate the Component requirements using the Bill of Materials and the
requirements for the Parent. Then it will write the requirements to the Forecast table F3460. It will
also update the Summary Records in the forecast table. This function is used in MPS generation in
MRP Planning.
1.1Purpose
This function is used to write Forecasts for Components based on the Planning Bill based on the
Parent Forecast Requirements.
1.2Setup Notes and Prerequisites
The following activities must be done, before the function is invoked.
1. The Parent Item F4101 data and the F4102 data must be obtained before invoking the function.
1.3Special Logic
None
2.Technical Specifications
The following actions have to be performed by the Business Function.
1.Open Tables and Initialize Data
Open F4101, F4102, F3002, and F3460 tables
If Error in Opening the Tables, Exit the function with an Error code = '1'
Create the following Arrays an Initialize them
@DT[$PND] - Date Array
@IT[$PND] - Forecast Requirements
Wk Index $X = 0
Call B3401270 with Action Code = '1' and input MCU to retrieve the first cache element
from the
If $X > $PND
Break
Endif
$X = $X + 1
@DT[$X] = the Date from the cache record
Call B3401270 with Action Code = '6' and input MCU to get the next Date cache
element
EndWhile
Call B3401290 with Action Code = '1', input MCU, and Quantity Type = 'FQ' to retrieve the
first cache
$X = 1
While the Date from cache record <> @DT[$X]
$X = $X + 1
EndWhile
@IT[$X] = -1 * the Quantity from the cache record
Call B3401290 with Action Code = '6', input MCU, and 'FQ' to get the next Item
Qty cache element
EndWhile
2. Load the Sales Order Data in the Arrays
Wk First Time = ' '
Wk Exit flag = ' '.
Wk Exit flag 1 = ' '.
Do While Exit flag <> '1'
Read F3002 Sequentially using Input KIT, MMCU, COBY (= ' ' ), TBM (= 'M') and
BQTY (= 0)
If not found
Break and Exit the Business function.
Endif
Wk Year = 0.
Summary Qty = 0
If Wk First Time = ' '
Wk First Time = '1'
Wk Conv Factor = 1
If IXUOM <> SVUOM1 or SVOT1Y = 'Y'
Get Wk Conv Factor using B4000520 with IXUOM and Input SVUOM,
IXMMCU, SVOT1Y,
Endif
Read F4101 using IXITM as key.
Read F4102 using IXITM and IXCMCU as keys
If F4101 or F4102 not found
Continue
Endif
Wk Conv Factor 1 = 1
If IXUM <> IMUOM1 or IBOT1Y = 'Y'
Get Wk Conv Factor 1 using B4000520 with IXUM and IMUOM1, IXCMCU,
IBOT1Y, IBSTDP,
For $X = 1 to Input $$PND Do
If @IT[$X] = 0
Continue
Endif
If SVMRPP = 'F'
Wk Lead Time = SVLTLV
Endif
If SVMRPP = 'V'
Wk Lead time = SVLTPU * @IT,$X
If Input SVRATE <> 0
Wk Lead Time = Wk Lead Time/SVRATE
Endif
Wk Lead time = Wk Lead Time + SVSETL + SVQUED
If Input Work Hours > 0
Wk Lead Time = Ceiling(Wk Lead Time/ Input Work Hours, 0)
Endif
If $SVSTK <> '0'
Endif
Endif
EndIf
EndIf
Endif
If Wk Lead Time = 0
MFDRQJ = @DT[$X]
Else
Call B3400540 to Back Schedule flag = 'B'/Wk Lead Time/@DT[$X]
and Calculate MFDRQJ
Input F3411 UKID = B3400540 F3411 UKID
Input Date Error Flag = B3400540 Date Error Flag
Endif
If MFDRQJ < IXEFFF or MFDRQJ > IXEFFT or IXQNTY = 0
Continue
Endif
Save Lead Time = Wk Lead Time
Wk Lead Time = IXLOVD
If IXLOVD <> 0
If IXLOVD < 0
Wk Lead Time = Wk Lead Time * (-1)
Back Schedule flag = 'B'
Else
Back Schedule flag = 'F'
Endif
Ceiling (Wk Lead Time, 0)
If Back Schedule Flag = 'F' and Wk Lead Time > Save Lead Time
Wk Lead Time = Save Lead Time
EndIf
Call B3400540 with Back Schedule flag/Wk Lead Time/MFDRQJ and
Calculate MFDRQJ
Input F3411 UKID = B3400540 F3411 UKID
Input Date Error Flag = B3400540 Date Error Flag
Endif
If IXFORQ = '%' or 'F'
Wk Quantity = IXQNTY * Wk Conv Factor 1* IXFTRP/100
If IXFORQ = '%'
Wk Quantity = Wk Quantity/100
Endif
Else
Wk Quantity = -1 * IXQNTY * Wk Conv Factor 1 * IXFTRP/100 *
@IT[$X] /Wk Conv Factor
Endif
If IMSNS = 'R'
Ceiling(Wk Quantity, 0)
EndIf
If Wk Quantity > 0
Write/Update F3460 with MFITM( IXITM), MFMCU(IXCMCU),
MFTYPF($$MTYF), MFDCTO("FR"), MFPID($$PID), MFFQT, MFUORG(Wk Quantity),
MFLITM(IMLITM),MFAITM(IMAITM) and MFYR (0)
Summary Qty = Summary Qty + Wk Quantity
Endif
If Year in MFDRQJ <> Wk Year
Summary Qty = Summary Qty - Wk Quantity
If Summary Qty > 0
Wk Year = Year in MFDRQJ
Endif
IXITM),MFMCU(IXCMCU),MFTYPF($$MTYF), MFDCTO("FR"), MFPID($$PID) MFFQT,MFUORG(Summary Qty),MFLITM(IMLITM),
MFAITM(IMAITM)
Endif
Wk Year = Year in MFDRQJ
Summary Qty = Wk Quantity
Endif
EndDo
If Summary Qty > 0
Write/Update F3460 using with MFYR(Wk Year), MFITM( IXITM),
MFMCU(IXCMCU), MFTYPF($$MTYF), MFDCTO("FR"), MFPID($$PID) MFFQT,MFUORG(Summary
Qty),MFLITM(IMLITM), MFAITM(IMAITM)
Endif
Enddo
3 Close all Tables and Release the Memory
Close all Tables and Deallocate memory for Arrays
Exit the function with Error Code = 0
D3400410 - MRP, Write Planning Forecasts
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
mnParentItemNumber | KIT | MATH_NUMERIC | NONE | NONE |
The system provides for three separate item numbers.
1. Item Number (short) - An eight-digit, computer assigned, completely
| ||||
szParentBranch | MMCU | char | NONE | NONE |
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
| ||||
nElementsInDateArray | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
szParentPrimaryUOM | UOM1 | char | NONE | NONE |
A user defined code (00/UM) that identifies the unit of measure that the system uses to express the quantity of an item, for example, EA
| ||||
cLeadTimeType | MRPP | char | NONE | NONE |
A code that determines whether the system uses fixed or variable leadtimes.
This code works in conjunction with the value from either the
| ||||
mnLeadTimeLevel | LTLV | MATH_NUMERIC | NONE | NONE |
A value that represents the leadtime for an item at its assigned level in the production process, as defined on Plant Manufacturing Data.
| ||||
mnLeadTimePerUnit | LTPU | MATH_NUMERIC | NONE | NONE |
The total number of hours required to build one unit as specified on the routing. This value is factored by the time basis code.
You can enter
| ||||
cParentStockingType | STKT | char | NONE | NONE |
A user defined code (41/I) that indicates how you stock an item, for example, as finished goods or as raw materials. The following stocking
| ||||
mnParentSetupLabor | SETL | MATH_NUMERIC | NONE | NONE |
The standard setup hours that you expect to incur in the normal completion of this item. This value is not affected by crew size. | ||||
mnParentQueueTime | QUED | MATH_NUMERIC | NONE | NONE |
The total hours that an order is expected to be in queue at work centers and moving between work centers.
The system stores this value in
| ||||
mnParentTimeBasisRate | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
nMfgSafetyLeadTime | INT02 | integer | NONE | NONE |
Number of Days in the Past to Query for Quote Requests Received. | ||||
nPurchSafetyLeadTime | INT03 | integer | NONE | NONE |
Event point for Integer. | ||||
szForecastType | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
szProgramID | PID | char | NONE | NONE |
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry
| ||||
cSuppressErrorMessage | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
cErrorCode | ERRC | char | NONE | NONE |
This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document
| ||||
szErrorMessageID | DTAI | char | NONE | NONE |
A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or
| ||||
cDateErrorFlag | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
szDateErrorMsgDesc | DSC1 | char | NONE | NONE |
Brief information about an item; a remark or an explanation. | ||||
mnF3411UniqueID | UKID | MATH_NUMERIC | NONE | NONE |
This field is a unique number used to identify a record in a file. | ||||
mnWorkHours | WRHR | MATH_NUMERIC | NONE | NONE |
The number of work hours that the manufacturing plant operates per day. | ||||
szStandardUOMConversion | TFLA | char | NONE | NONE |
Allows you to bypass the item-specific unit of measure and use the standard unit of measure. Valid values are:
blank Use the item-specific
| ||||
mnStandardPotency | STDP | MATH_NUMERIC | NONE | NONE |
The percentage of active ingredients normally found in an item. | ||||
cPotencyControl | OT1Y | char | NONE | NONE |
A code that indicates whether you control the item by potency. | ||||
szJobNumber | JOB | char | NONE | NONE |
Job Number | ||||
cActualStockingType | STKT | char | NONE | NONE |
A user defined code (41/I) that indicates how you stock an item, for example, as finished goods or as raw materials. The following stocking
| ||||
mnUniqueKeyIDOffset | MATH01 | MATH_NUMERIC | OPT | NONE |
- - - Good Performance Low Value. |
B3400540 MRP, Calculate Schedule Dates for Planning | ||||
B3401270 Cache, Process MRP Bucketless Dates | ||||
B3401290 Cache, Process MRP Item Quantities | ||||
B4000520 Get Item UoM Conversion Factor | ||||
B9800100 Get Audit Information |
F3002 Bill of Material Master File | ||||
F3460 Forecast File | ||||
F4101 Item Master | ||||
F4102 Item Branch File |