F3303CreateResProfileFromRouting

F3303, Create Resource Profile From Routing

Minor Business Rule

Object Name: B3300110

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This function reads Routing information to create Resource Profile records (F3303) for the input Item 
and Branch.


1.2Setup Notes and Prerequisites


1.3Special Logic


2.Technical Specifications

// Initialize variables
LastLineType = ' '

LastWorkCenter = ' '

InventoryInterfaceFlag = ' '


// If originating from component, calculate quantity per
If ParentItemFlag = ' '

WkQuantity = 1

Fetch the F4101 record for the input BOMComponentItem 

If fetch successful

If IMLNTY <> LastLineType

Call B4000260, Get Line Type Constants, to retrieve the Inventory 
Interface                 value (IVI)

InventoryInterfaceFlag = InventoryInterfaceFlag from B4000260

LastLineType = IMLNTY

End

End

// Convert quantity to Primary UOM

If InventoryInterfaceFlag = 'Y' or 'D'

PrimaryUOM = F4101 IMUOM1

Else

PrimaryUOM = UnitOfMeasure

End


TempQty = BOMQuantity


Call B4000520, Get Item UOM Conversion Factor, to convert TempQty from UnitOfMeasure to 

PrimaryUOM for BOMComponentItem and ComponentBranch.  Pass InventoryInterfaceFlag and Standard UOM 

Conversion (IMTFLA)

If not successful

WkQuantity = 1

Else

WkQuantity = TempQty

End

End


SaveParentItem = BOMComponentItem


// If Master Routing, use Cross Reference Item Number

If MasterRoutingFlag = 'Y'

Fetch the F4104 record using  key values SaveParentItem, Cross Reference Type (XRT) = 
'MR', and Address Number (AN8) = 0.

If the fetch is successful

Fetch the F4101 record for the cross reference item (IVCITM) from F4104

If fetch successful

Fetch a record from F3003 for F4101 IMITM and Branch

If fetch successful

SaveParentItem = IMCITM

End

End

End

End


// Assign F3303 field values

F3303 CTITM = ShortItemNumber

F3303 CTLITM = SecondItemNumber

F3303 CTAITM = ThirdItemNumber

F3303 CTMMCU = Branch

F3303 CTUM = 'HR'


// Retrieve Routing Information

Set a selection over F3003 using key values SaveParentItem, Branch, TRT = 'M  ', BQTY = Accounting 

Cost Quantity.

Fetch the first selected record from F3003

If the fetch fails

Set a selection over F3003 using key values SaveParentItem, Branch, TRT = 'M  ', BQTY = 0.
Fetch the first selected record from F3003

End

FirstPass = TRUE


While F3003 fetch successful

If(IXEFFF >= EffectiveFromDate and IXEFFF <= EffectiveThruDate) or

     (IXEFFT >= EffectiveFromDate and IXEFFT <= EffectiveThruDate) or
        (IXEFFF <= EffectiveFromDate and IXEFFT >= EffectiveThruDate)


// Check for an Intermediate Item

IntermediateFlag = FALSE

Fetch a record from F3002 using key values COBY = 'I', IRKIT, IRMMCU, TBM = IRTRT, 
IRBQTY, And IROPSQ.

If fetch successful

IntermediteFlag = TRUE

Fetch the F4101 record for IXITM

If fetch successful

If IMLNTY <> LastLineType

Call B4000260, Get Line Type Constants, to retrieve the 
Inventory Interface value (IVI)

InventoryInterfaceFlag = InventoryInterfaceFlag from 
B4000260

LastLineType = IMLNTY

End

// Convert quantity to Primary UOM
If InventoryInterfaceFlag = 'Y' or 'D'

PrimaryUOM = F4101 IMUOM1

Else

PrimaryUOM = F3002 IXUM

End

TempQty = F3002 IXQNTY

If IXFORQ = '%'

Divide TempQty by 100

End


Call B4000520, Get Item UOM Conversion Factor, to convert TempQty from IXUM 
to PrimaryUOM for IXITM, IXCMCU.  Pass 

InventoryInterfaceFlag and Standard UOM Conversion (IMTFLA)

If not successful

WkQuantity2 = 0
Else
WkQuantity2 = TempQty
End

// Calculate Operation Yield Percentage

