1.Functional Description
1.1Purpose
This function will perform Get, Add, Update, Delete, Delete All, Get Next, Add/Update, and Terminate 
functions on the Detail Forecast Cache used in the Forecast Revisions application (P3460).
The calling application is responsible for loading all appropriate key values to the data structure 
and identifying the number of keys to use in retrieval/update processes.
1.2 Setup Notes and Prerequisites
 Cache Action Codes
 '2' Add - add a cache element.
 '3' Update - update a cache element.
 '4' Delete - delete a cache element.
 '5' Delete All - delete all cache elements. 
 '6' Get Next - retrieve the next cache element
 '7' Add/Update - will add if element does not exist, will change if it does exist.
 '8' Terminate - terminate cache
 Number of Keys 
key values for a Get, Update, Delete, Get Next, and Add/Update.
 A zero may be passed to retrieve, update, or delete the first record.
and SequentialFetch = '1'.  This allows the calling application to use GET NEXT to fetch elements 
from the cache sequentially.  If GET NEXT is used until the end of the keyed cache dataset is found, the 
function automatically closes the open cursor.
1.3Special Logic
This function creates a unique cache for each .
2.Technical Specifications
Cache Layout:Cache includes all of the following fields; key fields are noted.
Data Item Data Structure DescriptionKey Field
ITMShort Item NumberY
MCUBranchY
TYPFForecast TypeY
DRQJDateY
AN8Address NumberY
LITMSecond Item Number
AITMThird Item Number
FQTForecast Quantity
FAMForecast Quantity
DCTOOrder Type
BPFCBypass Forcing
I.Perform setup functions 
B.If not successful, set error "032E", set Cache Error Code = '3', and return failure.
C.Validate input parameters Number Of Keys and Action Code.
D.If not valid, set error "032E", set Cache Error Code = '2', and return failure.
E.Set Cache Error Code = '0'
F.Set return code to success.
II.Processing Based on Mode.
2.Retrieve the first element on the cache matching the key values passed as input.  If the 
input Number of Keys is zero, fetch the first element in the cache.
3.Load the values from the retrieved element into the data structure to be passed back to 
the calling program.
4.If SequentialFetch = '1', return cursor pointer to calling application.  Otherwise, close 
the cursor.
5.If get fails set Cache Error Code = '6'.
2.If add fails set error "032E", set Cache Error Code = '4', and return failure.
2.If update fails set error "032E", set Cache Error Code = '4', and return failure.
passed as input.
2.If the number of keys is 0, delete the first cache element.
3.If delete fails, set Cache Error Code = '5'.
E.If Cache Action Code is '5' - DELETE ALL:
2.If delete fails, set Cache Error Code = '5'.
the cache matching the key values passed as input.  If the Number of Keys is zero then fetch 
the next record without using any key.
2.Load the values from the retrieved element into the data structure to be passed back to 
the calling program.
3.If there are no more elements, close the cursor and set Cache Error Code = '1'.
G.If Cache Action Code is '7' - ADD/UPDATE:
2.Insert a new cache element with values from data structure.
3.If add fails set error "032E", set Cache Error Code = '4', and return failure.
D3401330 - Cache, Process F3460 Forecast Records
Data Item Data Structure DescriptionI/ORequiredNotes
ITM            Short Item Number                  I/OY      key value
MCU             Branch                        I/OY      key value
TYPF            Forecast Type                  I/OY       key value
DRQJ            Requested Date                  I/OY      key value
AN8            Customer Number                  I/OY      key value
LITM            Second Item Number            I/OY
AITM            Third Item Number                  I/OY
FQT            Forecast Quantity                  I/OY
FAM             Forecast Amount                  I/OY
DCTO            Order Type                        I/OY
BPFC            Bypass Forcing                  I/OY
EV01            Cache Action Code                  IY      '1' = Get cache element 
                                                                        '2' = Add element  
                                                                        '3' = Update element  
                                                                        '4' = Delete cache elements  
                                                                        '5' = Delete All cache 
elements 
                                                                        '6' = Get Next cache element 
                                                                        '7'  = Add/Update cache 
element 
                                                                        '8' = End cache (terminate 
cache) 
EV01            Cache Error Code                  ON      '0' = Success Process 
                                                                        '1' = Reached End of 
Cache(mode 6) 
                                                                        '2' = Invalid Input Parameter 
                                                                        '3' = Failed to Create Cache 
                                                                        '4' = Failed to Add/Update 
Cache 
                                                                        '5' = Failed to Delete Cache 
                                                                        '6' = Fetch Failed(mode 1 or 
9)
INT01            Number of Keys                  IY      Number of Keys to be used in 
the 
                                                                        cache process.
SUPPS            Suppress Error Message            IN      '0'= allow runtime error 
message 
                                                                             handling. 
                                                                        '1' = Suppress runtime error 
message 
                                                                              handling.
DTAI            Error Message Id                  ON      " " = Success 
                                                                        "032E" = Error Processing 
Cache
GENLNG      Cache Cursor Ptr                  I/ON
EV02            Sequential Fetch                  IN      If action is GET and this 
parm is 
                                                                        '1', function will pass back 
cursor 
                                                                        pointer for GET NEXT 
operation.
^
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| szJobNumber | JOB | char | NONE | NONE | 
Job Number  | ||||
| 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 
  | ||||
| jdRequestedDate | DRQJ | JDEDATE | NONE | NONE | 
The date that an item is scheduled to arrive or that an action is scheduled for completion.  | ||||
| mnCustomerNumber | 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 
  | ||||
| szSecondItemNumber | LITM | char | NONE | NONE | 
A number that identifies the item. The system provides three separate item numbers plus an extensive cross-reference capability to 
  | ||||
| szThirdItemNumber | AITM | char | NONE | NONE | 
The system provides three separate item numbers plus an extensive cross-reference capability to alternate item numbers. These item 
  | ||||
| mnForecastQuantity | FQT | MATH_NUMERIC | NONE | NONE | 
The quantity of units forecasted for production during a planning period.  | ||||
| mnForecastAmount | FAM | MATH_NUMERIC | NONE | NONE | 
The current amount of the forecasted units for a planning period.  | ||||
| szOrderType | DCTO | char | NONE | NONE | 
A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
  | ||||
| cBypassForcing | BPFC | char | NONE | NONE | 
A code that indicates whether to bypass the Forecast Forcing program (R34610). A Y indicates that the quantity and amount of a forecast 
  | ||||
| cCacheActionCode | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| cCacheErrorCode | EV01 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| nNumberOfKeys | INT01 | integer | NONE | NONE | 
Number of Days in Future to Query for Responses Due.  | ||||
| cSuppressErrorMessage | SUPPS | char | NONE | NONE | 
A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.
       0 = allow 
  | ||||
| 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 
  | ||||
| idCacheCursorPtr | GENLNG | ID | NONE | NONE | 
General purpose ID variable.  | ||||
| cSequentialFetch | EV02 | char | NONE | NONE | 
An option that specifies the type of processing for an event.  | ||||
| None | 
| None |