MRPWriteForecastQtyToCache

MRP, Write Forecast Qty To Cache

Major Business Rule

Object Name: B3400380

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This business function will read the Forecast table (F3460) and write the Forecast Quantity to the 
MRP Item Quantity Cache.  Quantities are written to the cache with Quantity Type 'FQU' (Forecast Qty 

Unadjusted).


1.1Purpose
This function is used to obtain data from the F3460 table for the MRP Planning Program P3482. The 
function will return error codes necessary. The adjustments to the forecast quantities based on time 

fence rules will not be done in this function.  Instead, B3400400 will do this.


1.2Setup Notes and Prerequisites
The MRP Item Quantity Cache is managed by business function B3401290.

1.3Special Logic

None

2.Technical Specifications

The following actions have to be performed by the Business Function.
1. Open Tables

Open table F3460.
If Error in Opening the Table, Exit the function with an Error code = '1'


2. Load the Forecast Data in the Arrays

Wk Exit Flag = '0'

Wk From Date = Input From Date ($$FBEG)

If Input Forecast Consumption Flag($$FCP) = '1' And Input Time Fence Rule($$SFOG) = 'H'
Wk From Date = Input Forecast Beginning Date ($$FBDT)
End If

If Input Consolidation Branch = " "

Wk Cache Branch = Input Branch

Else

Wk Cache Branch = Input Consolidation Branch

End If

Select Records from F3460 Using MFITM=Input Item(SVITM), MFMCU=Input Branch(SVMCU), Wk From 
Date <= MFDRQJ <= Input Thru Date($$ENDD) And MFFQT >0.

While Wk Exit flag <> '1'

Fetch the record from F3460

If Fetch Failed

Break

EndIf

If Input Generation Type($$GEN) = '2' and Input Master Planning Code(SVMPST) = 

'5'

If  MFTYPF <> Input MPS Forecast Type($$MTYF)

Continue

Endif

Else

If MFTYPF <> Input ForecastTypes 1-5($$TYPF1-5)

Continue

Endif

Endif

Call B3401290 in 'GET' mode to fetch from MRP Item Quantity Cache using Wk Cache 
Branch
, MFDRQJ, and QuantityType = 'FQU'
If Cache Code Error = '0' (i.e. Record found in cache)

Add MFFQT to the record Quantity and,

call B3401290 in 'UPDATE' mode to update record.
Else

Call B3401290 in 'ADD' mode to add a new record to the cache using the 
Wk Cache Branch, MFDRQJ, 'FQU', and MFFQT

EndIf

EndWhile


3. Close all Tables

Close F3460
Exit the function with Error Code = 0




Data Structure

D3400380 - MRP, Write Forecast Qty To Cache

Data Item Data Structure DescriptionI/ORequiredNotes
JOB            Job Number                        IY      Used when accessing cache 

bsfn.

ITM            Short Item Number                  IY      SVITM

MCU            Branch                        IY      SVMCU

EFFF            From Date                        I      $$BEG Beg Date $$FBEG

EFFT            Thru Date                        I      $$ENDD End Date

MPST            Master Planning Code            IY      SVMPST From Item bal F4102

EV01            Generation Type                  IY      PO $$GEN from Process Options

TYPF            Forecast Type 1                   I         $$TYPF1 from Process Options 

TYPF            Forecast Type 2                  I       $$TYPF2 from Process Options 

TYPF            Forecast Type 3                  I       $$TYPF3 from Process Options 

TYPF            Forecast Type 4                  I       $$TYPF4 from Process Options 

TYPF            Forecast Type 5                  I       $$TYPF5 from Process Options 

TYPF            MPS Forecast Type                   I       $$MTYF from Process Option

EV01              Suppress Error Message            I         ' ' - Display Errors '1' - 

Suppress                                                                         Error Messages

ERRC        Error Code                        O       '0' - Success (Default) '1' - 

Error                                                                         in function

DTAI          Error Message ID                  O       Blanks - Success '3143' - 

Errors

DATE04         Forecast Beginning Date            I          $$FBDT

EV03            Forecast Consumption Flag        I      '1' for Forecast Consumption  

                                                                       Processing is On. ($$FCP)

