CacheCalculateIssueQuantity

CacheCalculateIssueQuantity

Major Business Rule

Object Name: B3101130

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
The purpose of this function is to check if a record exists in the cache.  If record exists 
accumulate quantity ordered and transaction quantity and calculate issue quantity.  If record does not exist 

create it and calculate issue quantity.


1.2Setup Notes and Prerequisites

• None.

1.3Special Logic

• None.

2.Technical Specifications

2.4Processing 

Initialize Variables:

Line Closed =999999999999999.
Difference Zero

Quantity Per=Zero

Intermediate Total=Zero

Grand Total=Zero

Consumed Total=Zero

Net Consumed=Zero

Difference Two=Zero

Total Issue=Zero


1)If terminating cache, delete all cache elements and exit the business function.


2)If DS Quantity Ordered is Zero and DS Transaction Quantity is Zero.

 a)DS Description = "** Line Item is Closed".
 b)Exit the business function.


3)Retrieve Cache record by DS Job Number, DS Computer Id, DS Primary Item Number, DS Operation 

Sequence Number, and DS Fixed of Variable Quantity Flag as keys.


a)If the processing mode is '1' (Load cache):
i)   Increment the Index Number of occurences
ii)Index Before Consumption = 0

iii)Index Quantity Order = Index Quantity Ordered +    DS Quantity Ordered.

iv)Index Transaction Quantity = Index Transaction    Quantity + DS Transaction Quantity.

v)   If matching cache record is found, update the    cache.

vi)If cache is not found, add a new record to the    cache.


b)If the processing mode is '2' (Calculate Issue Qty):
i)  Perform Calculate Issue Qty logic (see below).
ii)Update the cache with new calculated values .


Calculate Issue Qty Logic:

/* Determine if line is closed and setup description message if it is closed. */
1)Difference = DS Quantity Ordered - DS Transaction Quantity.
2)If Difference < Zero AND DS Super Backflush is Blank OR DS Quantity Committed = '999999999999999' 

(i.e. Line Closed)

a)If DS Quantity Committed = '999999999999999' (i.e. Line Closed)
i)Description = "**Line Item is Closed**".
ii)Exit the business function.


/* Process variable/percent quantity. */

Note:  Decrement the no of occurrences.  When the number hits zero during issuance calculations, it 
denotes the last line.


3)Determine if the quantity previously issued exceeds the original transaction quantity.  If so, do 
no display the global adjustment quantity in the issue quantity field.


4)If DS Fixed or Variable Quantity Flag = 'V' or '%'
a)If DS Index Flag = Blank:
/*  Note:  Decrement the no of occurrences.  When the number hits zero during issuance 
calculations, it denotes the last line. */

i)Index Number of Occurrences = Index Number of Occurrences - 1.
ii)Net = Zero.

iii)Net Consumed = Zero.

iv)DS Issue Quantity = Zero.


/* Extend ordered and consumed totals by the ratio.  Record equals total that should be issued. 
 Will issue all that is 'open' on the grid line up to the total that should net against the 

quantity that has already been issued.  Any overage will default to the last line with an open 

issue quantity. */


v)If DS Quantity Ordered Master not equal to Zero:
(a)Quantity Per = Index Quantity Ordered / DS    Quantity Ordered Master.

vi)If DS Issue Conversion Factor = Zero
(a)DS Issue Conversion Factor = 1.

vii)If DS Quantity Conversion Factor = Zero
(a)DS Quantity Conversion Factor = 1.

viii)Intermediate Total = Intermediate Total / DS    Quantity Conversion Factor

ix)Intermediate Total = DS Issue Material For *    Quantity Per.

x)   Grand Total = Intermediate Total.

/* Always net to previous quantities issued except when invoked by super backflush */

xi)If DS Super Backflush = Blank and Intermediate    Total is greater than zero:
(a)Intermediate Total = Intermediate Total -    Index Transaction Quantity.

xii)Consumed Total = Index Before Consumed.

/* If consumed is less than quantity-to-be-issued */
xiii)If Consumed Total < Intermediate Total and Grand    Total is greater than zero:
(a)Net = DS Quantity Ordered - DS Transaction    Quantity.
(b)Net Consumed = Net + Consumed Total.

(c)If Net Consumed > Intermediate Total

(i)Difference Two = Net Consumed - Intermediate Total.
(ii)Net = Net - Difference Two.

(d)DS Issue Quantity = Net.
(e)Index Before Consumed = Index Before       Consumed + Net.


/* If consumed is greater than quantity-to-be-issued and issue quantity is negative */
xiv)If Consumed Total > Intermediate Total and Grand    Total is less than zero:
(a)Net = DS Quantity Ordered - DS Transaction    Quantity.
(b)Net = Net * -1

(c)Net Consumed = Net + Consumed Total.

(d)If Net Consumed < Intermediate Total

(i)Difference Two = Net Consumed -    Intermediate Total.
(ii)Net = Net - Difference Two.

(e)DS Issue Quantity = Net.
(f)Index Before Consumed = Index Before    Consumed + Net.


/* Last occurrence processing */
xv)Consumed Total = Index Before Consumed.

