MRPWritePeggingQtyIntoCache

MRP, Write Pegging Qty Into Cache

Minor Business Rule

Object Name: B3400470

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This business function will read the Pegging Table (F3412) and Load the Pegging Quantity adjusted by 

Planning Message data from Message Table (F3411) in the Item Quantity Cache. 


1.1Purpose

This function is used to obtain data from the F3412 table for the MRP Planning Program P3482. 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 and Initialize Data

Open F4801, F3411, F4101, F4102 and F3412 tables

If Error in Opening the Tables, Exit the function with an Error code = '1'


2. Load the Pegging Data in the Arrays

If Input Consolidation Branch = " "
Wk Cache Branch = Input Branch

Else

Wk Cache Branch = Input Consolidation Branch
End If
Select Records From F3412 Using MWITM=Input SVITM, MWMCU=Input SVMCU, and MWDRQJ <= Input Last Date

Wk Exit Flag = '0'

While Wk Exit flag <> '1'
Fetch Record from F3412

If Fetch Failed

Break

Endif

If MWDRQJ = 0

Continue

Endif

If  MWDCTO <> List ('FO' 'WP' )

Call B3401290 in 'GET' mode with Wk Cache Branch, MWDRQJ and 'PQU'.

If Cache Code Error = '0' (record found)

Add MWUORG to Cache Quantity and,

Call B341290 in 'UPDATE' mode.

Else

Call B341290 in 'ADD' mode with Wk Cache Branch, MWDRQJ, 'PQU' 

and MWUORG.

End If

Endif

If MWDCTO <> list ( 'FO', 'WP', 'RS')

Get F4801 row using MWDOCO as the key

If found

If  (Input $$SRST <> ' ' and WASRST < Input $$SRST) or (Input 

$$SRST = ' ')

Read F4101 using WAITM as the Key.

Read F4102 using WAITM and WAMMCU as the Key

If not found

Continue

Endif

Wk Quantity = WAUORG

If  WAUOM <> IMUOM1 Or IBOT1Y from F4102 = 'Y'

Convert Wk Quantity from WAUOM to IMUOM1 using 

B4000520

Endif

Do While Wk Exit flag 1 <> '1'

Read F3411 row using WADOCO, WADCTO as Partial Keys 

If not found

Break

Endif

If MMMSGT = 'C'

MWUORG = 0

Break

Endif

If MMMSGT = 'L'/'G' and Wk Quantity > 0

MWUORG = MMTRQT * MWUORG / Wk Quantity

Endif

If MMMSGT = 'D'/'E' 

MWDRQJ = MMRSTJ

Endif

EndWhile

Endif

Endif

Endif

If  MWUORG <= 0

Continue

Endif

If MWDCTO = 'WP'

Call B3401290 in 'GET' mode with Wk Cache Branch, MWDRQJ and 'PPQ'.

If Cache Code Error = '0' (record found)

Add MWUORG to Cache Quantity and,

Call B341290 in 'UPDATE' mode.

Else

Call B341290 in 'ADD' mode with Wk Cache Branch, MWDRQJ, 'PPQ' 

and MWUORG.

End If

Else

If MWDCTO <> 'FO'

Call B3401290 in 'GET' mode with Wk Cache Branch, MWDRQJ and 

'FPQ'.

If Cache Code Error = '0' (record found)

Add MWUORG to Cache Quantity and,

Call B341290 in 'UPDATE' mode.

Else

Call B341290 in 'ADD' mode with Wk Cache Branch, MWDRQJ, 

'FPQ' and MWUORG.

End If

Endif

Endif

EndWhile


  3. Close All Tables

Close all Tables 

Exit the function with Error Code = 0




Data Structure

D3400470 - MRP, Write Pegging 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.

szPrimaryUnitOfMeasureUOM1charNONENONE

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

szWorkOrderStatusSRSTcharNONENONE

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.

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.

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.

szConsolidationBranchMCUcharNONENONE

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.

cSupplyDemandExistsEV01charOPTNONE

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

cExtendRateEV01charOPTNONE

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

B3401290 Cache, Process MRP Item Quantities
B4000520 Get Item UoM Conversion Factor

Related Tables

F3411 MPS/MRP/DRP Message File
F3412 MPS/MRP/DRP Lower Level Requirements File
F4101 Item Master
F4102 Item Branch File
F4801 Work Order Master File