CacheProcessWhereUsedRecords

Cache, Reverse Display Order in Where used

Minor Business Rule

Object Name: B3003630

Parent DLL: CALLBSFN

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 cache used in BOM Where Used (P30201). 


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.  


• 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
• '7' Add/Update - will add if element does not exist, will change if it does         exist.
• '8' Terminate - terminate cache
• '9' Close Cursor- closes cache cursor

• 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 or update the first record.

1.3Special Logic
There is no special logic within this function.

2.Technical Specifications
2.4Processing
I.    Perform setup functions 
A. Initialize cache to get handle.
B. Set  DS Cache Error Code = '0';   

C. If not successful Set error "032E,"  "Error Processing Cache".


II.  Processing Based on Mode.

A. If Process Mode is "1" - GET:
1.Open cursor, reset cursor.
2.Retrieve the first element on the cache matching the key values passed as input; the 

number of keys to be used is passed in the input parameters,  If  "0" fetch first element in the 

list. 

3.Load the values from the retrieved element into the data structure to be passed back to 

the calling program. 

4.If get fails DS Cache Error Code = '6'.


B. If Process Mode is "2" - ADD (same logic as mode "7").

1.Delete Record , if one exists,  that matches full key from Input.
2.Insert a new cache element with values from data structure.

3.If add fails set error "032E" and set DS Cache Error Code = '4'.


C. If Process Mode is "3" - UPDATE (same logic as mode "7").
1.Delete Record , if one exists,  that matches full key from Input.
2.Insert a new cache element with values from data structure.

3.If add fails set error "032E" and set DS Cache Error Code = '4'.


D. If Process Mode is "4" - DELETE:
1.Delete all elements on the cache matching the key values passed as input.
2.If delete fails DS Cache Error Code  = '5'.


E. If Process Mode is "5" - DELETE ALL:

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


