F3002CopyOperationResources

F3002 Copy Operation Resources

Minor Business Rule

Object Name: B3003000

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose

Copy  Co-Products, By-Products, Ingredients, and Intermediates from an Operation. 
Mode:  1=All

2=Co-Products, 
3=By-Products,

4=Ingredients (Substitutes also),
5=Intermediates,

6=Validate UOM conversion only

1.2Setup Notes and Prerequisites



1.3Special Logic



2.Technical Specifications


2.4Processing 


1.0Open all tables required for processing: F3002, F4101, F4102, F3009
2.0If this is a Copy Process (not changing Operation Sequence only), Calculate the ratio of new 

parent batch qty to old parent batch qty.  This ratio is expressed in a common unit of measure.  All UOM 

conversions and calculations are done once to avoid repetition when the resources are actually 

copied.

2.1Get Data Dictionary decimals for BQTY and QNTY using B9800420 - Get Data Dictionary 
Definition

2.2Get the Primary UOM, Std UOM Conv Flag for the old parent from the Item Master - F4101.

2.3Get the Primary UOM, Std UOM Conv Flag, 2nd and 3rd Item Numbers for the new parent from 

the Item Master - F4101.

2.4Convert the Old Batch Qty (File format) from primary UOM to display UOM.   Call B4000520 

- F41002 Get Item UOM Conversion.  Return the conversion factor:  mnOldPrimToDispConvFactor.

2.5Convert the New Batch Qty (File format) from primary UOM to display UOM.  Call B4000520 - 

F41002 Get Item UOM Conversion.  Return the conversion factor: mnNewPrimToDispConvFactor.

2.6Adjust the Old Batch Qty for calculations if the batch is zero.

2.6.1Assign 1 to the Batch Qty in display UOM.
2.6.2If the display and primary UOMs for the old parent are not equal, divide 1 by the 

conversion factor:  mnOldPrimToDispConvFactor.

2.7Adjust the New Batch Qty for calculations if the batch is zero.
2.7.1Assign 1 to the Batch Qty in display UOM.
2.7.2If the display and primary UOMs for the new parent are not equal, divide 1 by the 

conversion factor:  mnNewPrimToDispConvFactor.

2.8Convert the New Parent Batch Qty from New Parent Primary UOM to OLD Parent Primary UOM.  
Call B4000520 - F41002 Get Item UOM Conversion.  Return the conversion factor:  

mnNewPrimToOldPrimConvFactor.

2.9If there was an error converting the New parent into the Old Parent's Primary UOM:

2.9.1Set UOMError Flag equal to '1'
2.9.2If mode is equal to '6', set warning message:  "142K"  - No UOM conversion between 

items.

