CalculateTotalForecasteAmount

Calculate Total Forecast Amount

Major Business Rule

Object Name: B4100760

Parent DLL: COPBASE

Location: Client/Server

Language: C

Functional Description

Purpose
Retrieve all records from MPS/MPR/DRP Summary File (F3413) for Short Item Number and Branch/Plant 
passed in.  Accumulate the Total Forecasting Amount for each record found if the F3413 Start Date is 

within the range of From and Thru Date passed in and the F3413 Quantity Type is a valid UDC code.


Setup Notes and Prerequisites

None

Special Logic

None

Technical Specifications

This function first sets the keys to retrieve F3413
Default Index to  1


Keys = 1:  ITM

Keys = 2:  ITM, MCU

Keys = 3:  ITM, MCU, QT

Keys = 4:  ITM, MCU, QT, STRT (FromDate)


Next, it retrieves all records for Short Item Number and Branch/Plant passed in.

It verifies the UDC for Quantity Type (MRQT) using GetUDC. Then, calculates the

following:


If  ( FromDate <= F3413::MRSTRT   AND   F3413::MRSTRT <= ThruDate )


     TotalPrice = TotalPrice + ( MRTRQT * UnitPrice )

     TotalCost  = TotalCost  + ( MRTRQT * UnitCost  )


After all records read it calculates: TotalForecasteAmount =  TotalPrice - TotalCost 


^

Data Structure

D4100760 - Calculate Total Forecaste Amount

Data Item Data Structure DescriptionI/ORequired

MCU        BranchPlant             I   Y

ITM        ShortItemNumber             I       Y

UNPR        UnitPrice                   I   N

UNCS        UnitCost                   I   N

TRDJ        FromDate                   I   Y

TRDJ        ThruDate                   I   Y

CUMA        TotalForecasteAmount       I       N

EV01        SuppressErrorMessage       I    N

DTAI        ErrorMessageID             O

CDL        Index                   I   Y

CDL        Keys                   I   Y

QT        Quantity Type             I   N


^

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.

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

mnUnitPriceUNPRMATH_NUMERICNONENONE

Retrieve this from F4106.  If 0, only TotalUnitPrice will be  returned.ab 

^

mnUnitCostUNCSMATH_NUMERICNONENONE

Retrieve this from F4105.  If 0, only TotalUnitCost will  returned.ab 

^

jdFromDateTRDJJDEDATENONENONE

If Keys is set to 4, FromDate is used as part of the  key.ab 

^

jdThruDateTRDJJDEDATENONENONE

The date that an order was entered into the system. This date determines which effective level the system uses for inventory pricing.

mnTotalForecasteAmountCUMAMATH_NUMERICNONENONE

The total amount of all transactions in the Item Ledger for an Item.

cSuppressErrorMessageEV01charNONENONE

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

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.

mnIndexCDLMATH_NUMERICNONENONE

Currently defaulted to  1ab 

^

mnKeysCDLMATH_NUMERICNONENONE

Defaulted to  4ab 
^

szQuantityTypeQTcharNONENONE

This code is used to distinguish different quantities generated in the MPS/MRP system.

Related Functions

X0005 Get User Defined Codes

Related Tables

F3413 MPS/MRP/DRP Summary File