MPSP            Time Fence Rule                I         $$SFOG

MCU           Consolidation Branch            I         If " " then use Input Branch 

else use                                                                                               

                                                                                                      

                                                                                     this.


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnShortItemNumberITMMATH_NUMERICNONENONE

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

szBranchMCUcharNONENONE

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.

jdFromDateEFFFJDEDATENONENONE

A date that indicates one of the following:     o When a component part goes into effect on a bill of material     o When a routing step goes into 
effect as a sequence on the routing for an item     o When a rate schedule is in effect The default is the current system date. You can enter 
future effective dates so that the system plans for upcoming changes. Items that are no longer effective in the future can still be recorded and 
recognized in Product Costing, Shop Floor Management, and Capacity Requirements Planning. The Material Requirements Planning system 
determines valid components by effectivity dates, not by the bill of material revision level. Some forms display data based on the effectivity 
dates you enter.

cMasterPlanningCodeMPSTcharNONENONE

A code that indicates how Master Production Schedule (MPS), Material Requirements Planning (MRP), or Distribution Requirements 
Planning (DRP) processes this item. Valid codes are:    0   Not Planned by MPS, MRP, or DRP    1   Planned by MPS or DRP    2   Planned by MRP    
3   Planned by MRP with additional independent forecast    4   Planned by MPS, Parent in Planning Bill    5   Planned by MPS, Component in 
Planning Bill  These codes are hard coded.

cGenerationTypeEV01charNONENONE

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

szForecastType1TYPFcharNONENONE

A user defined code (34/DF) that indicates one of the following:     o The forecasting method used to calculate the numbers displayed about 
the item     o The actual historical information about the item 

szForecastType2TYPFcharNONENONE

A user defined code (34/DF) that indicates one of the following:     o The forecasting method used to calculate the numbers displayed about 
the item     o The actual historical information about the item 

szForecastType3TYPFcharNONENONE

A user defined code (34/DF) that indicates one of the following:     o The forecasting method used to calculate the numbers displayed about 
the item     o The actual historical information about the item 

szForecastType4TYPFcharNONENONE

A user defined code (34/DF) that indicates one of the following:     o The forecasting method used to calculate the numbers displayed about 
the item     o The actual historical information about the item 

szForecastType5TYPFcharNONENONE

A user defined code (34/DF) that indicates one of the following:     o The forecasting method used to calculate the numbers displayed about 
the item     o The actual historical information about the item 

szMPSForecastTypeTYPFcharNONENONE

A user defined code (34/DF) that indicates one of the following:     o The forecasting method used to calculate the numbers displayed about 
the item     o The actual historical information about the item 

cSuppressErrorMessageEV01charNONENONE

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

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

szErrorMessageIDDTAIcharNONENONE

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 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

szJobNumberJOBcharNONENONE

Job Number

jdThruDateEFFTJDEDATENONENONE

A date that indicates one of the following:     o When a component part is no longer in effect on a bill of material     o When a routing step is no 
longer in effect as a sequence on the routing for an item     o When a rate schedule is no longer active The default is December 31 of the 
default year defined in the Data Dictionary for Century Change Year. You can enter future effective dates so that the system plans for upcoming 
changes. Items that are no longer effective in the future can still be recorded and recognized in Product Costing, Shop Floor Management, 
and Capacity Requirements Planning. The Material Requirements Planning system determines valid components by effectivity dates, not by 
the bill of material revision level. Some forms display data based on the effectivity dates you enter.

jdForecastBeginningDateDATE04JDEDATENONENONE

Event point for JDE Date.

cForecastConsumptionFlagEV03charNONENONE

A radio button that specifies the level at which trace/track result is to be displayed.  Select the Detail to display all transactions except IB, IX, 
and IZ types.  Or, select Derivative Lots Only to display only those transactions that may have created new derivative lot. 

cTimeFenceRuleMPSPcharNONENONE

