MRPWriteLowerLevelPeggingFrBOM

MRP, Write Lower Level Pegging Records from BOM

Minor Business Rule

Object Name: B3400450

Parent DLL: CMFG

Location: Client/Server

Language: C

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 Pegging table F3412. This 

function is used to generate lower level Pegging records for MRP Planning.


1.1Purpose
This function is used to write Pegging records for Components based on the Bill of Materials in Multi 
Level Planning, based on the Parent Item Requirements. R3483(MultiPlant MRP) uses this function to 

perform the same function as in R3482.


1.2Setup Notes and Prerequisites

The Parent Item F4101 data and the F4102 data must be obtained before invoking the function.
The Unique Id for F3412 must be determined by calling the function (B3100490). 


1.3Special Logic

None

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

1. Open Tables and Initialise Data

Open F3002, F3412, F4101 and F4102 Tables
If Error in Opening, Exit with an Error Code = '1'.


2. Check in Bill of Materials

IXTBM = Input TBM. IXBQTY = Input UORG, IXMMCU=Input Parent Branch
If IXTBM = ' '

IXTBM = 'M'

Endif.


Read F3002 using Input KIT, MMCU, IXTBM and IXBQTY

If not found

IXBQTY = 0

Read F3002 using Input KIT, MMCU, IXTBM and IXBQTY

If not found

IXTBM = 'M'. IXBQTY = Input UORG

Read F3002 using Input KIT, MMCU, IXTBM, IXBQTY

If not found

IXBQTY = 0

Read F3002 using Input KIT, MMCU, IXTBM, IXBQTY

If not found

Error Code = '2'

Exit the Business function after Closing All Tables

Endif

Endif

Endif

Endif


3. Calculate Requested Date

If Input DCTO = 'WO'
Wk Req Date = Input Start Date

Else

If Input $$CONS = '1' then

IXMMCU = Input Date Branch
Read F3002 using Input KIT, IXMMCU, IXTBM and IXBQTY

End If


If SVMRPP = 'F'

Wk Lead Time = SVLTLV

  Endif

If SVMRPP = 'V'

Wk Lead time = SVLTPU * Input UORG

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'

If SVSTKT = P and PO $$PSLT <> 0
Wk Lead Time = Wk Lead Time + PO $$PSLT

Endif

If SVSTKT = M and PO $$MSLT <> 0

Wk Lead Time = Wk Lead Time + PO $$MSLT

Endif
EndIf

Endif

If Wk Lead Time = 0

Wk Req Date = Input Start Date

Else

Call B3400540 to Back Schedule flag = 'B'/Wk Lead Time/Inp Start Date 

and Calculate Wk Req Date, and Input Date Branch

Input F3411 UKID = B3400540 F3411 UKID

Input Date Error Flag = B3400540 Date Error Flag

Endif

Endif


4. Calculate Qty with Shrinkage

If SVSRKF = '%'
Wk Qty with Shrink  = Input UORG * ( 1 + SVSRNK/100)

Else

Wk Qty with Shrink = Input UORG + SVSRNK

Endif

If SVSNS = 'R'

Wk Qty with Shrink = Round(Wk Qty with Shrink)

Endif


5. Get Unit of Measure Conversion Factor

Wk Conv Factor = 1
If IXUOM <> SVUOM1 or SVOT1Y = 'Y'

Get Wk Conv Factor using B4000520 with IXUOM and Input SVUOM, Inp KIT and 

IXMMCU, SVOT1Y,

SVSTDP, LOTN = ' '
Endif


6. Process records in the Bill of Materials

Do While Wk Exit flag <> '1'
If Wk Req Date >= IXEFFF and Wk Req Date <= IXEFFT and  IXSBNT = 0 and IXQNTY <> 0

If IXLOVD <> 0

If IXLOVD < 0

Back Schedule flag = 'B'

Wk Lead time = -1 * IXLOVD

Else

Back Schedule flag = 'F'

Wk Lead Time = IXLOVD

Endif

Ceiling (Wk Lead Time, 0)

Call B3400540 with Back Schedule flag/Wk Lead Time/Wk Req Date 
and Calculate Wk Req Date as well as Input Date Branch

Input F3411 UKID = B3400540 F3411 UKID

Input Date Error Flag = B3400540 Date Error Flag

If Input DCTO <> 'RS' and Input DRQJ < Wk Req Date

Wk Req Date = Input DRQJ

Endif

Endif

Read F4101 using  IXITM as key.

Read F4102 using  IXITM and IXCMCU as key

If 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, IXITM 

and IXCMCU, IBOT1Y,

IBSTDP, LOTN = ' '
Endif

Wk Quantity = IXQNTY * Wk Conv Factor 1

