CalculateEOQandROP

Calculate EOQ and ROP

Major Business Rule

Object Name: B4001120

Parent DLL: CDIST

Location: Client/Server

Language: C

Functional Description

Purpose

This business function calculates the Economic Order Quantity(EOQ), Suggested Order Quantity, Lead 

Time days and months available for an item.


Setup Notes and Prerequisites

The following need to have been retrieved using the appropriate business function before calling this 

function:



-QuantityAvailable(Use CalculateQuantityAvailable shell)

-AverageCost (Use GetItemCost business function)

-LeadTimeDays (Use GetSupplierItemColumns)

-SafetyStock (from the item balance)

-MaximumOrderQuantity (from the item balance)

-MinimumOrderQuantity (from the item balance)


NOTE:  This business function is called from an application (POGENERATOR)that browses the Item 

Balance file.  It does not therefore fetch the reorder point information from the Item Balance.  This 

information must be retrieved separately if calling this function from elsewhere.



Data Structure

D4001120 - Calculate EOQ and ROP

Parameter NameData ItemData TypeReq/OptI/O/Both
szBranchPlantMCUcharNONENONE

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.

idPointerToF41001DSGENLNGIDNONENONE

Special Input Expected
If NULL, GetBranchConstants will be performed.  The pointer will not be passed out.  It will be freed 

at the end of the function.



^

mnItemNumberITMMATH_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

mnQuantityAvailableQAVALMATH_NUMERICNONENONE

A number that indicates the quantity that is available. For example, the available quantity might consist of the on-hand quantity minus 
commitments, reservations, and backorders.  Availability is user defined. You can set up availability in the Branch/Plant Constants program (P41001).  

mnLeadTimeDaysALTDMATH_NUMERICNONENONE

The average number of days from the date of the purchase order to the date that you receive the item. The system calculates leadtime 
after it meets the leadtime quantity percentage during receipt entry or during receipt routing. You define the leadtime quantity percentage on the 
Supplier/Item Relationships form (V43090).

mnSafetyStockSAFEMATH_NUMERICNONENONE

The quantity of stock kept on hand to cover high-side variations in demand.

mnMaximumOrderQuantityRQMXMATH_NUMERICNONENONE

The maximum order quantity for an item. You can base the quantity on factors other than usage, such as perishability, storage capacity, 
and so forth.

mnEconomicOrderQuantityEOQMATH_NUMERICNONENONE

Special Input Expected
If set in the Item Branch (ROQI), this gets sent into the business function.


^

mnReorderPointROPIMATH_NUMERICNONENONE

A quantity for an item that specifies when replenishment occurs. Typically,this occurs when the total quantity on hand plus the quantity on 
order fall to, or below a specified quantity. You can enter this quantity or the system can calculate it if there is sufficient sales history.

mnAverageCostUNCSMATH_NUMERICNONENONE

The amount per unit, derived by dividing the total cost by the unit quantity.

mnSuggestedOrderQuantitySOQMATH_NUMERICNONENONE

A value that is calculated by the P.O. Generator, Buyer's Inquiry, and Buying Guide Report with the following variables:    AVAL   Available 
inventory, as calculated from on-hand quantity less committed quantity plus quantity on PO including quantity in receipt routing.    ROP    
Reorder point, taken from ROP entered in the branch inventory record of the primary storage location, if not blank; or the ROP as calculated (see 
the definition of ROPC for more information). The system calculates Reorder Point as follows:            ROP = (((Annual Sales x Lead Time Days) / 
Number of Days in Year) +  Safety Stock)           If Safety Stock is not stated on the Quantities form, then the system will use the following 
formula:           ROP = ((Annual Sales x Lead Time Days) / Number of Days in Year) + square root of ((Annual Sales x Lead Time Days) / Number of 
Days in Year)    EOQ    Economic order quantity (or re-order quantity ROQ), taken from the ROQ entered in the branch inventory record of the 
primary storage location, if not blank; or the calculated EOQ (see the definition of EOQ for more information). The system calculates 
Economic Order Quantity as follows:           EOQ = Square root of ((2 x Purchase Order Issue Cost x Annual Sales) / (Inventory Carrying Cost x 
Average Cost) Calculation is either:        1- If AVAL > ROP, then SOQ = Zero        2- If AVAL = ROP, then SOQ = EOQ        3- If AVAL < ROP, then SOQ = 
EOQ + (ROP - AVAL)

mnMonthsAvailableMAVLMATH_NUMERICNONENONE

Given the usage in prior months, this is the estimated number of months the currently available quantity of the item might be expected to last.

mnMinimumOrderQuantityRQMNMATH_NUMERICNONENONE

The minimum order quantity for an item. You can base the quantity on factors other than usage, such as perishability, storage capacity, and 
so forth.

cOrderPolicyCodeOPCcharNONENONE

A code that specifies the rules for inventory reordering in the Requirements Planning and Procurement systems. Valid values are: 0 Reorder 
point (Not planned by MPS/MRP/DRP) 1    Lot-for-lot or as required 2    Fixed order quantity 3 Economic order quantity (EOQ) 4 Periods of 
supply 5 Rate scheduled item Note: These values are hard-coded.

mnFixedOrderQuantityOPVMATH_NUMERICNONENONE

Special Input Expected

Quantity to order if the Order Policy Code is set to '2' for fixed quantity.


^

cConversionFlagEV01charNONENONE

Special Input Expected
0-No 

1-Yes

^

mnConversionFactorCONVMATH_NUMERICNONENONE

Special Input Expected

If the flag is '1' there MUST be a conversion factor.  Otherwise, it returns '0'.


^

mnBusinessDaysPerYearBSDYMATH_NUMERICNONENONE

Special Input Expected

Returns the amount in field CIBSDY from F41001, if blank returns "365".


^

Related Functions

B0000130 Retrieve Company From Business Unit
B0900242 Retrieve Companys Current Date
B4000150 Get Branch Constants
X0903 Fiscal Date Edits +
XF4115 Update Item Sales HIstory

Related Tables

None