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
 Wk Cache Branch = Input Branch
Else
Select Records From F3412 Using MWITM=Input SVITM, MWMCU=Input SVMCU, and MWDRQJ <= Input Last Date
Wk Exit Flag = '0'
 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
D3400470 - MRP, Write Pegging Qty Into Cache
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| mnShortItemNumber | ITM | MATH_NUMERIC | NONE | NONE | 
| An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
 | ||||
| szBranch | MCU | char | NONE | NONE | 
| An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
 | ||||
| szPrimaryUnitOfMeasure | 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 
 | ||||
| szWorkOrderStatus | SRST | char | NONE | NONE | 
| A user defined code (00/SS) that describes the status of a work order, rate schedule, or engineering change order. Any status change from 
 | ||||
| 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 
 | ||||
| szJobNumberAsString | JOB | char | NONE | NONE | 
| Job Number | ||||
| jdLastDate | EFFT | JDEDATE | NONE | NONE | 
| 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 
 | ||||
| szConsolidationBranch | MCU | char | NONE | NONE | 
| An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
 | ||||
| cSupplyDemandExists | EV01 | char | OPT | NONE | 
| An option that specifies the type of processing for an event. | ||||
| cExtendRate | EV01 | char | OPT | NONE | 
| An option that specifies the type of processing for an event. | ||||
| cProjectPlanning | EV01 | char | OPT | NONE | 
| An option that specifies the type of processing for an event. | ||||
| mnSequenceNumber | SEQN | MATH_NUMERIC | OPT | NONE | 
| A number used to organize the table into a logical group for online viewing and reporting. | ||||
| cProjectSpecificItem | EV01 | char | OPT | NONE | 
| An option that specifies the type of processing for an event. | ||||
| B3401290 Cache, Process MRP Item Quantities | ||||
| B4000520 Get Item UoM Conversion Factor | 
| 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 |