A code (system 34, table TF) that the system uses in conjunction with the Planning Time Fence Days field to determine how forecast 
demand or actual customer demand is used. For example:    S tells the system to plan using customer demand before the time fence and forecast 
after the time fence    F tells the system to plan using forecast before the time fence and forecast plus customer demand after the time fence  If 
you enter 5 in the Planning Time Fence Days field and S in this field, then the system uses only customer demand for the regeneration for the 
first 5  days. After 5 days, the system uses the forecast for the regeneration. Valid codes are:    C Customer demand before, greater of forecast 
or customer demand after    F Forecast before, forecast plus customer demand after    G Greater of forecast or customer demand before, 
forecast after    S Customer demand before, forecast after    1   Zero before, forecast after    3   Zero before, forecast plus customer demand after 

szConsolidationBranchMCUcharOPTNONE

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.

cForecastIncludedEV01charOPTNONE

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

jdGenerationDateDATE01JDEDATEOPTNONE

Event point for JDE Date.

cModeEV01charOPTNONE

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

jdPlanDatePLDTJDEDATEOPTNONE

A value that identifies the planned date.

jdStartDateDTEJDEDATEOPTNONE

You can enter a date with or without slashes (/) or dashes (-) as separators. If you leave a date entry field blank, the system supplies the 
current date.

nNoOfBucketlessDatesINT01integerOPTNONE

Number of Days in Future to Query for Responses Due. 

cIncludeShippedQuantitiesEV01charOPTNONE

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

cNumberOfBranchesINT01integerOPTNONE

Number of Days in Future to Query for Responses Due. 

szComputerIDCTIDcharOPTNONE

cSupplyDemandExistsEV01charOPTNONE

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

cInterplantConsumesForecastEV01charOPTNONE

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

jdBeginDateDTEJDEDATEOPTNONE

You can enter a date with or without slashes (/) or dashes (-) as separators. If you leave a date entry field blank, the system supplies the 
current date.

cPotencyControlFlagEV01charOPTNONE

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

mnStandardPotencySTDPMATH_NUMERICOPTNONE

The percentage of active ingredients normally found in an item.

cPotencyUnitFlagEV01charOPTNONE

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

szUnitOfMeasurePrimaryUOM1charOPTNONE

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 
(each) or KG (kilogram).

nNumberOfPastDuePeriodsINT01integerOPTNONE

Number of Days in Future to Query for Responses Due. 

cConsolidationMethodEV01charOPTNONE

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

szStandardUOMConversionTFLAcharOPTNONE

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 
unit of measure    1       Bypass the item-specific unit of measure and use the standard unit of measure

szDecreaseSOQtyDescDSC1charOPTNONE

Brief information about an item; a remark or an explanation.

szIncreaseSOQtyDescDSC1charOPTNONE

Brief information about an item; a remark or an explanation.

szDeferSODescDSC1charOPTNONE

Brief information about an item; a remark or an explanation.

szCancelSODescDSC1charOPTNONE

Brief information about an item; a remark or an explanation.

szExpediteSODescDSC1charOPTNONE

Brief information about an item; a remark or an explanation.

cWarningMessageFlagEV01charOPTNONE

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

mnF3411UniqueKeyIDUKIDMATH_NUMERICOPTNONE

This field is a unique number used to identify a record in a file.

cMRPItemDisplayCodeMRPDcharOPTNONE

This code may be used as an additional field to select Item information to print on reports.  Once values are loaded into this field, The 
DREAM Writer may be set up to select these values. Valid values are:    blank Items NOT processed by the generation.    1       Items processed by 
the generation WITHOUT outstanding messages.    2       Items processed by the generation WITH outstanding messages.

szDateBranchMCUcharOPTNONE

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.

szProgramIdPIDcharOPTNONE

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.

mnUniqueKeyIDOffsetMATH01MATH_NUMERICOPTNONE

- - - Good Performance Low Value. 

cSalesOrderIncludedEV01charOPTNONE

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

cProjectPlanningEV01charOPTNONE

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

mnSequenceNumberSEQNMATH_NUMERICOPTNONE

A number used to organize the table into a logical group for online viewing and reporting.

szUserIdUSERcharOPTNONE

The code that identifies a user profile.

jdMessageTimeFenceDateDATE01JDEDATEOPTNONE

Event point for JDE Date.

cCustomerAddressRltnshipFCCRcharOPTNONE

Related Functions

B3401290 Cache, Process MRP Item Quantities

Related Tables

F3460 Forecast File