CacheQualityManagementPref

Cache Quality Management Preferences

Minor Business Rule

Object Name: B3700130

Parent DLL: CDIST

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose

This function will perform Load, Delete, Update, Get, and Clear functions on the 

PreferenceQualityManagement cache used when a Preference Profile is retrieved for Quality Management.  On a Create 

process, an identifier for the cache (idCacheHandle) is passed back to the calling program for subsequent 

calls to this function.  


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.  The application must also 

store the hCache pointers passed back from the "Create" process and pass these pointers back to the 

business function on the other process modes which require them (see technical specifications below).


1.3Special Logic

The index to the cache will be Test Id (QTST) and Detail Branch (MCU2).   The index is used to avoid 

loading duplicate tests when the Preference is originally loaded into the cache. 


2.Processing 



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 QCTSSP (TestSpecificationFlag) = 'T'
a. Call function Insert Test Record
Else
b.Call function Insert Spec Record

   3.  Function Insert Test Record

a.Insert Test Record into cache as it appears in F40318, Quality Management Preference 
Table

       (1).  Cache ResultSortSequence = PreferenceTestSortSequence
(2).  Cache TestSortSequence = PreferenceTestSortSequence


   4.  Function Insert Spec Record

  a)  Split Spec:

      (1).   Select F37021 with QSPC, QREV and MCU as Key

      (2).   PreferenceTestID  =   SpecificationID

      (3).   PreferenceRevisionLevel  =  Specification Revision Level

                                   (4).  PreferenceDetailBranchPlant   =SpecificationBusiness 

Unit

                                   (5).  VA evt_SplitSpec_EV01 = ' '

       (6).  WHILE VA evt_SplitSpec_EV01  NE '1'

               1.  FetchNext F37021 

                    a). IF SV File_IO Status  not equal to  SUCCESS

                                  VA evt_SplitSpec_EV01 = '1'

                                                     (1).  Cache Test ID =Test ID from F37021

                                          (2). Cache DetailBranchPlant  = 

DetailBranchPlant from F37021

                         (3). Cache SpecificationId = PreferenceTestID

                                                     (4).  Cache SpecBranchPlant = 

PreferenceDetailBranchPlant

                                                     (5).  Cache RevisionLevel = 

PreferenceRevisionLevel

                         (6).  CacheResultSortSequence = PreferenceTestSortSequence

                         (6).  Cache TestSortSequence = PreferenceTestSortSequence

                        ENDIF

                                        ENDWHILE

                                      ENDIF

5. If add fails set error "032E"(Error Processing Cache) and return failure.

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.


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 element matching the key values 

passed as input. 

3.If delete fails, return failure.


If Process Mode is "5" - DELETE ALL:
1.Delete all elements on the cache. 
2.If delete fails, return failure;


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


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.


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



Data Structure

D3700130 - Cache Quality Management Preferences

Parameter NameData ItemData TypeReq/OptI/O/Both
cStatusSTAWcharOPTBOTH

A user-defined code (00/WS) that indicates the approval status.

mnTextIDTXIDMATH_NUMERICOPTBOTH

Unique identifier associating a preference with it's generic text.

mnSequenceNumberOSEQMATH_NUMERICOPTBOTH

For OneWorld, the sequence by which users can set up the order in which their valid environments are displayed. For World, a sequence or 
sort number that the system uses to process records in a user defined order.

mnTestSortSequenceNumberTSRTMATH_NUMERICOPTBOTH

A number used to determine the sort order of tests and specifications within preference profiles (item/test specifications).

jdTestEffectiveFromEFFFJDEDATEOPTBOTH

A date that indicates one of the following:     o When a component part goes into effect on a bill of material     o When a routing step goes into 
effect as a sequence on the routing for an item     o When a rate schedule is in effect The default is the current system date. You can enter 
future effective dates so that the system plans for upcoming changes. Items that are no longer effective in the future can still be recorded and 
recognized in Product Costing, Shop Floor Management, and Capacity Requirements Planning. The Material Requirements Planning system 
determines valid components by effectivity dates, not by the bill of material revision level. Some forms display data based on the effectivity 
dates you enter.

jdTestEffectiveThruEFFTJDEDATEOPTBOTH

A date that indicates one of the following:     o When a component part is no longer in effect on a bill of material     o When a routing step is no 
longer in effect as a sequence on the routing for an item     o When a rate schedule is no longer active The default is December 31 of the 
default year defined in the Data Dictionary for Century Change Year. You can enter future effective dates so that the system plans for upcoming 
changes. Items that are no longer effective in the future can still be recorded and recognized in Product Costing, Shop Floor Management, 
and Capacity Requirements Planning. The Material Requirements Planning system determines valid components by effectivity dates, not by 
the bill of material revision level. Some forms display data based on the effectivity dates you enter.

