MRPWritePartsListQtyIntoCache

MRP, Write Parts List Qty Into Cache

Minor Business Rule

Object Name: B3400480

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This business function will read the Parts List table (F3111) and Load the Parts List Quantity 
adjusted by Planning Message data from Message Table (F3411) into the Regular Item Qty Cache in the Primary 

UOM.  


1.1Purpose
This function is used to obtain data from the F3111 table for the MRP Planning Program R3482 and 
R3483. The function will return error codes necessary. 


1.2Setup Notes and Prerequisites

1.3Special Logic

None

2.Technical Specifications
The following actions have to be performed by the Business Function.

1. Open Tables

Open tables F4801, F3411, F4101, F4102, and F3111
If Error in Opening the Tables, Exit the function with an Error code = '1'


2. Load the Parts List Data into the Cache

Switch (Input Number of Past Due Periods $PDUE)

Case 0

If Input Forecast Consumption Flag($$FCP) = '1'

Wk From Date = Input $$FBDT

Else

Wk From Date = Input $$BEG

End If

Select Records from F3111 Using WMCPIT = Input Item, WMCMCU = Input Branch, 
WMCOBY = ' ', and Wk From Date <= WMDRQJ <= Input Last Date

Case 1
If Input Forecast Consumption Flag($$FCP) = '1'

Select Records from F3111 Using WMCPIT = Input Item, WMCMCU = Input 
Branch, WMCOBY = ' ',  and Input $$FBDT <= WMDRQJ <= Input Last Date

Else

Select Records from F3111 Using WMCPIT = Input Item, WMCMCU = Input 
Branch, WMCOBY = ' ',  and WMDRQJ <= Input Last Date

End If

Case 2

Select Records from F3111 Using WMCPIT = Input Item, WMCMCU = Input Branch, 
WMCOBY = ' ', and WMDRQJ <= Input Last Date

End Switch

Wk Exit Flag = '0'

If Input Consolidation Method = '1' then

Wk Cache Branch = Input Date Branch

Else

Wk Cache Branch = Input Branch

End If

While Wk Exit flag <> '1'

Fetch from F3111

If fetch failed or WMDRQJ = 0

Break

Endif

Read F4801 using WMDOCO as the Key

If not found

Continue

Endif

Call B3401300 in 'GET' mode to fetch record from Inclusion Rules cache, using 
WADCTO, LNTY=' ', WASRST(Right Justified).

If Cache Code Error <> '0' (Not Found)

Continue

Endif

Wk Conv Factor = 1

If WMUM <> Input UOM1 or SVOT1Y = 'Y'

Get Wk Conv Factor from WMUM to Input UOM1 using B4000520 assing 
SVMCU,SVITM, SVOT1Y, SVSTDP, SVTFLA

Endif

Read F4101 using WAITM as the key.

Read F4102 using WAITM and WAMMCU as the keys

If not found

Continue

EndIf

Wk WO Qty = WAUORG

If  WAUOM <> IMUOM1 Or IBOT1Y = 'Y'

Get Conv Factor from WAUOM to IMUOM1 using B4000520 passing WAITM, 
WAMMCU,IBOT1Y, IBSTDP, IMTFLA

Wk WO Qty = WAUORG * Conv Factor

Endif

Call B3401270 in 'GET NEAREST' mode Input Date Branch, WMDRQJ, and Comparison 
Flag = 'L' (<=)

WMDRQJ = Date returned by B3401270


Cache the unadjusted Parts List Qty  in the Item Qty Cache
Wk PLU Qty = (WMUORG - WMQNTA) * Wk Conv Factor
Call B3401290 in 'GET' mode to fetch Item Qty cache record using Wk Cache Branch, WMDRQJ and 

'PLU'.

If Cache Code Error = '0' (Record Found)

Add Wk PLU Qty to Quantity from Cache record, and 

Call B3401290 in 'UPDATE' mode to update the cache record.

Else

Call B341290 in 'ADD' mode to add a new cache record with Wk Cache 
Branch
, WMDRQJ, 'PLU' and with Wk PLU Qty
End If


Wk Order Qty = WMUORG 

Wk Req Date = WMDRQJ

Do While Wk Exit flag 1 <> '1'

Read F3411 using WMDOCO and WADCTO as Partial Keys(Read in order of 

MMUKID)

If not found

Break

Endif

If MMMSGT = 'M' then

Continue

End If

If WASRST >= Input $$SRST and Input $$SRST <> ' '

Wk MSGT = 'S'

Else

Wk MSGT = 'A'

Endif

If MMMSGT = 'C'

Wk Msg Qty = (WMUORG - WMQNTA) * Wk Conv Factor

If Wk Msg Qty  > 0 and $@A = '1' and Input Cancel Msg <> ' '

Write F3411 with MMMSGT(Wk MSGT), MMUKID(Input UKID), 

MMDOCO (WMDOCO),MMDCTO(WADCTO), MMLNID(=0), MMKCOO(=' '), MMTRQT(Wk Msg 

Qty) , MMVEND(0), MMSTRT(0), MMRSTJ(0), MMDSC1(Inp Cancel 

Parts List Msg), MMITM(Inp Item), MMMCU(Wk Cache Branch), 
MMDRQJ(WMDRQJ), MRRQJ(0), MMHCLD('A').

Input UKID = Input UKID + 1

Output $$MRPD = '2'

Endif

WMUORG = 0

Break

Endif

If MMMSGT = 'L'/'G' and WMFORQ <> 'F'

WMUORG = WMUORG * MMTRQT

If Wk WO Qty <> 0