If IRCPYP <> 0

Divide IRCPYP by 100

Divide WkQuantity2 by IRCPYP

End


// Convert quantity per into BOM UOM

If InventoryInterfaceFlag = 'Y' or 'D'
FromUOM = F4101 IMUOM1

Else

FromUOM = F3002 IXUM

End

PrimaryUOM = F3002 IXUM

TempQty = WkQuantity2


Call B4000520, Get Item UOM Conversion Factor, to convert TempQty from 
FromUOM to PrimaryUOM for IXITM, IXCMCU.  Pass 

InventoryInterfaceFlag and Standard UOM Conversion (IMTFLA)

If not successful

WkQuantity2 = 0

Else

WkQuantity2 = TempQty
End
End

End


// Get conversion factor for parent item into primary UOM

If FirstPass = TRUE

ConvFactor = 1

Fetch the F4101 record for F3003 IRKIT

Call B4000520, Get Item UOM Conversion Factor, to get the conversion factor from IRUOM 
to IMUOM for IRKIT, IRMMCU.  Pass InventoryInterfaceFlag = 'Y' and Standard UOM Conversion 

(IMTFLA).

If not successful

ConvFactor = 1
End

End

FirstPass = FALSE


// Retrieve Work Center Information

If IRMCU <> LastWorkCenter

Fetch the record from F30006 for IRMCU
LastWorkCenter = IRMCU

If fetch successful

ResourceOffset = F30006 IWTRKS
Else

ResourceOffset = 0

End

// Assign F3303 field values

F3303 CTEFFF = EffectiveFromDate

F3303 CTEFFT = EffectiveThruDate

F3303 CTTRKS = ResourceOffset

F3303 CTTIMB = IRTIMB

F3303 CTMCU = IRMCU


// Revise Effectivity for Routing

If IREFFF > EffectiveFromDate

CTEFFF = IREFFF

End

If IREFFT < EffectiveThruDate

CTEFFT = IREFFT

End


// Write Resource Profile for Labor

If IRRUNL <> 0

CTUORG = IRRUNL * WkQuantity * ConvFactor

If IntermediateFlag = TRUE

CTUORG = CTUORG * WkQuantity2

Else

If IRCPYP <> 0

CTUORG = CTUORG / (IRCPYP / 100)

End

End

CTUNTY = '1'

TempQty = CTUORG

Fetch the F3303 record for CTITM, CTMMCU, CTMCU, CTUM, CTUNTY, CTEFFF, 
CTEFFT, And CTTIMB.

If fetch successful

Add TempQty to the fetched CTUORG and update the F3303 record

Else

Find the greatest Unique Key ID (CTUKID) value in the F3303 

table

Add 1 to CTUKID

Add a new record to F3303 using the field values assigned 

above.

End

End


// Write Resource Profile for Setup

If IRSETL <> 0

CTUORG = IRSETL

CTUNTY = '2'

TempQty = CTUORG

Fetch the F3303 record for CTITM, CTMMCU, CTMCU, CTUM, CTUNTY, CTEFFF, 
CTEFFT, And CTTIMB.

If fetch successful

Add TempQty to the fetched CTUORG and update the F3303 record

Else

Find the greatest Unique Key ID (CTUKID) value in the F3303 

table

Add 1 to CTUKID

Add a new record to F3303 using the field values assigned 

above.

End

End


// Write Resource Profile for Machine

If IRRUNM <> 0

CTUORG = IRRUNM * WkQuantity * ConvFactor

If IntermediateFlag = TRUE

CTUORG = CTUORG * WkQuantity2

Else

If IRCPYP <> 0

CTUORG = CTUORG / (IRCPYP / 100)

End

End

CTUNTY = '3'

TempQty = CTUORG

Fetch the F3303 record for CTITM, CTMMCU, CTMCU, CTUM, CTUNTY, CTEFFF, 
CTEFFT, And CTTIMB.

If fetch successful

Add TempQty to the fetched CTUORG and update the F3303 record

Else

Find the greatest Unique Key ID (CTUKID) value in the F3303 

table

Add 1 to CTUKID

Add a new record to F3303 using the field values assigned 

above.

End

End

End
Fetch the next F3003 record

End




^

Data Structure