F. If Process Mode is "6" - GET NEXT:
1.Retrieve the next element on the cache matching the key values passed as input (the 
cursor should have been set through a previous "Get" action, i.e. process mode "1", if number of 

keys is "0" then fetch next record with out 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 cursor and set  DS Cache Error Code = '1'.


G. If Process Mode is "7" - ADD/UPDATE:

1.Delete Record , if one exists,  that matches full key from Input.
2.Insert a new cache element with values from data structure.

3.If add fails set error "032E" and set DS Cache Error Code = '4'.


H. If Process Mode is "8" - END
1.Perform cleanup functions (Terminate cache).

I. If Process Mode is "9" - CLOSE CURSOR
1.Perform cursor close on cursor passed in.



Data Structure

D3003630 - Cache, Reverse Display Order in Where Used

Data Item Description       Notes

MMCU        Parent Branch      Key value.                

KIT         Parent Item-  Key value.

              Number(short)

KITL        Parent Second-  

              Item Number  

KITA        Parent Third-      

              Item Number 

CMCU  Component Branch 

ITM         Component Item-    Key value.

              Number(short)

TBM   Type of Bill       Key value.

BQTY  Batch Quantity     Key value.

UOM   Batch Quantity-   

              UOM

QNTY      RequestedQtyPer 

UM      Unit Of Measure

CPNT      Component Line-    

              Number

INDL      IndentLevel       

STKT  Parent Stocking-   

              Type

QNTY  QtyPer      

FRMP  From Potency       

THRP  Thru Potency       

FRGD      From Grade         

THGD      Thru Grade      

DL01  Item Flash Message 

INT03      Level as Integer Key value.

FORQ  Fixed or Variable- 

               Qty 

QNTY      Extended Quantity 

BQTY   Batch Quantity wf 

DSC1      Description       

UOM      Requested UOM 

INT01      Number of Keys     

EV01  Process Mode

EV01  Cache Code Error  

EV01  Suppress Error-

               Message    

GENLNGIdCursor          Returns cursor

EV01  Return Cursor     

DTA1  Error Message ID

JOBS      Job Number        Key value.



^

Parameter NameData ItemData TypeReq/OptI/O/Both
szParentBranchMMCUcharOPTNONE

A code that represents a high-level business unit. Use this code to refer to a branch or plant that might have departments or jobs, which 
represent lower-level business units, subordinate to it. For example:     o Branch/Plant (MMCU)     o Dept A (MCU)     o Dept B (MCU)     o Job 123 
(MCU) Business unit security is based on the higher-level business unit.

mnParentItemKITMATH_NUMERICOPTNONE

The system provides for three separate item numbers.    1.   Item Number (short) - An eight-digit, computer assigned, completely 
non-significant item number.    2.   2nd Item Number - The 25-digit, free form, user defined alphanumeric item number.    3.   3rd Item Number - Another 
25-digit, free form, user defined alphanumeric item number.

szParent2ndItemNumberKITLcharOPTNONE

The system provides for three separate item numbers.    1.   Item Number (short) - An eight-digit, computer assigned, completely 
non-significant item number.    2.   2nd Item Number - The 25-digit, free form, user defined alphanumeric item number.    3.   3rd Item Number - Another 
25-digit, free form, user defined alphanumeric item number. This is used in a parts list as either a parent or component number. In the Equipment 
Management system, this item is used for memo purposes only.

szParent3rdItemNumberKITAcharOPTNONE

The system provides three separate item numbers:    1. Item Number (short) - An eight-digit, computer assigned, completely non-significant 
item number.    2. 2nd Item Number - The 25-digit, free form, user defined alphanumeric item number.    3. 3rd Item Number - Another 25-digit, 
free form, user defined alphanumeric item number.

szComponentBranchCMCUcharOPTNONE

A secondary or lower-level business unit. The system uses the value that you enter to indicate that a branch or plant contains several 
subordinate departments or jobs. For example, assume that the component branch is named MMCU. The structure of MMCU might be as follows:    
Branch/Plant - (MMCU)       Dept A - (MCU)       Dept B - (MCU)       Job 123 - (MCU)

mnComponentItemNumberITMMATH_NUMERICOPTNONE

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

szTypeOfBillTBMcharOPTNONE

A user defined code (40/TB) that designates the type of bill of material. You can define different types of bills of material for different uses. 
For example:    M     Standard manufacturing bill    RWK   Rework bill    SPR   Spare parts bill  The system enters bill type M in the work order 
header when you create a work order, unless you specify another bill type. The system reads the bill type code on the work order header to 
know which bill of material to use to create the work order parts list. MRP uses the bill type code to identify the bill of material to use when it 
attaches MRP messages. Batch bills of material must be type M for shop floor management, product costing, and MRP processing.

mnBatchQuantityBQTYMATH_NUMERICOPTNONE

The quantity of finished units that you expect this bill of material or routing to produce. You can specify varying quantities of components 
based on the amount of finished goods produced. For example, 1 ounce of solvent is required per unit up to 100 units of finished product. 
However, if 200 units of finished product is produced, 2 ounces of solvent are required per finished unit. In this example, you would set up batch 
quantities for 100 and 200 units of finished product, specifying the proper amount of solvent per unit.

szBatchQuantityUOMUOMcharOPTNONE

A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box).

mnRequestedQtyPerQNTYMATH_NUMERICOPTNONE

The number of units that the system applies to the transaction.

szUnitOfMeasureUMcharOPTNONE

A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box, 
cubic meter, liter, hour, and so on.

szLevelINDLcharOPTNONE

A number indicating the level of a child in the relationship to its parent in a hierarchy.

cParentStockingTypeSTKTcharOPTNONE

A user defined code (41/I) that indicates how you stock an item, for example, as finished goods or as raw materials. The following stocking 
types are hard-coded and you should not change them:    0   Phantom item    B Bulk floor stock    C Configured item    E Emergency/corrective 
maintenance    F Feature    K Kit parent item    N Nonstock  The first character of Description 2 in the user defined code table indicates if the item 
is purchased (P) or manufactured (M).