WMUORG = WMUORG/Wk WO Qty

Endif

Wk Msg Qty = (WMUORG - WMQNTA) * Wk Conv Factor

If Wk Msg Qty > 0 and $@A = '1' 

If MMMSGT = 'L'

Wk Desc = Decrease Parts List Msg

Else

Wk Desc = Increase Parts List Msg

Endif

If Wk Desc <> Blanks

Write F3411 with MMMSGT(Wk MSGT), MMUKID(Input 
UKID), MMDOCO (WMDOCO),MMDCTO(WADCTO), MMLNID(=0), MMKCOO(=' '), 

MMTRQT(Wk Msg Qty) , MMVEND(0), MMSTRT(0), MMRSTJ(0), MMDSC1(Wk

Desc), MMITM(Inp Item), MMMCU(Wk Cache Branch), 

MMDRQJ(WMDRQJ), MMRRQJ(0), MMHCLD('A').

Input UKID = Input UKID + 1

Output $$MRPD = '2'

Endif

Endif

Endif

If MMMSGT = 'D'/'E'

Wk Old DRQJ = WMDRQJ

Wk Days = Date Difference (MMRRQJ  - MMDRQJ)

WMDRQJ = Add Days (WMDRQJ with Wk Days)

Call B3401270 in 'GET NEAREST' mode passing keys Input Date 

Branch, WMDRQJ, and 

Comparison Flag = 'L'.
Wk Msg Qty = (WMUORG - WMQNTA) * Wk Conv Factor

If Wk Msg Qty > 0 and $@A = '1'

If MMMSGT = 'D'

Wk Desc = Defer Parts List Msg

Else

Wk Desc = Expedite Parts List Msg

Endif

If Wk Desc <> Blanks

Write F3411 with MMMSGT(Wk MSGT), MMUKID(Input 

UKID), MMDOCO (WMDOCO),MMDCTO(WADCTO), MMLNID(=0), MMKCOO(=' '), 

MMTRQT(Wk Msg Qty) , MMVEND(0), MMSTRT(0), MMRSTJ(0), MMDSC1(Wk 

Desc),MMITM(Inp Item), MMMCU(Wk Cache Branch), 
MMDRQJ(Wk Old DRQJ), MMRRQJ(WMDRQJ), MMHCLD('A').

Output $$MRPD = '2'

Input UKID = Input UKID + 1

Endif

Endif

Endif

EndWhile

If WASRST >= Input $$SRST and Input $$SRST <> ' '

WMDRQJ = Wk Req Date

WMUORG = Wk Order Qty

Endif

If WMUORG > 0


Cache Firm Parts List Qty to Item Qty Cache

Wk FPL Qty = (WMUORG - WMQNTA) * Wk Conv Factor
Call B3401290 in 'GET' mode to fetch Item Qty cache record using Wk Cache Branch, WMDRQJ,

and 'FPL'.

If Cache Code Error = '0' (Record Found)
Add Wk FPL Qty to Quantity from Cache record, and 

Call B3401290 in 'UPDATE' mode to update the cache record.

Else
Call B341290 in 'ADD' mode to add a new cache record with Wk Cache Branch, WMDRQJ, 
'FPL' and with Wk FPL Qty

End If
Endif

EndWhile

  

3.  Close all Tables

Close all Tables
Exit 

^

Data Structure

D3400480 - MRP, Write Parts List Qty Into Cache

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.

szDisplayUnitOfMeasureUOM1charNONENONE

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

szWOStatusSRSTcharNONENONE

A user defined code (00/SS) that describes the status of a work order, rate schedule, or engineering change order. Any status change from 
90 through 99  triggers the system to automatically update the completion date.

nPastDueElementsINT01integerNONENONE

Number of Days in Future to Query for Responses Due. 

cWarningMessagesFlagEV01charNONENONE

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

mnF3411UniqueIDUKIDMATH_NUMERICNONENONE

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

cMessageFlagMRPDcharNONENONE

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.

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

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.

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.

szCancelPartsListDescDSC1charNONENONE

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

szDecreasePartsListDescDSC2charNONENONE

A second, 30-character description, remark, or explanation.

szIncreasePartsListDescDSC3charNONENONE

The third line of description associated with an inventory item or order line.

szDeferPartsListQtyDescDSC1charNONENONE

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

szExpeditePartsListQtyDescDSC2charNONENONE

A second, 30-character description, remark, or explanation.

szStandardUOMConversionTFLAcharNONENONE

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

mnStandardPotencySTDPMATH_NUMERICNONENONE

The percentage of active ingredients normally found in an item.

cPotencyControlOT1YcharNONENONE

A code that indicates whether you control the item by potency.

szJobNumberAsStringJOBcharNONENONE

Job Number

jdLastDateEFFTJDEDATENONENONE

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. 

szDateBranchMCUcharNONENONE

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.

cConsolidationMethodEV02charNONENONE

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

mnUniqueKeyIDOffsetMATH01MATH_NUMERICOPTNONE

- - - Good Performance Low Value. 

cSupplyDemandExistsEV01charOPTNONE

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.

cProjectSpecificItemEV01charOPTNONE

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

Related Functions

B3401270 Cache, Process MRP Bucketless Dates
B3401290 Cache, Process MRP Item Quantities
B3401300 Cache, Process MRP Inclusion Rules
B4000520 Get Item UoM Conversion Factor
B9800100 Get Audit Information
B9800420 Get Data Dictionary Definition

Related Tables

F3111 Work Order Parts List
F3411 MPS/MRP/DRP Message File
F4101 Item Master
F4102 Item Branch File
F4801 Work Order Master File