1.Functional Description
1.1Purpose
This function will perform Get, Add, Update, Delete, Delete All, Get Next, Add/Update, and Terminate
functions on the MRP Multi-Plants Cache used in the Multi-Plant MRP/MPS planning programs (R3483).
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 Standard
'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
'9' Close cursor and free data ptr
'E' Gets the number of elements matching the keys specified, Record Type and/or Branch.
'D' Debug Mode - Dumps the contents of the entire cache into a text file
key values for a Get, Update, Delete, Get Next, and Add/Update, as well as Mode '9'.
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 called until the end of the keyed cache dataset is found,
the function automatically closes the open cursor. Otherwise, the calling application is responsible
for closing the cursor
1.3Special Logic
This function creates a unique cache for each Multi-plant MRP/MPS planning process. The function
appends the input Job Number string to the two character ID 'MP' to build the cache name used for the
calling application.
2.Technical Specifications
Cache Layout:Cache includes all of the following fields; key fields are noted.
Data Item Data Structure DescriptionKey Field
EV01 Record Type Y
MCU Branch Y
INT01 Bucketless Dates
INT01 Bucket Dates
DATE01Start Date
DATE01End Date
DATE01First Date
DATE01Begin Date
DATE01Forecast Consumption Begin Date
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, Action Code, and Comparison Flag.
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.
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 (the cursor should have been set through a
previous "Get" action, i.e. action code '1'. 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.
2.Perform cleanup functions (Terminate cache).
3.Close Cursor
4.Remove Data Ptr and set Input CacheCursorPtr to 0.
specified.
D3500060 - Cache, Process Multi Plants
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
szJobNumber | JOB | char | NONE | NONE |
Job Number | ||||
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
| ||||
cRecordType | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
nNumberOfBucketlessDates | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
nNumberOfBucketDates | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
jdStartDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
jdEndDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
jdFirstDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
jdBeginDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
jdForecastConsumptionBeginDate | DATE01 | JDEDATE | NONE | NONE |
Event point for JDE Date. | ||||
nNumberOfElements | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
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
| ||||
idCacheCursorPointer | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
cSequentialFetch | EV02 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
jdFirstDateInCache | DATE01 | JDEDATE | OPT | NONE |
Event point for JDE Date. |
None |
None |