Wk Quantity = Wk Quantity * (IXFTRP/100) * (1 + (IXSTPP/100)) * (1 + 

(IXSCRP/100))

If IXFORQ = '%'

Wk Quantity = Wk Quantity/100

Endif

If IXFORQ <> '%'/ 'F' 

Wk Quantity = Wk Quantity * Wk Qty with Shrink /Wk Conv Factor

Endif

If IMSNS = 'R'

Wk Quantity = Round ( Wk Quantity)

Endif

If Wk Quantity > 0

If Input $$PROC = '1' And Input $$CONS <> '1' And Input $$CONS 

<> '2'

MWRORN = 'PROCESS'

Endif

Write F3412 with MWKIT(IXKIT), MWMMCU(IXMMCU), MWDRQJ(WkReq 

Date),MWUORG(Wk Quantity), MWITM( IXITM), MWMCU(IXCMCU), MWDOCO(Input 

DOCO),MWDCTO(Input DCTO), MWLOVD(IXLOVD), MWRORN and  MWUKID

Input UKID = Input UKID + 1

Endif

Endif

Read next F3002 record with Input KIT,MMCU,IXTBM and IXBQTY

If not found

Break

Endif

Enddo


7.Close Tables and Exit Routine

Close all the Tables and Release Requests


^

Data Structure

D3400450 - MRP, Write Lower Level Pegging Records from BOM

Parameter NameData ItemData TypeReq/OptI/O/Both
mnParentItemNumberKITMATH_NUMERICNONENONE

The system provides for three separate item numbers.    1.   Item Number (short) - An eight-digit, computer assigned, completely 
non-significant item number.    2.   2nd Item Number - The 25-digit, free form, user defined alphanumeric item number.    3.   3rd Item Number - Another 
25-digit, free form, user defined alphanumeric item number.

szParentBranchMMCUcharNONENONE

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 
represent lower-level business units, subordinate to it. For example:     o Branch/Plant (MMCU)     o Dept A (MCU)     o Dept B (MCU)     o Job 123 
(MCU) Business unit security is based on the higher-level business unit.

szTypeOfBillTBMcharNONENONE

A user defined code (40/TB) that designates the type of bill of material. You can define different types of bills of material for different uses. 
For example:    M     Standard manufacturing bill    RWK   Rework bill    SPR   Spare parts bill  The system enters bill type M in the work order 
header when you create a work order, unless you specify another bill type. The system reads the bill type code on the work order header to 
know which bill of material to use to create the work order parts list. MRP uses the bill type code to identify the bill of material to use when it 
attaches MRP messages. Batch bills of material must be type M for shop floor management, product costing, and MRP processing.

mnBatchQuantityBQTYMATH_NUMERICNONENONE

The quantity of finished units that you expect this bill of material or routing to produce. You can specify varying quantities of components 
based on the amount of finished goods produced. For example, 1 ounce of solvent is required per unit up to 100 units of finished product. 
However, if 200 units of finished product is produced, 2 ounces of solvent are required per finished unit. In this example, you would set up batch 
quantities for 100 and 200 units of finished product, specifying the proper amount of solvent per unit.

mnDocumentNoDOCOMATH_NUMERICNONENONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

szDocumentTypeDCTOcharNONENONE

A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
reserved document type codes for vouchers, invoices, receipts, and time sheets, which create automatic offset entries during the post 
program. (These entries are not self-balancing when you originally enter them.) The following document types are defined by J.D. Edwards and 
should not be changed: P Accounts Payable documents   R Accounts Receivable documents   T Payroll documents   I Inventory documents  
O Purchase Order Processing documents   J General Accounting/Joint Interest Billing documents   S Sales Order Processing documents

jdStartDateSTRTJDEDATENONENONE

The start date for the order. You can enter this date manually, or have the system calculate it using a backscheduling routine. The routine 
starts with the required date and offsets the total leadtime to calculate the appropriate start date.

jdRequestedDateDRQJJDEDATENONENONE

The date that an item is scheduled to arrive or that an action is scheduled for completion.

mnOrderQuantityPrimaryUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

szParentPrimaryUOMUOM1charNONENONE

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

cLeadTimeTypeMRPPcharNONENONE

A code that determines whether the system uses fixed or variable leadtimes. This code works in conjunction with the value from either the 
Level Leadtime field or the Leadtime Per Unit field. Valid codes are:    F Fixed leadtime - The system calculates work order start dates using the 
value from the Leadtime Level field.    V Variable leadtime - The system calculates work order start dates using the value from the Leadtime 
Per Unit field.

mnLeadTimeLevelLTLVMATH_NUMERICNONENONE