xvi)If Index Number of Occurrences = Zero
(a)If Consumed Total < Intermediate Total:
(i)Difference Two = Intermediate Total  Consumed Total
(ii)DS Issue Quantity = DS Issue Quantity + Difference Two.


/* Issue Quantity determined from array of percentages. */
b)If DS Index Flag NOT = Blank:

i)Call Business Function F31UI005 Retrieve Quantity with the following parameters.
DS Computer ID

DS Job Number
DS Operation Sequence Number

Quantity is returned.


ii)DS Issue Quantity = DS Quantity Ordered *    Quantity returned.


/* Fixed Quantity. */

5)If DS Fixed or Variable Quantity Flag NOT = 'V' or '%' (i.e. Fixed FORQ)

a)DS Issue Quantity = Difference.

Data Structure

D3101130 - Cache, Calculate Issue Quantity

Parameter NameData ItemData TypeReq/OptI/O/Both
mnJobNumberJOBSMATH_NUMERICNONENONE

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

szComputerIDCTIDcharNONENONE

szPrimaryItemNumberUITMcharNONENONE

A number that the system assigns to an item. It can be in short, long, or third item number format.

mnOperationSequenceNoOPSQMATH_NUMERICNONENONE

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.

cFixedOrVariableQtyFlagFORQcharNONENONE

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.

mnQuantityOrderedUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

mnQuantityOrderedMasterUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

mnTransactionQuantityTRQTMATH_NUMERICNONENONE

A value that represents the available quantity, which might consist of the on-hand balance minus commitments, reservations, and 
backorders. You enter this value in the Branch/Plant Constants program (P41001).

mnQuantityCommittedQNTAMATH_NUMERICNONENONE

szDescriptionDSC1charNONENONE

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

cIndexFlagEV01charNONENONE

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

cSuperBackflushEV02charNONENONE

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

mnIssueMaterialForQTYMATH_NUMERICNONENONE

The number of units associated with an asset.

mnIssueQuantityQNTYMATH_NUMERICNONENONE

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

cTerminateCacheEV03charNONENONE

A radio button that specifies the level at which trace/track result is to be displayed.  Select the Detail to display all transactions except IB, IX, 
and IZ types.  Or, select Derivative Lots Only to display only those transactions that may have created new derivative lot. 

mnIssueConversionFactorCNV1MATH_NUMERICNONENONE

The mathematical relationship showing the conversion between the primary and secondary units of measure.

mnQtyConversionFactorCNV2MATH_NUMERICNONENONE

The mathematical relationship showing the conversion between the primary and purchasing units of measure.

cProcessingModeEV01charNONENONE

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

mnCoByJobNumber_JOBSJOBSMATH_NUMERICOPTNONE

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

mnCoByOperationSequence_OPSQOPSQMATH_NUMERICOPTNONE

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.

mnIdentifierShortItemITMMATH_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

szCostCenterAltMMCUcharOPTNONE

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.

szUnitOfMeasureAsInputUOMcharOPTNONE

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

mnStepScrapPercentSTPPMATH_NUMERICOPTNONE

A value that the system uses to increase or decrease the amount of materials to account for loss within the operation. The system updates 
this value on Enter/Change Bill of Material when you run the Planned Yield Update program. The system calculates this value by 
compounding the yield percentages from the last operation to the first operation. Use a processing option in Enter/Change Routing to enable the 
system to calculate the component scrap percent.

cApplyShrinkAPSKcharOPTNONE

This field controls whether the system applies the parent item's shrink factor to the recommended issue quantity of a component item. Valid 
values:    0   The system does not apply the shrink factor to the quantity of a component item.    1   The system applies the shrink factor to the 
quantity of a component item.

cApplyYieldAPYDcharOPTNONE

A code that controls whether the system applies the operation scrap percent to the recommended issue quantity of a component item. 
Valid values are:    0    The system does not apply the operation scrap percent to the component item.    1    The system applies the operation 
scrap percent to the component item.

mnSecondaryIssuesSSTQMATH_NUMERICOPTNONE

The number of units, expressed in the secondary unit of measure, that the system has recorded as completed or issued. This value can 
represent either the quantity completed for co-/by-products or the quantity that was issued for a component.

mnComponentShortItemNoITMMATH_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

szComponentBranchPlantCMCUcharOPTNONE

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)

mnShrinkFactorSRNKMATH_NUMERICOPTNONE

A fixed quantity or percentage that the system uses to determine inventory shrinkage for an item. The system increases the planned order 
quantity by this amount in MPS/MRP/DRP generation. The shrink factor method you specify for the item determines whether the shrink factor 
is a percentage or a fixed quantity. If you are entering a percentage, enter 5% as 5.00 and 50% as 50.00.

cShrinkFactorMethodSRKFcharOPTNONE

A value that determines whether the shrink factor you enter for this item is a percentage or a fixed quantity. Valid values are:    %   
Percentage of order or requested quantity    F Fixed amount to be added to quantity 

mnRequestedQuantityWithShrinkRQTE1MATH_NUMERICOPTNONE

The number of parent items that you want to process. The system calculates lower level values in quantity per the number of parent items 
requested. For instance, if it takes 3 components per a parent item, then with a requested quantity of 10, the system would plan and cost for 30 
components.

Related Functions

B3102110 Cache Resource Percentage Index

Related Tables

None