mnQtyPerQNTYMATH_NUMERICOPTNONE

The number of units that the system applies to the transaction.

mnFromPotencyFRMPMATH_NUMERICOPTNONE

A number that indicates the minimum potency or percentage of active ingredients acceptable for an item. The system displays a warning 
message if you try to purchase or issue items that do not meet the minimum acceptable potency. The system does not allow you to sell items 
that do not meet the minimum acceptable potency.

mnThruPotencyTHRPMATH_NUMERICOPTNONE

A number that indicates the maximum potency or percentage of active ingredients that is acceptable for an item. The system displays a 
warning message if you try to purchase or issue items that have a potency that exceeds the maximum potency acceptable. The system does 
not allow you to sell items that have a potency that exceeds the maximum potency acceptable.

szFromGradeFRGDcharOPTNONE

A user defined code (40/LG) that indicates the minimum grade that is acceptable for an item. The system displays a warning message if 
you try to purchase or issue items with grades that do not meet the minimum grade acceptable. The system does not allow you to sell items 
with grades that do not meet the minimum acceptable level.

szThruGradeTHGDcharOPTNONE

A user defined code (40/LG) that indicates the maximum grade that is acceptable for an item. The system displays a warning message if 
you try to purchase or issue items with grades that exceed the maximum grade acceptable. The system does not allow you to sell items with 
grades that exceed the maximum grade acceptable.

szItemFlashMsgDL01charOPTNONE

A user defined name or remark.

nLevelAsIntegerINT03integerOPTNONE

Event point for Integer.

cFixedOrVariableQtyFORQcharOPTNONE

A code that indicates if the quantity per assembly for an item on the bill of material varies according to the quantity of the parent item 
produced or is fixed regardless of the parent quantity. This value also determines if the component quantity is a percent of the parent quantity. Valid 
values are:    F Fixed Quantity    V Variable Quantity (default)    %   Quantities are expressed as a percentage and must total 100%For 
fixed-quantity components, the Work Order and Material Requirements Planning systems do not extend the component's quantity per assembly 
value by the order quantity.

mnExtendedQtyQNTYMATH_NUMERICOPTNONE

The number of units that the system applies to the transaction.

mnBatchQuantitywfBQTYMATH_NUMERICOPTNONE

The quantity of finished units that you expect this bill of material or routing to produce. You can specify varying quantities of components 
based on the amount of finished goods produced. For example, 1 ounce of solvent is required per unit up to 100 units of finished product. 
However, if 200 units of finished product is produced, 2 ounces of solvent are required per finished unit. In this example, you would set up batch 
quantities for 100 and 200 units of finished product, specifying the proper amount of solvent per unit.

szDescriptionDSC1charOPTNONE

Brief information about an item; a remark or an explanation.

szRequestedUOMUOMcharOPTNONE

A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box).

nNumberOfKeysINT01integerOPTNONE

Number of Days in Future to Query for Responses Due. 

cProcessModeEV01charOPTNONE

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

cCacheCodeErrorEV01charOPTNONE

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

cSuppressErrorMessagesEV01charOPTNONE

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

idCursorGENLNGIDOPTNONE

General purpose ID variable.

cReturnCursorEV01charOPTNONE

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

szErrorMessageIDDTAIcharOPTNONE

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.

mnJobnumberJOBSMATH_NUMERICOPTNONE

The job number (work station ID) which executed the particular job.

mnComponentLineNumberCPNBMATH_NUMERICOPTNONE

A number that specifies how the system displays the sequence of components on a single-level bill of material. This number initially 
indicates the sequence in which a component was added to the bill of material. You can modify this number to change the sequence in which the 
components appear.

Related Functions

None

Related Tables

None