CacheProcessPartUseability

Cache - Process Part Useability

Major Business Rule

Object Name: B3001680

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function will perform Load, Delete, Update, Get, and Clear functions on the PartUseability cache 
used in Part Useability Inquiry (P30212). 


1.2Setup Notes and Prerequisites

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


• A unique job number (JOBS) must be obtained from the next numbers table (System "30", index "1") and 
passed to this function to uniquely identify cache.


• The cursor handle (Cache Cursor ID) must be passed into this function for any sequential read 
processing, i.e. Action Code is "6".  This cursor handle should be retrieved from this function by passing 

"1" in the Return Cursor parameter whenever sequential processing is performed.


• The calling application/function must pass a Job Number (JOBS) which uniquely identifies a cache 
being used for this inquiry session;  this Job Number is retrieved by the Component Usability application 

(P30212) from the Next Numbers table (F0010 - System 30, index 1).



1.3Special Logic

There is no special logic within this function.

2.Technical Specifications

2.4Processing 

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 return failure.


B.If Process Mode is "2" - ADD:
1.Insert a new cache element with values from data structure.
2.If add fails set error "032E"(Error Processing Cache) and return failure.


C.If Process Mode is "3" - UPDATE:
1.Update existing cache element with values from data structure.
2.If update fails set error "032E" (Error Processing Cache)  and return failure.


D.If Process Mode is "4" - DELETE:
1.If the number of keys is 0, Delete all elements in the cache.
2.If the number of keys is not 0, Delete the first cache elememt matching the the key 

values passed as input. 

3.If delete fails, return failure.


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

1.Delete all elements on the cache. 
2.If delete fails, return failure;


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 "4", 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 return failure.


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" (Error Processing Cache) and return failure.


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

Data Structure

D3001680 - Cache - Process Part Useability

Parameter NameData ItemData TypeReq/OptI/O/Both
mnParentLowLevelCodeLLXMATH_NUMERICNONENONE

This identifies the lowest level in any bill of material at which a particular component may appear..

mnParentItemKITMATH_NUMERICNONENONE

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.

szParentBranchMMCUcharNONENONE

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.

mnBatchQuantityBQTYMATH_NUMERICNONENONE

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.

szParentTypeTBMcharNONENONE

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.

mnComponentLowLevelCodeLLXMATH_NUMERICNONENONE

This identifies the lowest level in any bill of material at which a particular component may appear..

mnComponetITMMATH_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

szComponentBranchCMCUcharNONENONE

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)

mnComponentBatchQtyCQTYMATH_NUMERICNONENONE

The number of units which have been shipped since the inception of this contract.

szComponentTypeTBMcharNONENONE

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.

mnFixedQtyRequieredFQTYMATH_NUMERICNONENONE

A number that indicates how many items the customer must buy over the From Level entered on the Price Adjustment Detail form before 
additional free goods are awarded. For example, if the From Level is 10 and the Quantity Per Ordered is 3, the customer receives additional 
free goods when the order is for 13 or more. The customer receives free goods for ordering a value that reaches the defined level break. 
Additionally, the customer receives free goods for every multiple of the value in the Quantity Per Ordered field over the From Level. In our example, 
the customer receives free goods for ordering at least 10 and also for every multiple of 3 over 10. If the order is for 25, the customer 
receives the number of free goods in the Quantity Ordered field, multiplied by 5.  Five represents every multiple of 3 past the From Level. The From 
Level is 10, so additional free goods are awarded for the following quantities: 13, 16, 19, 22, and 25. The calculations that the system uses are 
as follows: Quantity Per Ordered Factor = (Quantity Ordered - From Level (ADMNQ)) divided by Quantity Per Ordered (FGFQTY) Total Free 
Goods Quantity = Free Good Quantity Ordered value (FGUORG) + (Free Good Quantity Ordered value * Quantity Per Ordered Factor)

szParentBatchQtyUOMcharNONENONE

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

szComponentBatchQtyUMcharNONENONE

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.

cPurchaseManufacturedEV01charNONENONE

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

cImplosionCompleteEV01charNONENONE

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

cProcessItemEV01charNONENONE

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

szCacheActionCodeCACTNcharNONENONE

A code that indicates the activity you want to perform. Valid codes:     o Get - Retrieve the cache element     o Add - Add a cache element     o 
Update - Update a cache element     o Delete - Delete a cache element     o Delete All - Delete all cache elements     o Get Next - Retrieve the 
next cache element     o Add/Update - Add a cache element if it does not exist; Update a cache element if it does exist     o Terminate - 
Terminate Cache

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.

mnVariableQtyRequiredQNTYMATH_NUMERICNONENONE

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

mnNumberOfKeysNKEYSMATH_NUMERICNONENONE

The number of keys in an index that will be used to retrieve, delete, or update a record.

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.

mnJobnumberJOBSMATH_NUMERICNONENONE

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

cReturnCursorEV01charNONENONE

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

idCacheCursorIDGENLNGIDNONENONE

General purpose ID variable.

cCacheCodeErrorEV01charNONENONE

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

Related Functions

None

Related Tables

None