ForecastUpdateRecords

Forecast Update Records

Major Business Rule

Object Name: B3400660

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function will update either the Detail Forecast or the Summary Forecast records from the 54 
period buckets passed in.


1.2Setup Notes and Prerequisites


1.3 Special Logic

2.Technical Specifications
1.Move the 54 Periods passed in to an array @P
2.Move the dates from PntrToDates to an array @D

3.Move 1 to X

If MonthlyVsWeekly is not equal to '1'

Move 14 to $Y

Else

Move 54 to $Y

End

Move BeginDate to PreviousDate

Do $Y times

If DetailRecord is not equal to '1'

Fetch the F3400 record with the keys passed in and the SGDRQJ between PreviousDate and @D,X

If the record was found

If AmountQuantity equals '1'

Move @P,X to SGFQT

Adjust SGFAM by the ratio between the original qty and amt

If SGRVIS equals '1' or '3'

Move a '3' to the Revision Flag

Else

Move a '2' to the Revision Flag

End

Else

Move @P,X toSGFAM

Adjust SGFQT by the ratio between the original qty and amt

If SGRVIS equals '2' or '3'

Move a '3' to the Revision Flag

Else

Move a '1' to the Revision Flag

End

End

Update the Audit Info

Update the F3400 record

Else

Move a '1' to Error Flag

Set an error on the Period field corresponding to @P,X

End

Else

Fetch to the F3460 record with the Item, Branch, Type, Address, and MFDRQJ between 

PreviousDate and @D,X

If the record was found

If AmountQuantity equals '1'

Subtract MFFQT from @P,X to get SummaryQty

Move @P,X to MFFQT

Adjust MFFAM by the ratio between the original qty and amt

If MFRVIS equals '1' or '3'

Move a '3' to the Revision Flag

Else

Move a '2' to the Revision Flag

End

Else

Subtract MFFAM from @P,X to get SummaryAmt

Move @P,X toMFFAM

Adjust MFFQT by the ratio between the original qty and amt

If MFRVIS equals '2' or '3'

Move a '3' to the Revision Flag

Else

Move a '1' to the Revision Flag

End

End

Update the Audit Info

Update the F3460 record

Else

If @P,X is not blanks

If AmountQuantity equals '1'

Move @P,X to SummaryQty

Else

Move @P,X to SummaryAmt

End

Fetch to the Item Master F4101 by Short Item to retrieve the 

Second and Third Item Numbers

Call WriteDetailForecastRecords B3400770

End
End
Fetch to the Item Master F4101 by Short Item to retrieve the Second and 

Third Item Numbers


Move @D,X to PreviousDate
End

Add 1 to X

EndDo




^

Data Structure

D3400660 - Forecast Update Records

Parameter NameData ItemData TypeReq/OptI/O/Both
szSummaryCodeKVERcharNONENONE

A user defined code (40/KY) that indicates the type of summary forecast.

szForecastTypeTYPFcharNONENONE

A user defined code (34/DF) that indicates one of the following:     o The forecasting method used to calculate the numbers displayed about 
the item     o The actual historical information about the item 

szCompanyCOcharNONENONE

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

szCategoryCode01KV01charNONENONE

The first key postion of the forecasting hierarchy.  The value in this field relates to the first level chosen in the forecasting constants.

szCategoryCode02KV02charNONENONE

The second key postion of the forecasting hierarchy.  The value in this field relates to the second level chosen in the forecasting constants.

szCategoryCode03KV03charNONENONE

The third key postion of the forecasting hierarchy.  The value in this field relates to the third level chosen in the forecasting constants.

szCategoryCode04KV04charNONENONE

The forth key postion of the forecasting hierarchy.  The value in this field relates to the fourth level chosen in the forecasting constants.

szCategoryCode05KV05charNONENONE

The fifth key postion of the forecasting hierarchy.  The value in this field relates to the fifth level chosen in the forecasting constants.

szCategoryCode06KV06charNONENONE

The sixth key postion of the forecasting hierarchy.  The value in this field relates to the sixth level chosen in the forecasting constants.

szCategoryCode07KV07charNONENONE

The seventh key postion of the forecasting hierarchy.  The value in this field relates to the seventh level chosen in the forecasting constants.

szCategoryCode08KV08charNONENONE

The eighth key postion of the forecasting hierarchy.  The value in this field relates to the eighth level chosen in the forecasting constants.

szCategoryCode09KV09charNONENONE

The ninth key postion of the forecasting hierarchy.  The value in this field relates to the ninth level chosen in the forecasting constants.

szCategoryCode10KV10charNONENONE

The tenth key postion of the forecasting hierarchy.  The value in this field relates to the tenth level chosen in the forecasting constants.

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

mnAddressNumberAN8MATH_NUMERICNONENONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

szBranchMCUcharNONENONE

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.

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.

cDetailRecordEV01charNONENONE

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

szPeriod1TQ01charNONENONE

Time Series Column 01. This column will hold Time Series Dates or Quantities.

szPeriod2TQ02charNONENONE

Time Series Column 02. This column will hold Time Series Dates or Quantities.

szPeriod3TQ03charNONENONE

Time Series Column 03. This column will hold Time Series Dates or Quantities.

szPeriod4TQ04charNONENONE

Time Series Column 04. This column will hold Time Series Dates or Quantities.

szPeriod5TQ05charNONENONE

Time Series Column 05. This column will hold Time Series Dates or Quantities.

szPeriod6TQ06charNONENONE

Time Series Column 06. This column will hold Time Series Dates or Quantities.

szPeriod7TQ07charNONENONE

Time Series Column 07. This column will hold Time Series Dates or Quantities.

szPeriod8TQ08charNONENONE