mnQualityTableSequenceNumberQTSNMATH_NUMERICOPTBOTH

A control number that uniquely identifies master table records in the Quality Management system. The system automatically generates this 
number.

szBranchPlantMCUcharOPTBOTH

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

szTestIDQTSTcharOPTBOTH

The unique identification for a test to be performed on an item. For example:    COL Color test    DENS Density Test    CL-2   Clarity Test 

cTestTypeTTTYcharOPTBOTH

A value that specifies how the system processes tests as you enter test results. Valid values are:    R  Required. Result values must be 
within the allowable range for the test to pass. The system does not allow an item to pass quality inspection until you enter results for each 
required test.    O  Optional. Result values are optional during results entry. The system does not require the entry of a result for each optional test. 
However, if you enter failing results, the item fails quality inspection.    G  Guaranteed. Result values are optional during results entry. You can 
control whether Guaranteed tests appear as you enter test results with the Display Test field on Test Revisions. In addition, guaranteed tests 
print on the Certificate of Analysis.

szQualityRevisionLevelQREVcharOPTBOTH

An alphanumeric character that represents the number of times a specification has changed. To avoid overlapping revisions, the system 
verifies that the start dates of revisions are greater than the end dates of other revisions.

cTestSpecificationflagTSSPcharOPTBOTH

A code that indicates whether a record within preference profiles (item/test specifications) is a test or specification. Valid values are:    T Test  
  S Specification 

szDetailBranchPlantMCU2charOPTBOTH

An accounting entity, such as a profit center, department, warehouse location, job, project, workcenter, and so on, required for management 
reporting.

szSystemCodeSYcharOPTBOTH

A user defined code (98/SY) that identifies a system. Valid values include: 01 Address Book 03B Accounts Receivable 04 Accounts 
Payable 09 General Accounting 11 Multicurrency

szUserDefinedCodeRTcharOPTBOTH

A code that identifies the table that contains user defined codes. The table is also referred to as a UDC type.

szAllowedMinimumAMINcharOPTBOTH

The lowest value for a passing test result.

szAllowedMaximumAMAXcharOPTBOTH

The highest value for a passing test result.

szPreferredMinimumPMINcharOPTBOTH

The lowest value for the preferred test result. This value must be greater than or equal to the allowed minimum value. Use the preferred 
minimum value to measure quality to a more precise specification than a customer requests. Processing options for the Certificate of Analysis 
program allow you to print the preferred value on the Certificate of Analysis report. Processing options for the Test Revisions program allow you 
to evaluate samples against the preferred values.

szPreferredMaximumPMAXcharOPTBOTH

The highest value for the preferred test result. This value must be less than or equal to the allowed maximum value. Use the preferred 
maximum value to measure quality to a more precise specification than a customer requests. Processing options for the Certificate of Analysis 
program allow you to print the preferred value on the Certificate of Analysis report. Processing options for the Test Revisions program allow you 
to evaluate samples against the preferred values.

szTargetQTRGcharOPTBOTH

The preferable or target test result within the test results range. As the system does not test against a target value, this field is for your 
information only.

mnSampleSizeQSSZMATH_NUMERICOPTBOTH

The quantity of one sample to be taken for the test. As the system does not use this field, it is for your information only.

szQualityUnitofMeasureQUMcharOPTBOTH

Identifies the unit of measure for a sample you take to test. Examples of units of measure include barrels, gallons, hours, and cubic yards.

mnNumberofSamplesQSMPMATH_NUMERICOPTBOTH

The number of samples to be taken for the test.

mnSamplePercentageSMPCMATH_NUMERICOPTBOTH

The percentage of an order quantity that determines the number of samples to create in Test Results Revisions. For example, if the sample 
percentage is 50 percent and the order quantity is 10, then 5 samples will be created in Test Results Revisions. Use either this field or 
Number of Samples to control how many samples to create. You can use this field only with the order mode of Test Results Revisions. If the 
sample percentage is 100 percent, then testing is required for every unit on the order. You cannot use Accept Percentage or Accept Quantity, 
since all units on the order must pass for the lot to pass.

mnAcceptQuantityACQTMATH_NUMERICOPTBOTH

A flag that indicates the quantity of tests that must pass in order for the test sample to pass quality control. The system evaluates this value 
when the sample percentage is not equal to 100. To use this accept quantity value, you must complete the following fields on Test Definitions 
accordingly:    1       Display/Evaluate    Blank Accept Percentage

