1.Functional Description
1.1Purpose
This function will read Detail Forecast records from F3460 and create Summary Forecasts from them in
F3400.
1.2Setup Notes and Prerequisites
1.3Special Logic
2.Technical Specifications
1.SETLL on the Detail Forecast File (F3460) with a key of Item, Branch, ForecastType and
BeginDate
Read all records equal to the key minus the date with MFYR = 0.
If the Requested Date off the record (MFDRQJ) is less than or equal to the EndDate
Call CreateSummaryForecasts (B3400790)
ShortItemNumberShortItemNumber
BranchBranch
ForecastTypeForecastType
MFUORGOriginalQuantity
MFAEXPOriginalAmount
MFFQTForecastQuantity
MFFAMForecastAmount
SoldTo MFAN8SoldTo
RequestedDate MFDRQJRequestedDate
RetrieveCatCodesRetrieveCatCodes
SummaryCodeSummaryCode
ProgramIDProgramID
LinkListPtrLinkListPtr
LinkListPtr = LinkListPtr from B3400790
End
2.FirstPassFlag = '1'
Create a linked list, CustomerList, which will contain elements with the following fields:
CustomerNumber
Total Original Qty
Total Original Amt
Total Adjusted Qty
Total Adjusted Amt
3.Select records from F3460 using the input Item, Branch, and Forecast Type where MFDRQJ >= input
BeginDate and MFDRQJ <= input EndDate.
4.While not EOF
Read the next F3460 record
If input FiscalDatePattern is not blank
If FirstPassFlag is '1'
FirstPassFlag = ' '
Call BuildDatePatternLinkList (B3400730) to build a linked list of the
monthly date patterns for the input FiscalDatePattern
MFDRQJBeginDate
' 'MonthlyVsWeekly
FiscalDatePatternDatePattern
ProgramIDProgramID
If DatePatternError is not ' '
Return an Error Code and exit the function
EndIf
Lookup MFDRQJ in the date pattern linked list. Set BucketDate equal to the date
from the list that is greater than or equal to MFDRQJ.
EndIf
If MFDRQJ is less than or equal to BucketDate
Look for an element in the CustomerList which contains MFAN8 as the
CustomerNumber.
If an element is found
Total Original Qty += MFUORG
Total Original Amt += MFAEXP
Total Adjusted Qty += MFFQT
Total Adjusted Amt += MFFAM
Else
Create a new CustomerList element with the values MFAN8, MFUORG,
MFAEXP, MFFQT, and MFFAM
EndIf
Else
For each element in the CustomerList
Call CreateSummaryForecasts (B3400790)
ShortItemNumberShortItemNumber
BranchBranch
ForecastTypeForecastType
Total Original QtyOriginalQuantity
Total Original AmtOriginalAmount
Total Adjusted QtyForecastQuantity
Total Adjusted AmtForecastAmount
CustomerNumberSoldTo
BucketDateRequestedDate
RetrieveCatCodesRetrieveCatCodes
SummaryCodeSummaryCode
ProgramIDProgramID
LinkListPtrLinkListPtr
LinkListPtr = LinkListPtr from B3400790
EndFor
Delete all elements from the CustomerList
Lookup MFDRQJ in the date pattern linked list. Set BucketDate equal to the date
from the list that is greater than or equal to MFDRQJ.
If a date is not found in the list, return an Error Code and exit the function.
Create a new CustomerList element with the values MFAN8, MFUORG,
MFAEXP, MFFQT, and MFFAM
End
Else
Call CreateSummaryForecasts (B3400790)
ShortItemNumberShortItemNumber
BranchBranch
ForecastTypeForecastType
MFUORGOriginalQuantity
MFAEXPOriginalAmount
MFFQTForecastQuantity
MFFAMForecastAmount
MFAN8SoldTo
RequestedDate MFDRQJRequestedDate
RetrieveCatCodesRetrieveCatCodes
SummaryCodeSummaryCode
ProgramIDProgramID
LinkListPtrLinkListPtr
LinkListPtr = LinkListPtr from B3400790
End
EndWhile
5.If input FiscalDatePattern is not blank
For each element in the CustomerList
Call CreateSummaryForecasts (B3400790)
ShortItemNumberShortItemNumber
BranchBranch
ForecastTypeForecastType
Total Original QtyOriginalQuantity
Total Original AmtOriginalAmount
Total Adjusted QtyForecastQuantity
Total Adjusted AmtForecastAmount
CustomerNumberSoldTo
BucketDateRequestedDate
RetrieveCatCodesRetrieveCatCodes
SummaryCodeSummaryCode
ProgramIDProgramID
LinkListPtrLinkListPtr
LinkListPtr = LinkListPtr from B3400790
EndFor
Destroy the CustomerList
Destroy the date pattern linked list
EndIf
^
D3400960 - Forecast Create Summary From Detail
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
| ||||
szForecastType | TYPF | char | NONE | NONE |
A user defined code (34/DF) that indicates one of the following:
o The forecasting method used to calculate the numbers displayed about
| ||||
jdBeginDate | DRQJ | JDEDATE | NONE | NONE |
The date that an item is scheduled to arrive or that an action is scheduled for completion. | ||||
jdEndDate | DRQJ | JDEDATE | NONE | NONE |
The date that an item is scheduled to arrive or that an action is scheduled for completion. | ||||
cRetrieveCatCodes | EV02 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
szSummaryCode | KVER | char | NONE | NONE |
A user defined code (40/KY) that indicates the type of summary forecast. | ||||
idLinkListPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
szProgramID | PID | char | NONE | NONE |
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry
| ||||
cFiscalDatePattern | DTPN | char | NONE | NONE |
A code that identifies date patterns. You can use one of 15 codes. You must set up special codes (letters A through N) for 4-4-5, 13-period
|
B3400730 Build Date Pattern Link List | ||||
B3400735 Destroy Date Pattern Link List | ||||
B3400790 Create Summary Forecasts |
F3460 Forecast File |