1.Functional Description
1.1Purpose
This function will retieve the levels of forecasting data for display.
1.2Setup Notes and Prerequisites
1.3Special Logic
2.Technical Specifications
1.If Get Next Record is equal to 1 skip to step 16
2.If the MasterLinkList is not empty
Skip to step number 15
Else
Will need a MasterLinkList with the following:
Company, Category Codes 1-10, Address Number, Item Number, Branch,
ActualOrgQty, ActualOrgAmt, ForecastOrgQty, ForecastOrgAmt, ActualAdjQty,
ActualAdjAmt, ForecastAdjuQty, ForecastAdjAmt, PntrToChildren
Will also need for every record in the MasterLinkList a Link List that stores the children
associated with it (ChildLinkList)
ChildKey, ForecastType
End
3.Retrieve the Summary Constants for the Summary Code
4.Add up how many levels in the hierarchy there are
Find the highest level in the category code key positions
If there is a value in the Customer Level
Add one to the highest level of the category code key positions
End
If Global is set to Y
Add one to the value
End
If Company is set to Y
Add one to the value
End
If Item Number is set
Add one to the value
End
5.Based on the Summary Constants determine the top level of the hierarchy
If Global is equal to Y
Should be able to retrieve the records with all category code positions equal to blank,the
address number equal to zeros, zeros in item number and the company equal to zero.
Else If the Company is equal to Y
Should be able to retrieve the records with all category code positions equal to
blank,the address number equal to zeros, zeros in item number and the company NOT equal to zero
Else If Customer Level is equal to 01
Should be able to retrieve the records with all category code
positions equal to blank,the address number NOT equal to zeros, zeros
in item number and the company equal to zero.
Else If one of the category codes is position 01
retreive the records that have that code NOT equal to blanks, a zero in address
number,zeros in item number, zeros in company and all other category codes equal to zeros
Else If Item Number Level is equal to Y
Should be able to retrieve the records with all category code positions equal to blank,the
address number equal to zeros, the item number NOT equal to zeros and the company equal to zero.
End
End
End
End
End
6.Read all records in the F3400 equal to the key for that top level that have a requested date
greater than or equal to the From Date and less than or equal to the Thru Date using the Actual Type. (
If the dates are passed in blank read all records)
If no records are found
Skip to Number 10.
End
7.Add/Update a Record to the Master Link List for the full key off the record, with the Adjusted
and Original Quantity in the ActualOrgQty and ActualAdjQty and the Adjusted and Original Amounts in
the AcutalOrgAmt and ActualAdjAmt for every record found in the date sequence
8.Write the Child Number off the record just read to the ChildLinkList along with the Actual Type
(Store the pointer to the ChildLinkList on the MasterLinkList record)
9.If any one of the records found has the revised flag set
Move a Y to ActualRevised
End
10.Read the Summary Forecast file with the full key off the record just found for the Actual type (if
no record was found for the Actual Type use the top level key that the first read with the actual
type was with) but with the ForecastType
If no records found and no Actual Type recrods were found either move 1838 to Error and end
function
11.Add/Update the Record into the Master Link List with the full key, with the Adjusted and Original
Quantity in the ForecastOrgQty and ForecastAdjQty and the Adjusted and Original Amounts in the
ForecastOrgAmt and ForecastAdjAmt for every record found in the date sequence
12.Write the Child Number off the record just read to the ChildLinkList along with the
ForecastType(The pointer to the ChildLinkList should be on the MasterLinkList record if the Actual Type created the
record else will need to create it here and store it on the MasterLinkList record)
13.If any one of the records found has the revised flag set Move a Y to ForecastRevised
14.Skip to Step Number 16
15.Get the record for the full key passed in from the MasterLinkList
Using the PntrToChildren off the MasterLinkList record just found read the ChildLinkList. For
each child, forecast type combination in the link list fetch to the F3400 with the child number in the
parent number field.
If no record was found
Read the work file F34006 with the ChildKey out of the list and the summary code
For each record found fetch to the Detail Forecast File F3460 with the
branch and item number from the work file
Use these records to accumulate the quantity and amounts
Create records in the MasterLinkList (These records will have no children records)
If any one of the records found has the revised flag set Move a Y to ActualRevised or
ForecastRevised based on the type
Move a '1' to DetailRecords
Else
Add/Update the Record to the Master Link List the full key, with the Adjusted
and Original Quantity in the ActualOrgQty and ActualAdjQty if the type is the Actual Type Else
put them in the ForecastOrgQty and castAdjQty. Put the Adjusted and Original Amounts in the
AcutalOrgAmt and ActualAdjAmt if the type is the Actual Type Else put them in the
ForecastOrgAmt and ForecastAdjAmt
Write the Child Number off each record read into a ChildLinkList along
with the ActualType (Store the pointer to the ChildLinkList on the MasterLinkList
record)
If any one of the records found has the revised flag set Move a Y to
ActualRevised orForecastReviesed based on the type
End
After all child records have been written to the link list, Free the memory for the child list and
remove the parent record from the MasterLinkList
16.Return the records in the MasterLinkList.
*/ Return the first record for this key if NextRecord is equal to blanks else return the
following records*/
If there are no more records after this one
Return a '1' in NoMoreRecords.
Return the full key
*/ Load the Current Level */
If CurrentLevel is blank return a 1 in CurrentLevel else return CurrentLevel plus 1
*/ Load the LevelDescription and Value */
If this is the global level being returned move GlobalLevelText into LevelDescription and
GlobalValue
into the Value
If this is the company level being returned retrieve the description for the company
from the F0010 and return it in LevelDescription. Move the Company Number into
Value
If $CURLEVEL > the NumberOfLevels then we are returning a Branch value. Retrieve the description
from F0006 for the Branch value being returned.
If this is the item number level being returned retrieve the primary item number and description
from X4101. Move the description into LevelDescription. Move ShortItemNumber intoValue. Move the
primary item number into PrimaryItem
If not one of the above cases
Fetch the Summary Constants Record F4091 for the Summary Code
$CURLEVEL = CurrentLevel
If KFGLSM from Summary Constants = 'Y'
$CURLEVEL = $CURLEVEL - 1
End
If KFCOSM from Summary Constants = 'Y'
$CURLEVEL = $CURLEVEL - 1
End
If $CURLEVEL equals CustomerLevel off the constants record
Retrieve the description for the address from the F0101 and return it in
LevelDescription. Move the Address Book number into Value
If the address book number was not found move BlankValueText to Value and
move blanks to LevelDescription
Else
Place KC01-KC40 from the constants record in an list
If $CURLEVEL is less than the Customer Level
Look for $CURLEVEL in the list
Else
Look for $CURLEVEL minus one
End
Use the position of the CurrentLevel found in the list to create KCXX (where XX
is the position)
Retrieve the row description for the KCXX data item out of the dictionary and
return it in LevelDescription. Move the value of the Category Code into Value
If the Value of the Category Code is *Blanks move BlankValueText to Value
instead and move blanks to LevelDescription instead
End
*/ Load the PlusMinus field*/
If DetailRecord is not equal to 1
If this is the last level (If NumberOfLevels equals CurrentLevel)
Chain to the F34006 using the Child key off the record.
If a record is found use the data in it to chain to the F3460.
If a record is found
Move a '+' to PlusMinus.
Else
Move a '-' to PlusMinus
End
Else
Move '1' PlusMinus
End
Else
Move '+' PlusMinus
End
Else
Move '-' PlusMinus
End
^
D3401080 - F3400 Get Forecast Levels
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
szSummaryCode | KVER | char | NONE | NONE |
A user defined code (40/KY) that indicates the type of summary forecast. | ||||
jdFromDate | DRQJ | JDEDATE | NONE | NONE |
The date that an item is scheduled to arrive or that an action is scheduled for completion. | ||||
jdThruDate | DRQJ | JDEDATE | NONE | NONE |
The date that an item is scheduled to arrive or that an action is scheduled for completion. | ||||
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
| ||||
szActualType | 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
| ||||
szCompany | CO | char | NONE | NONE |
A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company
| ||||
szCatCode1 | KV01 | char | NONE | NONE |
The first key postion of the forecasting hierarchy. The value in this field relates to the first level chosen in the forecasting constants. | ||||
szCatCode2 | KV02 | char | NONE | NONE |
The second key postion of the forecasting hierarchy. The value in this field relates to the second level chosen in the forecasting constants. | ||||
szCatCode3 | KV03 | char | NONE | NONE |
The third key postion of the forecasting hierarchy. The value in this field relates to the third level chosen in the forecasting constants. | ||||
szCatCode4 | KV04 | char | NONE | NONE |
The forth key postion of the forecasting hierarchy. The value in this field relates to the fourth level chosen in the forecasting constants. | ||||
szCatCode5 | KV05 | char | NONE | NONE |
The fifth key postion of the forecasting hierarchy. The value in this field relates to the fifth level chosen in the forecasting constants. | ||||
szCatCode6 | KV06 | char | NONE | NONE |
The sixth key postion of the forecasting hierarchy. The value in this field relates to the sixth level chosen in the forecasting constants. | ||||
szCatCode7 | KV07 | char | NONE | NONE |
The seventh key postion of the forecasting hierarchy. The value in this field relates to the seventh level chosen in the forecasting constants. | ||||
szCatCode8 | KV08 | char | NONE | NONE |
The eighth key postion of the forecasting hierarchy. The value in this field relates to the eighth level chosen in the forecasting constants. | ||||
szCatCode9 | KV09 | char | NONE | NONE |
The ninth key postion of the forecasting hierarchy. The value in this field relates to the ninth level chosen in the forecasting constants. | ||||
szCatCode10 | KV10 | char | NONE | NONE |
The tenth key postion of the forecasting hierarchy. The value in this field relates to the tenth level chosen in the forecasting constants. | ||||
mnAddressNumber | AN8 | MATH_NUMERIC | NONE | NONE |
A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or
| ||||
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
| ||||
szGlobalLevelText | DL01 | char | NONE | NONE |
A user defined name or remark. | ||||
szGlobalValueText | KV01 | char | NONE | NONE |
The first key postion of the forecasting hierarchy. The value in this field relates to the first level chosen in the forecasting constants. | ||||
szBlankValueText | KV01 | char | NONE | NONE |
The first key postion of the forecasting hierarchy. The value in this field relates to the first level chosen in the forecasting constants. | ||||
mnActualOrgQty | UORG | MATH_NUMERIC | NONE | NONE |
The quantity of units affected by this transaction. | ||||
mnActualOrgAmt | AEXP | MATH_NUMERIC | NONE | NONE |
The number of units multiplied by the unit price. | ||||
mnForecastOrgQty | FQT | MATH_NUMERIC | NONE | NONE |
The quantity of units forecasted for production during a planning period. | ||||
mnForecastOrgAmt | FAM | MATH_NUMERIC | NONE | NONE |
The current amount of the forecasted units for a planning period. | ||||
mnActualAdjQty | UORG | MATH_NUMERIC | NONE | NONE |
The quantity of units affected by this transaction. | ||||
mnActualAdjAmt | AEXP | MATH_NUMERIC | NONE | NONE |
The number of units multiplied by the unit price. | ||||
mnForecastAdjQty | FQT | MATH_NUMERIC | NONE | NONE |
The quantity of units forecasted for production during a planning period. | ||||
mnForecastAdjAmt | FAM | MATH_NUMERIC | NONE | NONE |
The current amount of the forecasted units for a planning period. | ||||
mnNumberOfLevels | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
mnCurrentLevel | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
cPlusMinus | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
cActualRevised | RVIS | char | NONE | NONE |
A code indicating that the forecasted amount and/or quantity has been manually revised and that the revisions have not been forced to the
| ||||
cForecastRevised | RVIS | char | NONE | NONE |
A code indicating that the forecasted amount and/or quantity has been manually revised and that the revisions have not been forced to the
| ||||
cNoMoreRecords | EV02 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
szPrimaryItem | UITM | char | NONE | NONE |
A number that the system assigns to an item. It can be in short, long, or third item number format. | ||||
idMasterLinkedList | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
cDetailRecord | EV03 | char | NONE | NONE |
A radio button that specifies the level at which trace/track result is to be displayed. Select the Detail to display all transactions except IB, IX,
| ||||
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
| ||||
cGetNextRecord | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
szValue | KV11 | char | NONE | NONE |
The value for the current position of the forecast hierarchy. | ||||
szLevelDescription | DS01 | char | NONE | NONE |
A free-form, 80-character text field. |
X4101 Validate and Retrieve Item Master |
F0006 Business Unit Master | ||||
F0010 Company Constants | ||||
F0101 Address Book Master | ||||
F3400 Forecast Summary File | ||||
F34006 Forecast Summary Work File | ||||
F3460 Forecast File | ||||
F4091 Category Code Key Position File |