BOMGetComparisonRows

BOMGetComparisonRows

Major Business Rule

Object Name: N3001850

Parent DLL: CMFGBASE

Location: Client/Server

Language: NER

Note - this documentation has had portions deleted to allow it to fit within the text attachment
1.Functional Description

This function will find all bill of material records which are used as Subassemblies, Phantoms or 

Components for an given parent item. The function will be used in different modes. Usually this BSFN is 

called two times by an application. 

The first time it must be called in the 'First Item Mode'. Here all matching records are written to 

the User Index Table(F30UI008), the information is filled in the 'first-item-fields'.   

The second time it must be called in the 'Second Item Mode'. Now the information for all matching 

records is written in the 'second item fields' (F30UI008). Not existing records must be created, hereby 

the 'First Item Information Fields' are getting initialized.   

A second mode controls if 'all components' or only the 'first level components' should be written in 

the work files. 



1.1Purpose

This function will find all defined records for an given parent item-1 and will them write into in a 

work file. Then it will be called again and will write all found rows for item-2 in the same 

work-file. The calling application compares its content and shows either all records or only the records with 

different quantities (item-1/item-2) in the grid. Before the work file can be used all records for the 

current PC Identification and Job Number must be deleted. After all matching Bill of Material records 

are processed the pointer can be freed. In order to find the next matching Bill of Material record in 

the Multiple Level the BSFN B3000840 should be used. This BSFN provides N3001850 with both, the next 

vertical and the next horizontal component.


1.2Setup Notes and Prerequisites

The setup notes and prerequisites contains information that needs to be provided to the application 

developer to successfully use attach the business function.  Important prerequisite Business Functions 

that need to be run and any additional relevant information (what event points, limitations, data 

structure peculiarities) should be detailed.

• Use bullet points

1.3Special Logic

This function is called twice from the calling application (P30204). The first time it will be called 

with the information for 'item one'. For this item the work file must be cleared. After that all 

depending items of the Bill of Material File must be read (B3000840) and filled in the work file.

The second time it will be called with the information for 'item two'. All depending items of the 

Bill of Material must be filled in the work file. If one record already exists, the quantity gets added, 

otherwise a new record must be created.         

The work file is used by the calling information. 



2.Technical Specifications


2.4Processing 



1.0.If (BF LVSM = '1')

Single Level


1.1Initialize Variables.

If  requested quantity is greater than 1

VA Batch Quantity Extended=BF Qnty Required Standard

Else
VA Batch Quantity Extended=BF Batch 

Quantity

Endif


End of BOM Structure is = 0


1.2Retreive First Component 
While VA EndofBOMStructure is equal zero
End of Vertical Structure = '0'
Horizontal Record Found = '0'
RecordFlag  = '0'
While RecordFlag = 1 and End of Vertical Branch not equal to 1

BF GetBOMStructureVertical
Data Structure of BSFN B3000840


1.3If component found, 

If Vertical Record Found = '1'
Calculate extended quantity

F3002 Calculate Extended Quantity

Endif

Endwhile



1.4Since it a single level look for horizontal records till end of BOM is reached.
VA HorizontalRecordFlag= 1
Do While End of BOM Structure is equal to '0'  and VA RecordFlag is equal to 1

VA Horizontal Record Found = 0

BF GetBOMStructureHorizontal



1.3If VA Horizontal Record is equal to one  i.e record found
VA Horizontal Record Flag = 0   
Calculate extended quantity
F3002 Calculate Extended Quantity


enddo

Endwhile


2.0else 

Multiple Level 

2.1Initilize variables and start while loops 
VA End of BOM Structure is = 0
Do While End of BOM Structure is equal to '0'
VA End of Vertical Structure = '0'

VA Horizontal Record Found = '0'


Retieve all the records till the end of vertical branch is reached

Do While End of Vertical Structure is equal to '0'


2.2Retrieve the first Component.
BF GetBOMStructureVertical
Data Structure of BSFN B3000840


2.2If Vertical Record Found = '1'
Calculate extended quantity
F3002 Calculate Extended Quantity



2.4When a vertical branch is exploded start at the last item and look for a horizontal 
record 

at the level till no more records are found.  When a horizontal record is found call the 
vertical to explode it down.


Do While End of BOM Structure is equal to '0' and HorizontalRecord Found ='0'

BF GetBOMStructureHorizontal


3.0Check Subassemblies and Phantoms


3.1Check for Subassemblies (check if there is a further Child for the current Child)

If Subassemblies  (input) = 0
BF B3000510 Verify and Get Bill of Material

('0002' = Invalid Record)

3.2Exclude or include Subassemblies:

Record exists - current record is an Subassembly
If Error Message <> '0002'
Skip Record

endif

endif

3.3Exclude or include phantoms:


If BF Phantoms = 0

and Child Stocking Type = 0

exclude Phantoms 

Skip Record

endif

4.0 Compare the Bill of Material Items by Work Center 


Work Center =  blank


If BF TypeOf Comparison  = '1' (Compare by Work Center)

4.1Single Level
Get Operation Work Center N3001950
Endif

4.2Multi level
Get the Work Center depending on the Stocking Type
If Parent Stocking Type  == 0

Use the Last Saved Parent Item (which is not a Phantom)Information and retrieve its 

Work Center. 

Get Operation Work Center N3001950
else
Get Operation Work Center N3001950
endif


5.0Fill Data in User Index Work File 

If FITM = 1 (first item)
Fetch to F30UI008 where 
Key:BF Job Number'e0 UI Job Number 

BF PC-Identification'e0 UI PC-ID

VA Work Center'e0 UI Business Unit

(blank if summary by item)  

VA Child Item 'e0 UI Item Number 

Short 

VA Child UM'e0 UI Unit of Measure


If record found


Write record F30UI008
endif
endif 

Data Structure

D3001850 - BOMGetComparisonRows

Parameter NameData ItemData TypeReq/OptI/O/Both
cItemNumberFlagFITMcharNONENONE

This flag is used in the Supplemental Database setup to determine whether the Item Number (Short) is used as a key field to supplemental 
data.

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.

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

szUnitOfMeasureUOMcharNONENONE

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

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.

jdAsOfDateASDE1JDEDATENONENONE

The date used for effectivity checking. Enter a specific date to display documents (orders, bills of material, routings, as applicable) that are 
effective on or after that date. The current system date is the default, but you can enter any future or past date.

cBillofMaterialLevelsDisplayedLVSMcharNONENONE

Select the Levels of the Bill of Material that will be displayed.

cTypeofComparisonTCOMcharNONENONE

Type type of comparison that will be performed in the Bill of Material or Parts List Comparison.

cSubassembliesIncludedSAYNcharNONENONE

This field controls whether or not subassemblies will be displayed in the Bill of Material Explosion. Valid values are:    1   Yes, 
Subassemblies will be included    0   No, Subassemblies will not be included 

cPhantomsIncludedPHANcharNONENONE

This field controls whether phantom items are displayed in a Bill of Material explosion. Valid values are:    1   Yes, Phantom items are 
included    0   No, Phantom items are not included 

szTypeBillTBMcharNONENONE

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.

mnJobnumberAJOBSMATH_NUMERICNONENONE

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

szComputerIDCTIDcharNONENONE

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.

mnQtyRequiredStandardQNTYMATH_NUMERICNONENONE

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

Related Functions

None

Related Tables

None