A value that represents the leadtime for an item at its assigned level in the production process, as defined on Plant Manufacturing Data. 
The system uses this value to calculate the start dates for work orders using fixed leadtimes. Level leadtime is different for purchased and 
manufactured items: Purchased - The number of calendar days required for the item to arrive at your branch/plant after the supplier receives your 
purchase order. Manufactured - The number of workdays required to complete the fabrication or assembly of an item after all the 
components are available. You can enter level leadtime manually on Manufacturing Values Entry, or you can use the Leadtime Rollup program to 
calculate it. To calculate level leadtime using the Leadtime Rollup program, you must first enter a quantity in the Manufacturing Leadtime Quantity 
field in the Item Branch table (F4102).

mnLeadTimePerUnitLTPUMATH_NUMERICNONENONE

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 
this value manually or you can have the system calculate it when you run the Leadtime Rollup program. The system overwrites this value 
when you run the Leadtime Rollup program. The system uses this field to calculate start dates for work orders when you use variable leadtimes.

cParentStockingTypeSTKTcharNONENONE

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 
types are hard-coded and you should not change them:    0   Phantom item    B Bulk floor stock    C Configured item    E Emergency/corrective 
maintenance    F Feature    K Kit parent item    N Nonstock  The first character of Description 2 in the user defined code table indicates if the item 
is purchased (P) or manufactured (M).

mnParentSetupLaborSETLMATH_NUMERICNONENONE

The standard setup hours that you expect to incur in the normal completion of this item. This value is not affected by crew size.

mnParentQueueTimeQUEDMATH_NUMERICNONENONE

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 
the Item Branch table (F4102). You can calculate this value using the Leadtime Rollup program or you can enter it manually. When you run the 
Leadtime Rollup program, the system overrides manual entries and populates the table with calculated values.

mnParentTimeBasisRateRATEMATH_NUMERICNONENONE

A code used to define rate information in the General Rate/Message Records table (F00191).

cShrinkFactorSRKFcharNONENONE

A value that determines whether the shrink factor you enter for this item is a percentage or a fixed quantity. Valid values are:    %   
Percentage of order or requested quantity    F Fixed amount to be added to quantity 

mnShrinkageSRNKMATH_NUMERICNONENONE

A fixed quantity or percentage that the system uses to determine inventory shrinkage for an item. The system increases the planned order 
quantity by this amount in MPS/MRP/DRP generation. The shrink factor method you specify for the item determines whether the shrink factor 
is a percentage or a fixed quantity. If you are entering a percentage, enter 5% as 5.00 and 50% as 50.00.

nMfgSafetyLeadTimeINT02integerNONENONE

Number of Days in the Past to Query for Quote Requests Received. 

nPurSafetyLeadTimeINT03integerNONENONE

Event point for Integer.

cSuppressErrorMessageEV02charNONENONE

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

cProcessFlagEV01charNONENONE

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

mnUniqueIDUKIDMATH_NUMERICNONENONE

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

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.

cStockNonStockFlagSNScharNONENONE

A code that determines whether the system performs rounding for planning purposes. Valid values are:    R Round either up or down to the 
nearest whole number.    U Round up to the nearest whole number.    Blank Do not round. Example of value R: If the calculated requirements for 
an item are 4.6, the system rounds the quantity required to 5.0. If the calculated requirements are 4.4, the system rounds the quantity required 
to 4.0. Example of value U: If the calculated requirements for an item are greater than 4.0 and less than or equal to 5.0, the system rounds the 
quantity required to 5.0.

mnF3411UniqueIDUKIDMATH_NUMERICNONENONE

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

cDateErrorFlagEV01charNONENONE

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

szDateErrorMsgDescDSC1charNONENONE

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

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.

mnWorkHoursWRHRMATH_NUMERICNONENONE

The number of work hours that the manufacturing plant operates per day.

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.

cActualStockingTypeSTKTcharNONENONE

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 
types are hard-coded and you should not change them:    0   Phantom item    B Bulk floor stock    C Configured item    E Emergency/corrective 
maintenance    F Feature    K Kit parent item    N Nonstock  The first character of Description 2 in the user defined code table indicates if the item 
is purchased (P) or manufactured (M).

cConsolidationMethodEV01charNONENONE

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

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.

szJobNumberJOBcharNONENONE

Job Number

mnUniqueKeyIDOffsetMATH01MATH_NUMERICOPTNONE

- - - Good Performance Low Value. 

Related Functions

B3400540 MRP, Calculate Schedule Dates for Planning
B3401530 Cache, Process MRP Bill of Material
B4000520 Get Item UoM Conversion Factor

Related Tables

F3002 Bill of Material Master File
F3412 MPS/MRP/DRP Lower Level Requirements File
F4101 Item Master
F4102 Item Branch File