DetermineCoByProduct

Determine CoBy Product

Minor Business Rule

Object Name: B3400340

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This function is to be used to determine if  an item is considered a co or by product.  For the 
selected Item Number and Branch/Plant, three optional files are checked.  They include Bill of Materials 

(F3002), Rate Based (F3104), and Shop Floor (F3111).


1.1Purpose
The purpose of this business function is to determine if an item/branch is a co or by product.  A 
flag will be returned to the calling application to specify if a co (C) or by (B).


1.2Setup Notes and Prerequisites

The use of this business function is for determining the type of product.  The files that need 
checked may or may not exist on the client machine.

• By Item and Branch/Plant
• Optional files
• C or B

1.3Special Logic

This business function will need to allow for files not to exist.  When processing F3002, RPG used 
access path F3002LI.  COBY = 'C' and TBM = 'M' for initial SETLL.  If not valid, COBY is changed to B 

and SETLL is performed again.  For F3104, RPG used access path F3104LG with COBY = 'C'.  If not valid, 

COBY is changed to 'B'.  For F3111, RPG used access path F3111LG with COBY = 'C'.  If not valid, COBY 

is changed to 'B'.  In all checks, if the previous check was successful, the remaining SETLL's were not 

performed.  If successful in any SETLL's the flag $$COBY is set to '1'.


2.Technical Specifications

This section describes detailed processing in structured English.  This includes any error messages 
used.

Main Processing :

initialize CoOrByProduct to a blank
initialize Error Message ID to a blank

Search Table F3002

if Error Message ID is not blank or CoOrByProduct is a blank

Search Table F3104

if Error Message ID is not blank or CoOrByProduct is a blank

Search Table F3111


Search Table F3002:

Open Table F3002

if Open Table fails

set error message to 3143

else 

set  IXKIT to Short Item Number

set IXMMCU to Cost Center

set IXTBM to 'M'

set IXCOBY to 'C'

Fetch Record

if Fetch fails

set IXCOBY to 'B'

Fetch Record

if Fetch fails

set output Co Or By Product to a blank

else Fetch on B succeeds

set uoput Co Or By Products to 'B'

else Fetch on C succeeds

set output Co Or By Product to 'C'

Close Table

return


Search Table F3104:

set Error Message Id to a blank

Open Table F3104

if Open Table fails 

set error message to  3143

else 

set  IPITM to Short Item Number

set IPMMCU to Cost Center

set IPCOBY to 'C'

Fetch Record

if Fetch fails

set IPCOBY to 'B'

Fetch Record

if Fetch fails

set output Co Or By Product to a blank

else Fetch on B succeeds

set uoput Co Or By Products to 'B'

else Fetch on C succeeds

set output Co Or By Product to 'C'

Close Table

return


Search Table F3111:

set Error Message Id to a blank

Open Table F3111

if Open Table fails

set error message 3143

else 

set  WMCPIT to Short Item Number

set WMCMCU to Cost Center

set WMCOBY to 'C'

Fetch Record

if Fetch fails

set WMCOBY to 'B'

Fetch Record

if Fetch fails

set output Co Or By Product to a blank

else Fetch on B succeeds

set uoput Co Or By Products to 'B'

else Fetch on C succeeds

set output Co Or By Product to 'C'

Close Table

return



^

Data Structure

D3400340 - Determine CoBy Product


Data Item Data Structure DescriptionI/ORequiredNotes

ITM           Short Item                         IYes

MCU            Cost Center                        IYes

EV01            Suppress Error Messages            IYes      1 = Suppress run time error 

message                                                                                                 

                                                handling 0 = Allow run time error                     

                                                    message handling

DTAI            Error Message ID                  ONo 

EV02            Co or By Product                  OYes      C = Co Product B = By Product 

' '= No                                                                         Records Found


^

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

szCostCenterMCUcharNONENONE

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.

cSuppressErrorMessageEV01charNONENONE

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

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.

cCoOrByProductEV02charNONENONE

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

Related Functions

None

Related Tables

F3002 Bill of Material Master File
F3111 Work Order Parts List