mnAcceptPercentageACPCMATH_NUMERICOPTBOTH

A flag that indicates the percentage of tests that must pass in order for the sample to pass quality control. The system evaluates this value 
when the sample percentage is not equal to 100. To use the accept percentage value, you must complete the following fields on Test 
Definitions accordingly:    1         Display/Evaluate    Blank Accept Quantity

cPrintTestPTTScharOPTBOTH

A code used to determine whether or not a test will be printed on the Certificate of Analysis. The valid values are:    0   The test will not be 
printed on the Certificate of Analysis.    1   Print all occurrences of a test on the Certificate of Analysis.    2   Print just the average test result record 
when printing the Certificate of Analysis.    3   Print the last occurrence of a test when printing the Certificate of Analysis. The last occurrence will 
be the test results record that was entered last using Test Results Revisions.

cManufacturingOperationsMFGRcharOPTBOTH

A value that specifies whether the system displays the test on the Test Results Revisions form when you access the Test Results 
Revisions program (P3711) from any of the following Manufacturing programs:   o  Co-/By-Product Completion (P31115)   o  Super Backflush (P31123)   
o  Work Order Time Entry (P311221) If you enter 1 in the grid column or if this option is checked, the system displays the test on the Test 
Results Revisions form. You can use this value with the operation sequence and routing type to control the appearance of the test at an operation 
or routing type.

cManufacturingReceiptRoutingMRRRcharOPTBOTH

A value that controls whether a test will display on the Test Results Revisions form when you access test results from the Routing 
Movement and Disposition (P43250) program when the routed order is a manufacturing work order. Valid values are:    1   The test will appear on Test 
Results Revisions.    0   The test will not appear on Test Results Revisions. You can use this value with the operation sequence to control the 
appearance of the test at a route operation.

cPurchasingReceiptRoutingPRERcharOPTBOTH

A value that controls whether the test will display on the Test Results Revisions form when you access test results from Routing Movement 
and Disposition (P43250) and the routed order is a purchase order. Valid values are:    1   The test will appear on Test Results Revisions.    0   
The test will not appear on Test Results Revisions. You can use this value with the operation sequence to control the appearance of the test 
at an operation.

cPurchasingReceiptsPRCRcharOPTBOTH

A value that controls whether a test will display on the Test Results Revisions form when you access test results from either Receipts by 
P/O or Receipts by Item (P4312). Valid values are:    1   The test will appear in Test Results Revisions.    0   The test will not appear in Test 
Results Revisions.

cManufacturingCompletionsMFGCcharOPTBOTH

A value that specifies whether the system displays the test on the Test Results Revisions form when you access the Test Results 
Revisions program (P3711) from either of the following Manufacturing programs:   o  Work Order Completions (P31114)   o  Completions Workbench 
(P3119) If you enter 1 in the grid column or if this option is checked, the system displays the test on the Test Results Revisions form.

cShipConfirmSHPRcharOPTBOTH

A value that controls whether the test will display on the Test Results Revisions form when you access test results from the Ship 
Confirmation (P4205) program. Valid values are:    1   The test will appear on Test Results Revisions.    0   The test will not appear on Test Results 
Revisions.

cBulkLoadConfirmBLKRcharOPTBOTH

A value that controls whether the test will display on the Test Results Revisions form when you access test results from one of the following 
programs:     o Bulk Confirm by Order or Bulk Confirm by Trip (P49510)     o Packaged Load Confirmation (P49530) Valid values are:    1   The 
test will appear on Test Results Revisions.    0   The test will not appear on Test Results Revisions.

mnSequenceNoOperationsOPSQMATH_NUMERICOPTBOTH

A number used to indicate an order of succession. In routing instructions, a number that sequences the fabrication or assembly steps in the 
manufacture of an item. You can track costs and charge time by operation. In bills of material, a number that designates the routing step in the 
fabrication or assembly process that requires a specified component part. You define the operation sequence after you create the routing 
instructions for the item. The Shop Floor Management system uses this number in the backflush/preflush by operation process. In engineering 
change orders, a number that sequences the assembly steps for the engineering change. For repetitive manufacturing, a number that 
identifies the sequence in which an item is scheduled to be produced. Skip To fields allow you to enter an operation sequence that you want to begin 
the display of information. You can use decimals to add steps between existing steps. For example, use 12.5 to add a step between steps 
12 and 13.

mnOperationsSequenceOPRSMATH_NUMERICOPTBOTH

The sequence in which the system performs the operations or steps of the route.