D3300110 - F3303, Create Resource Profile From Routing


Data Item Data Structure DescriptionI/ORequiredNotes

EV01            Parent Item Flag                  IY      '1' = Parent Item 

                                                                        ' ' = Component Item

MMCU            Branch                        IY      IBMCU

ITM            Short Item Number                  IY      IBITM

LITM            Second Item Number            IY

AITM            Third Item Number                  IY

ITM            BOM Component Item            IY      IXITM from F3002

CMCU            Component Branch                  IY      IXCMCU from F3002

UM            Unit Of Measure                  IY      IXUM from F3002

QNTY            BOM Quantity                  IY      IXQNTY from F3002

EFFF            Effective From Date            IY

EFFT            Effective Thru Date            IY

MRYN            Master Routing Flag            IY

ACQ            Acounting Cost Quantity            IY

SUPPS            Suppress Error Message            IY      '1' = Suppress error messages 


                                                                        ' ' = Allow error messages

DTAI            Error Message ID                  OY      ' ' = success 

                                                                        '3143' = file cannot be 

accessed


^

Parameter NameData ItemData TypeReq/OptI/O/Both
cParentItemFlagEV01charNONENONE

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

szBranchMMCUcharNONENONE

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.

mnShortItemNumberITMMATH_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

szSecondItemNumberLITMcharNONENONE

A number that identifies the item. The system provides three separate item numbers plus an extensive cross-reference capability to 
alternative item numbers. The three types of item numbers are: Item Number (short) An 8-digit, computer-assigned item number. 2nd Item Number A 
25-digit, user defined, alphanumeric item number. 3rd Item Number  Another 25-digit, user defined, alphanumeric item number. In addition to 
these three basic item numbers, the system provides an extensive cross-reference search capability. You can define numerous 
cross-references to alternative part numbers. For example, you can define substitute item numbers, replacements, bar codes, customer numbers, or 
supplier numbers.

szThirdItemNumberAITMcharNONENONE

The system provides three separate item numbers plus an extensive cross-reference capability to alternate item numbers. These item 
numbers are as follows: 1.  Item Number (short) - An 8-digit, computer-assigned 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.  In addition to 
these three basic item numbers, an extensive cross-reference search capability has been provided (see XRT). Numerous cross references to 
alternate part numbers can be user defined, such as substitute item numbers, replacements, bar codes, customer numbers, or supplier 
numbers.

mnBOMComponentItemITMMATH_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)

szUnitOfMeasureUMcharNONENONE

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.

mnBOMQuantityQNTYMATH_NUMERICNONENONE

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

jdEffectiveFromDateEFFFJDEDATENONENONE

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.

jdEffectiveThruDateEFFTJDEDATENONENONE

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.

cMasterRoutingYNMRYNcharNONENONE

An option that determines whether the system uses the master routing for an item or a routing defined for the parent item. Both routings are 
retrieved from the Routing Master table (F3003). If you choose to check for master routings, the Shop Floor Management system checks the 
Item Cross Reference table (F4104), cross-reference type MR, for the parent item. If it finds a cross-reference, the program uses the master 
routing from the Routing Master Table (F3003). If it does not find a cross-reference, the system uses the routing defined for the parent item. If 
you do not choose to check for master routings, the program uses the parent item's routing from the Routing Master table. For World: Valid 
values are:    Y Yes, use the master routing for an item, if one exists.    N No, do not check for a master routing for the item. For OneWorld: To specify 
whether the system checks for cross-references and uses a master routing for the item, click the Master Routings option under the 
BOM/Routing Options heading.

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.

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.

mnAccountingCostQtyACQMATH_NUMERICNONENONE

An amount that the system uses in the Cost Rollup program to determine the allocation of setup costs. The system totals the setup costs 
and divides the sum by this quantity to determine a unit setup cost. The default is 1.

Related Functions

B3100490 Get Next Unique ID For Mfg.
B4000260 Line Type - Activity Rules
B4000520 Get Item UoM Conversion Factor
B9800420 Get Data Dictionary Definition
X4101 Validate and Retrieve Item Master

Related Tables

F30006 Work Center Master File
F3002 Bill of Material Master File
F3003 Routing Master File
F3303 Capacity Resource Profile
F4101 Item Master
F4104 Item Cross Reference File