CacheProcessMRPInclusionRules

Cache, Process MRP Inclusion Rules

Minor Business Rule

Object Name: B3401300

Parent DLL: CMFG

Location: Client/Server

Language: C

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 Inclusion Rule Cache used in the MRP/MPS planning programs (P3482 and P3483).


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 Code
• 

'1' Get - retrieve the cache element.
• '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. Note: Currently this cache bsfn does not handle 
GETNEXT logic.

• '7' Add/Update - will add if element does not exist, will change if it does exist.
• '8' Terminate - terminate cache
• '9' Close Cursor = Note: Currently this cache bsfn does not handle GETNEXT logic.
• 'L' Load Cache - will load records into this cache given the Resource Version rules to use.
• 'D' Debug Mode - Dumps the contents of the entire cache into a text file

• Number of Keys 
• 
If the number of keys is passed as a parameter, the business function uses this value to setup 
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.

1.3Special Logic

This function creates a unique cache for each MRP/MPS planning process.  The function appends the 

input Job Number string to the two character ID 'IR' to build the cache name used for the calling 

application.


NOTE: Before using this function to verify existence of a inclusion status, you must pre-load the 

cache with all the included statuses for the given Resource Version Rule by calling this function in mode 

'9' and passing in the Resource Inclusion Version to use. You may only call this function in mode '9' 

ONCE.


2.Technical Specifications

Cache Layout:Cache includes all of the following fields; key fields are noted.


Data Item Data Structure DescriptionKey Field

DCTOOrder TypeY

LNTYLine TypeY

TRTYStatusY


I.Perform setup functions 

A.Initialize cache to get handle.
B.If not successful, set error "032E", set Cache Error Code = '3', and return failure.

C.Set Cache Error Code = '0'

D.Set return code to success.


II.Processing Based on Mode.


A.If Cache Action Code is '1' - GET:
1.Open cursor, Reset cursor.
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 get fails set Cache Error Code = '6'.


B.If Cache Action Code is '2' - ADD:
1.Insert a new cache element with values from data structure.
2.If add fails set error "032E", set Cache Error Code = '4', and return failure.


C.If Cache Action Code is '3' - UPDATE:
1.Update existing cache element with values from data structure.
2.If update fails set error "032E", set Cache Error Code = '4', and return failure.


D.If Cache Action Code is '4' - DELETE:
1.If the Number of Keys is not 0, delete all elements in the cache matching the key values 
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:

1.Delete all elements in the cache.
2.If delete fails, set Cache Error Code = '5'.


F.If Cache Action Code is '6' - GET NEXT:
1.Note: This function does not support GETNEXT functionality.

G.If Cache Action Code is '7' - ADD/UPDATE:

1.Delete Record , if one exists,  that matches the full key from Input.
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.


H.If Cache Action Code is '8' - END
1.Perform cleanup functions (Terminate cache).

I.If Cache Action Code is '9' - Close Cursor and Free Ptr
1.Since this function does not support the GETNEXT functionality, this action code will not 
be programmed into the business function.


J.If Cache Action Code is 'L' - LOAD
1.Perform Delete All action to clear the Inclusion Rule Cache of all elements.
2.Open F34004.

3.Select All Records Matching the Input Inclusion Version.

4.Read each record selected and add it to the Inclusion Rules cache.

5.If No Records were Loaded then Cache Error Code = '2'

6.Close F34004


K.If Cache Action Code is 'D' - DUMP
1.Dump the contents of the cache into a text file.

Data Structure

D3401300 - Cache, Process MRP Inclusion Rules


Data Item Data Structure DescriptionI/ORequiredNotes

JOB            Job Number                        IY      Job Number as string for 

cache name

DCTO            Order Type                        I/O      key value

LNTY            Line Type                        I/OY      key value

TRTY            Status                        I/OY      key value

MVER            Inclusion Version             IN      Required when Action Code = 

'L'.

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) 

                                                                        '9' = Close Cursor and Free 

Ptr 

                                                                        'L' = Load Cache By Reading 

                                                                              from F34004. 

                                                                        'D' = Dump cache into text 

file

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


^

Parameter NameData ItemData TypeReq/OptI/O/Both
szJobNumberJOBcharNONENONE

Job Number

szOrderTypeDCTOcharNONENONE

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 
reserved document type codes for vouchers, invoices, receipts, and time sheets, which create automatic offset entries during the post 
program. (These entries are not self-balancing when you originally enter them.) The following document types are defined by J.D. Edwards and 
should not be changed: P Accounts Payable documents   R Accounts Receivable documents   T Payroll documents   I Inventory documents  
O Purchase Order Processing documents   J General Accounting/Joint Interest Billing documents   S Sales Order Processing documents

szLineTypeLNTYcharNONENONE

A code that controls how the system processes lines on a transaction. It controls the systems with which the transaction interfaces, such as 
General Ledger, Job Cost, Accounts Payable, Accounts Receivable, and Inventory Management. It also specifies the conditions under 
which a line prints on reports, and it is included in calculations. Codes include the following: S Stock item   J Job cost   N Nonstock item   F Freight  
T Text information   M Miscellaneous charges and credits   W Work order

szStatusTRTYcharNONENONE

A user defined code (40/AT) that indicates the status of the line.

cCacheActionCodeEV01charNONENONE

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

cCacheErrorCodeEV02charNONENONE

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

nNumberOfKeysINT01integerNONENONE

Number of Days in Future to Query for Responses Due. 

cSuppressErrorMessageSUPPScharNONENONE

A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.        0 = allow 
runtime error message handling.        1 = suppress runtime error message handling.

szErrorMessageIDDTAIcharNONENONE

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 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

szResourceInclusionVersionMVERcharNONENONE

A user defined code (40/RV) that identifies an inclusion rule that you want the system to use for this branch/plant. The Manufacturing and 
Warehouse Management systems use inclusion rules as follows:     o For Manufacturing:        Allows multiple versions of resource rules for 
running MPS, MRP, or DRP.     o For Warehouse Management:        Allows multiple versions of inclusion rules for running putaway and picking. The 
system processes only those order lines that match the inclusion rule for a specified branch/plant.

Related Functions

B3401270 Cache, Process MRP Bucketless Dates

Related Tables

F34004 Demand/Supply Inclusion Rules