mnBubbleSequenceBSEQMATH_NUMERICOPTBOTH

A secondary bill of material sequence number that indicates the drawing bubble number.

szTypeRoutingTRTcharOPTBOTH

A user defined code (40/TR) that indicates the type of routing. You can define different types of routing instructions for different uses. For 
example:    M    Standard Manufacturing Routing    RWK  Rework Routing    RSH  Rush Routing You define the routing type on the work order 
header. The system then uses the specific type of routing that you define in the work order routing. Product Costing and Capacity Planning systems 
use only M type routings.

szTestMethodTMHDcharOPTBOTH

A description of how to run a quality test. The test method is useful to both your company's Quality Control department and your customers. 
For example:        Test: Viscosity         Method: RVF #4 @10RPM         Text: Run the viscosity test on a RVF viscometer with a number 4 spindle 
at 10 revolutions per minute.

szResultUnitofMeasureRSUMcharOPTBOTH

A user defined code (37/UM) that identifies the unit of measure for a test result.  Examples of units of measure include barrels, boxes, cubic 
yards, gallons, and hours.

mnAssetNumberNUMBMATH_NUMERICOPTBOTH

An 8-digit number that uniquely identifies an asset.

szASTMReferenceASTMcharOPTBOTH

Identifies a recommended testing procedure of the American Society of Testing Material.

szPropertyQPRPcharOPTBOTH

The item attribute that is being tested.

cTimingofTestTTSTcharOPTBOTH

szAlternateBranchPlantMMCUcharOPTBOTH

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.

cNumberofDecimalsCDECcharOPTBOTH

A value that designates the number of decimals in the currency, amount, or quantity fields the system displays. For example, U.S. Dollars 
would be 2  decimals, Japanese Yen would be no decimals, and Cameroon Francs would be 3  decimals.

mnWorkflowKeyIDUKIDMATH_NUMERICOPTBOTH

This field is a unique number used to identify a record in a file.

cActionCodeACTNcharOPTBOTH

A code that specifies the action that is performed. Valid values are: A Add C Change

szDerivedCalculationDERCcharOPTBOTH

An algebraic formula that specifies the quantity, price, hours, or a value associated with a rule. The following examples illustrate the syntax 
for possible derived calculations: Segment References     o S3 indicates segment 3.     o S3=Piston= indicates segment 3 in item 
Piston. Trigonometric and Logarithmic Functions     o SIN(20) indicates the sine of 20.     o COS(S3) indicates the cosine of segment 3.     o TAN(S4) indicates 
the tangent of segment 4.     o ARC(S3) indicates the arctangent of segment 3.     o LOG indicates log to base 10.     o LN indicates natural log.    
 o 2**5 indicates an exponent, 2 to the fifth power. Substring SUBSTR(S10,1,4) indicates that the substring from segment 10 starts at the first 
position of the string and includes the first 4 positions. Concatenations CONCAT(S3,S4) combines the values of segments 3 and 4. External 
Fields Specifies the fields from non-configurator tables that you want the system to access as part of a calculation. Use the ampersand character 
followed by the field name. For example, &T2AMTU(WD) indicates an amount field in the Item Supplemental Database table, and the WD 
data type. External Programs Specifies that a program external to the system is to be used for the calculation. Enter the name of the external 
program and EXTVAR in the Derived Calculations field. Smart Parts PS4 indicates a smart part number P2000 when the value of segment 4 is 
2000.

szSpecificationIDQSPCcharOPTBOTH

The unique identification for a set of tests which need to be performed together. For example:        F-156 - FDA Specification 156        SP34 - 
Specification 34

szSpecBranchPlantHMCUcharOPTBOTH

The number of the business unit in which the employee generally resides.

mnResultSortSequenceRSQQMATH_NUMERICOPTBOTH

A sequence number used within the Test Results Revisions programs to maintain the order of tests decided within Item/Test 
Specifications.

cRecordSelectedEV01charOPTBOTH

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

cCacheErrorCodeStatusEV01charOPTOUTPUT

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

mnJobnumberJOBSMATH_NUMERICOPTINPUT

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

idCacheHandleGENLNGIDOPTBOTH

General purpose ID variable.

nNumberOfKeyFieldsINT01integerOPTINPUT

Number of Days in Future to Query for Responses Due. 

cIndexToUseEV01charOPTINPUT

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

cReturnCacheCursorEV01charOPTINPUT

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

cSuppressErrorMessagesEV01charOPTINPUT

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

cCacheActionCodeEV01charOPTINPUT

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

szErrorMessageIDDTAIcharOPTOUTPUT

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.

Related Functions

None

Related Tables

None