2.10Calculate the ratio:New Batch Qty / Old Batch Qty  (both expressed in Primary UOM of 
the old parent.  This ratio is used to calculate the new quantities for Co-Products, 

By-Products, Percent Ingredients, Fixed Ingredients, and Intermediates.

2.11Calculate the ratio for Variable Ingredients:mnOldPrimToDispConvFactor * 

mnNewPrimToOldPrimConvFactor / mnNewPrimToDispConvFactor.    The ratio is different for Variable Ingredients 

because their quantity is expressed as "units per 1 unit of the original parent in Display UOM".

2.12If any errors occurred during this processing, both ratios will be equal to 1.

3.0If mode is not equal to '6' (UOM Validation Only) do additional first time processing:
3.1If changing Operation Sequence only, check Mfg Constants (F3009) to see if we need to log 
the BOM changes.

3.2If Mode is equal to '1' or '4', check to see if the F3002 Job Number has already been 

initialized.  If the Job Number is non-zero, the header cache already exists.  Else,  if  the Job 

Number is zero:

3.2.1Get next internal number for the Job Number
3.2.2Initialize the F3002 Header Cache.  Write a record for the new parent to the header 

cache  (B3002040).  If the 2nd and 3rd item number were not already retrieved, fetch them 

from the Item Master - F4101.

4.0If Mode is equal to '1' or '2', copy Co-Products.  For each Co-Product for the old process:
4.1If changing Operation Sequence only, Update the Co-Product with the new OPSQ
4.2If Copying the Process, New Output Quantity (BQTY)  = Old Output Quantity (BQTY) * Ratio

4.2.1Insert the new record to F3002.
4.2.2Check F4101 - Item Branch for the planning flag.

4.2.3If the item is planned, call B4000930 - Update MRP Net Change.

4.2.4Call B3001080 - Update Low Level Codes.

5.0If Mode is equal to '1' or '3', copy By-Products.  
5.1If changing Operation Sequence only, Update the By-Product with the new OPSQ
5.2If Copying the Process, New Output Quantity (BQTY)  = Old Output Quantity (BQTY) * Ratio

5.2.1Insert the new record to F3002.
5.2.2Check F4101 - Item Branch for the planning flag.

5.2.3If the item is planned, call B4000930 - Update MRP Net Change.

5.2.4Call B3001080 - Update Low Level Codes.

6.0If Mode is equal to '1' or '4', copy Ingredients  (Substitutes also).  
6.1If changing Operation Sequence only, Update the Ingredient with the new OPSQ
6.1.1Write the Ingredient to the F3002 Detail Cache (B3002040).  (F3002 End Document 
must be called to handle all table updates for ingredients)

6.1.2If the Item is a Substitute, and the BOM Log Flag (F3009) is on, call B3000420 - 

Update BOM Audit Log.

6.2If Copying the Process, check the Fixed/ Variable Flag of the ingredient and add a new 
record.

6.2.1For Percent Ingredients,  New Required Quantity (QNTY) = Old Required Quantity 
(QNTY) * Ratio

6.2.2For Fixed Ingredients,  

6.2.2.1If the Old Batch Quantity (BQTY) is zero, New Required Quantity (QNTY) 
= Old Required Quantity (QNTY) * Ratio

6.2.2.2If the Old Batch Quantity (BQTY) is not zero, do not change the 

Required Quantity.

6.2.3For Variable Ingredients,  New Required Quantity (QNTY) = Old Required Quantity 
(QNTY) * Variable Ratio

6.2.4Write the Ingredient to the F3002 Detail Cache (B3002040). (F3002 End Document must 

be called to handle all table updates for ingredients)

6.2.5Call B3001080 - Update Low Level Codes.

7.0If Mode is equal to '1' or '5', copy Intermediates.  
7.1If changing Operation Sequence only, Update the Intermediate with the new OPSQ
7.2If Copying the Process, New Intermediate Quantity (QNTY)  = Old Intermediate Quantity 

(QNTY) * Ratio, Insert the new record to F3002.

8.0Return the Job Number to the calling program.
9.0Close all tables

Data Structure

D3003000A - Data Struct For B3003000

Parameter NameData ItemData TypeReq/OptI/O/Both
mnOldParentItemKITMATH_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.

szOldBranchMMCUcharNONENONE

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.

szOldTypeBillTBMcharNONENONE

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.

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

szOldUnitOfMeasureUOMcharNONENONE

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

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

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

szNewBranchMMCUcharNONENONE

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.

szNewTypeBillTBMcharNONENONE

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.

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

szNewUnitOfMeasureUOMcharNONENONE

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

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

cModeEV01charNONENONE

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

szUserIdUSERcharOPTNONE

The code that identifies a user profile.

szWorkStationIdJOBNcharOPTNONE

The code that identifies the work station ID that executed a particular job.

jdDateUpdatedUPMJJDEDATEOPTNONE

The date that specifies the last update to the file record.

mnTimeOfDayTDAYMATH_NUMERICOPTNONE

The computer clock in hours:minutes:seconds.

szProgramIdPIDcharOPTNONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

mnF3002JobNumberJOBSMATH_NUMERICOPTNONE

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

Related Functions

B3000160 Convert Batch Quantity
B4000520 Get Item UoM Conversion Factor
B9800420 Get Data Dictionary Definition
N3002060 F3002 Return Line Number
N3003190 F3002GetLastSubSeqNobyCompLine
X4101 Validate and Retrieve Item Master

Related Tables

F3002 Bill of Material Master File