Time Series Column 08. This column will hold Time Series Dates or Quantities.

szPeriod9TQ09charNONENONE

Time Series Column 09. This column will hold Time Series Dates or Quantities.

szPeriod10TQ10charNONENONE

Time Series Column 10. This column will hold Time Series Dates or Quantities.

szPeriod11TQ11charNONENONE

Time Series Column 11. This column will hold Time Series Dates or Quantities.

szPeriod12TQ12charNONENONE

Time Series Column 12. This column will hold Time Series Dates or Quantities.

szPeriod13TQ13charNONENONE

Time Series Column 13. This column will hold Time Series Dates or Quantities.

szPeriod14TQ14charNONENONE

Time Series Column 14. This column will hold Time Series Dates or Quantities.

szPeriod15TQ15charNONENONE

Time Series Column 15. This column will hold Time Series Dates or Quantities.

szPeriod16TQ16charNONENONE

Time Series Column 16. This column will hold Time Series Dates or Quantities.

szPeriod17TQ17charNONENONE

Time Series Column 17. This column will hold Time Series Dates or Quantities.

szPeriod18TQ18charNONENONE

Time Series Column 18. This column will hold Time Series Dates or Quantities.

szPeriod19TQ19charNONENONE

Time Series Column 19. This column will hold Time Series Dates or Quantities.

szPeriod20TQ20charNONENONE

Time Series Column 20. This column will hold Time Series Dates or Quantities.

szPeriod21TQ21charNONENONE

Time Series Column 21. This column will hold Time Series Dates or Quantities.

szPeriod22TQ22charNONENONE

Time Series Column 22. This column will hold Time Series Dates or Quantities.

szPeriod23TQ23charNONENONE

Time Series Column 23. This column will hold Time Series Dates or Quantities.

szPeriod24TQ24charNONENONE

Time Series Column 24. This column will hold Time Series Dates or Quantities.

szPeriod25TQ25charNONENONE

Time Series Column 25. This column will hold Time Series Dates or Quantities.

szPeriod26TQ26charNONENONE

Time Series Column 26. This column will hold Time Series Dates or Quantities.

szPeriod27TQ27charNONENONE

Time Series Column 27. This column will hold Time Series Dates or Quantities.

szPeriod28TQ28charNONENONE

Time Series Column 28. This column will hold Time Series Dates or Quantities.

szPeriod29TQ29charNONENONE

Time Series Column 29. This column will hold Time Series Dates or Quantities.

szPeriod30TQ30charNONENONE

Time Series Column 30. This column will hold Time Series Dates or Quantities.

szPeriod31TQ31charNONENONE

Time Series Column 31. This column will hold Time Series Dates or Quantities.

szPeriod32TQ32charNONENONE

Time Series Column 32. This column will hold Time Series Dates or Quantities.

szPeriod33TQ33charNONENONE

Time Series Column 33. This column will hold Time Series Dates or Quantities.

szPeriod34TQ34charNONENONE

Time Series Column 34. This column will hold Time Series Dates or Quantities.

szPeriod35TQ35charNONENONE

Time Series Column 35. This column will hold Time Series Dates or Quantities.

szPeriod36TQ36charNONENONE

Time Series Column 36. This column will hold Time Series Dates or Quantities.

szPeriod37TQ37charNONENONE

Time Series Column 37. This column will hold Time Series Dates or Quantities.

szPeriod38TQ38charNONENONE

Time Series Column 38. This column will hold Time Series Dates or Quantities.

szPeriod39TQ39charNONENONE

Time Series Column 39. This column will hold Time Series Dates or Quantities.

szPeriod40TQ40charNONENONE

Time Series Column 40. This column will hold Time Series Dates or Quantities.

szPeriod41TQ41charNONENONE

Time Series Column 41. This column will hold Time Series Dates or Quantities.

szPeriod42TQ42charNONENONE

Time Series Column 42. This column will hold Time Series Dates or Quantities.

szPeriod43TQ43charNONENONE

Time Series Column 43. This column will hold Time Series Dates or Quantities.

szPeriod44TQ44charNONENONE

Time Series Column 44. This column will hold Time Series Dates or Quantities.

szPeriod45TQ45charNONENONE

Time Series Column 45. This column will hold Time Series Dates or Quantities.

szPeriod46TQ46charNONENONE

Time Series Column 46. This column will hold Time Series Dates or Quantities.

szPeriod47TQ47charNONENONE

Time Series Column 47. This column will hold Time Series Dates or Quantities.

szPeriod48TQ48charNONENONE

Time Series Column 48. This column will hold Time Series Dates or Quantities.

szPeriod49TQ49charNONENONE

Time Series Column 49. This column will hold Time Series Dates or Quantities.

szPeriod50TQ50charNONENONE

Time Series Column 50. This column will hold Time Series Dates or Quantities.

szPeriod51TQ51charNONENONE

Time Series Column 51. This column will hold Time Series Dates or Quantities.

szPeriod52TQ52charNONENONE

Time Series Column 52. This column will hold Time Series Dates or Quantities.

szPeriod53TQ53charNONENONE

Time Series Column 53. This column will hold Time Series Dates or Quantities.

szPeriod54TQ54charNONENONE

Time Series Column 54. This column will hold Time Series Dates or Quantities.

cAmountQuantityEV01charNONENONE

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

idPtrToDatesGENLNGIDNONENONE

General purpose ID variable.

cMonthlyVsWeeklyEV01charNONENONE

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

cErrorFlagEV01charNONENONE

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

jdBeginDateDRQJJDEDATENONENONE

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

Related Functions

B3400770 Write Detail Forecast Records
B9800100 Get Audit Information

Related Tables

F3400 Forecast Summary File
F3460 Forecast File
F4101 Item Master