CalculateOptionalAddonComputatio

Calculate Optional Add on Computations

Major Business Rule

Object Name: B3000390

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose


To calculate the "optional add on computations" for a cost type.  This business function will return 

the factors and rates used, along with the new calculated amount - simulated manufactured cost.


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 section should be used when additional logic is used in the Business Function for application 

specific functionality or exceptional situations.


2.Technical Specifications


2.4Processing 


If function called in mode '2'

destroy linked list FC and linked list RC.

end function processing



Process Factor Code and Factor first.

1.0  Get DS XSF - Factor value:

1.a.  if DS XSFC - Factor Code is blank, DS XSF - factor to use becomes what was passed into 
the BF in DS XSF- Factor and you skip processing 2.0.

1.b.  if DS XSFC - Factor Code is not blank, process 2.0.


2.0  Determine where to get DS XSF - factor, based on what is in DS XSFC - factor code:

2.a  Edit DS XSFC - factor code by determining if a '*' or '&' is in the first position (i.e. 
*B2).  If this is the case, you must separate the '*' or '&' from the rest of the field. (i.e. 

*B2 becomes '*' and 'B2') and you will process either 2.b or 2.c, if this is not the case you can 

skip to 2.e.  The portion that does not have the '&' or '*' becomes the COST to use for the 

fetch in 2.b, or 2.c but leave DS XSFC as it was.


2/1.b if mode is a '1' do the following:

If first character of DS XSFC is a '*' or '&'

look up the COST in the linked list CT passed in

(linked list CT structure contains COST)


if the COST is found in the linked list

(linked list AM structure contains COST, XSMC, XSCR)

(linked list AR strucutre contains COST, XSMC, XSCR)

if the first character of DS XSFC is '*

get XSMC amount from linked list AM for COST

move XSMC amount from linked list AM into DS XSF - Factor

else

get XSCR amount from linked list AR for COST

move XSCR amount from linked list AR into DS XSF - Factor

end

end

end


2/1.c if mode is a '1'

if first character of DS XSFC is not a '*' and not a '#'

look up DS XSFC in linked list FC

(linked list FC structure contains DS XSFC, DS XSF)

if DS XSFC is found in the linked list, set DS XSF - factor

to XSF from the list.

end

if DS XSFC was not found in linked list FC2.e
Fetch factor from Generic Rate table F00191, with '30'

SY, 'CF' RT, and DS XSFC

Set DS XSF- Factor to the RATE column from F00191 

table

Set a work flag to indicate that a fetch was made to

this table

If the fetch failed the DS XSF - factor is set to 

zeros

add DS XSFC and DS XSF to linked list FC.

end

end


If mode not equal '1'

2/2.b  If first character of DS XSFC is a '*':
Fetch factor from Cost Components table F30026, with DS ITM, DS MMCU, blanks in LOCN, blanks in 

LOTN, COST, DS LEDG.  After the record is fetched, set DS XSF - Factor = the "net added" XSMC 

column of the record just fetched.


2/2.c  If first character of DS XSFC is a '#':

Fetch factor from Cost Components table F30026, with DS ITM, DS MMCU, blanks in LOCN, blanks in 

LOTN, COST, DS LEDG.  After the record is fetched, set DS XSF - Factor = the "total" XSCR 

column of the record just fetched.


2/2.d  If the fetch in 22.b or 22.c failed, force processing of 2/2.e.

2/2.e  If first character of DS XSFC is not a '*' or '#', or if forced through 2/2.d:

Fetch factor from Generic Rate table F00191, with '30' SY, 'CF' RT, and DS XSFC.  Set DS XSF- 

Factor to the RATE column from F00191 table.  Set a work flag to indicate that a fetch was made 

to this table.  If the fetch failed the DS XSF - factor is left to what was passed in and error 

will be processed in returns section.

end processing mode not equal to '1'



Process Rate Code and Rate second.

1.0  Get DS XSR - Rate value:

1.a.  if DS XSRC - Rate Code is blank, DS XSR - rate to use becomes what was passed into the BF 
in DS XSR- Rate and you skip processing 2.0.

1.b.  if DS XSRC - Rate Code is not blank, process 2.0.


2.0  Determine where to get DS XSR - rate, based on what is in DS XSRC - rate code:

2.a  Edit DS XSRC - rate code by determining if a '*' or '#' is in the first position (i.e. 
*B2).  If this is the case, you must separate the '*' or '#' from the rest of the field. (i.e. *B2 

becomes '*' and 'B2'). and you will process either 2.b or 2.c, if this is not the case you can 

skip to 2.e.  The portion that does not have the '#' or '*' becomes the COST to use for the fetch 

in 2.b, or 2.c but leave DS XSRC as it was.


2/1.b if mode is a '1' do the following:

If first character of DS XSRC is a '*' or '#'

look up the COST in the linked list CT passed in

(linked list CT structure contains COST)


if the COST if found in the linked list

(linked list AM structure contains COST, XSMC, XSCR)

(linked list AR strucutre contains COST, XSMC, XSCR)

if the first character of DS XSRC is '*

get XSMC amount from linked list AM for COST

move XSMC amount from linked list AM into DS XSR - Rate

else

get XSCR amount from linked list AR for COST

move SXCR amount from linked list AR into DS XSR - Rate

end

end

end


2/1.c if mode is a '1'

if first character of DS XSRC is not a '*' and not a '#'

look up DS XSRC in linked list RC

(linked list FC structure contains DS XSRC, DS XSR)

if DS XSRC is found in the linked list, set DS XSR- rate 

to XSR from the list.

end

if DS XSRC was not found in linked list FC2.e
Fetch rate from Generic Rate table F00191, with '30' 

SY, 'CR' RT, and DS XSRC

Set DS XSR- Rate to the RATE column from F00191 table

Set a work flag to indicate that a fetch was made to

this table

If the fetch failed the DS XSR - rate is set to zeros

add DS XSRC and DS XSR to linked list RC.

end

end


If mode not equal '1'

2/2.b  If first character of DS XSRC is a '*':
Fetch factor from Cost Components table F30026, with DS ITM, DS MMCU, blanks in LOCN, blanks in 

LOTN, COST, DS LEDG.  After the record is fetched, set DS XSR - rate = the "net added" XSMC 

column of the record just fetched.


2/2.c  If first character of DS XSRC is a '#':

Fetch factor from Cost Components table F30026, with DS ITM, DS MMCU, blanks in LOCN, blanks in 

LOTN, COST, DS LEDG.  After the record is fetched, set DS XSR - rate = the "total" XSCR column 

of the record just fetched.


2/2.d  If the fetch in 2.b or 2.c failed, force processing of 2.e.

2/2.e  If first character of DS XSRC is not a '*' or '#', or if forced from 2.d:
Fetch rate from Generic Rate table F00191, with '30' SY, 'CR' RT, and DS XSRC.  Set DS XSR - 

Rate to the RATE from F00191 table.  Set a work flag to indicate that a fetch was made to this 

table.  If the fetch failed the DS XSR - rate is left to what was passed in and error will be 

processed in returns section.

end mode processing not equal '1'



if mode equal '1' then do not do the following extra check and always process 3.0

Process 3.0 only if all fetches have been successful.  If any unsuccessful fetches, then set 

appropriate errors as specified in the returns section.


3.0  Calculate:  Amount - Simulated Manufactured Cost:


If DS XSF - Factor NE zeros

OR DS XSR - Rate NE zeros




















Retrievals:

Generic Rate Types F00191:

System CodeSY

 User Defined CodeRT

 Factor or Rate CodeKY


Cost Components File F30026:

Item number shortITM

Cost CenterMMCU

LocationLOCN

Lot numberLOTN

Cost MethodLEDG

Cost TypeCOST




Returns:

1.)  Return the DS XSFC - factor code.  If the fetch to F00191 table failed, 

SetGBRError '1043' and error on factor code field.

2.)  Return the DS XSF - factor used.

3.)  Return the DS XSRC - rate code.  If the fetch to F00191 table failed, SetGBRError '1043' 

and error on rate code field.

4.)  Return the DS XSR - rate used.

5.)  Return Amount - simulated Manufactured cost.


Data Structure

D3000390 - Calculate Optional Add on Computations

Parameter NameData ItemData TypeReq/OptI/O/Both
szCostCenterMMCUcharNONENONE

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.

mnItemNumberShortITMMATH_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

szCostTypeCOSTcharNONENONE

A code that designates each element of cost for an item. Examples of the cost object types are:   o  A1  Purchased raw material   o  B1  
Direct labor routing rollup   o  B2  Setup labor routing rollup   o  C1  Variable burden routing rollup   o  C2  Fixed burden routing rollup   o  Dx  Outside 
operation routing rollup   o  Xx  Extra add-ons, such as electricity and water  The optional add-on computations usually operate with the type 
Xx extra add-ons. This cost structure allows you to use an unlimited number of cost components to calculate alternative cost rollups. The 
system then associates these cost components with one of six user defined summary cost buckets.

szCostMethodLEDGcharNONENONE

A user defined code (40/CM) that specifies the basis for calculating item costs. Cost methods 01 through 19 are reserved for J.D. Edwards 
use.

mnFactorSimXSFMATH_NUMERICNONENONE

A generic factor used to calculate data for standard cost component extras.

szRateCodeSimXSRCcharNONENONE

A user defined code (system 30, type CR) used to retrieve rate information from the Generic Rate table (F00191). This value is used in 
conjunction with the Factor Code and Factor Amount fields to calculate extra costs (electricity, taxes, tooling changes, and so on).

mnRateSimXSRMATH_NUMERICNONENONE

A generic rate used to calculate extra costs, such as electricity and taxes.

mnAmountSimManufacturedXSMCMATH_NUMERICNONENONE

Used to calculate cost during the simulation process.

cSuppressErrorMessageEV01charNONENONE

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

szErrorCodeDTAIcharNONENONE

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.

szFactorCodeSimXSFCcharNONENONE

A user defined code (system 30, type CF) used to retrieve factor information from the Generic Rate table (F00191). This value is used in 
conjunction with the Rate Code and Rate Amount fields to calculate extra costs (electricity,taxes, tooling changes, and so on).

szWorkCenterMCUcharOPTNONE

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.

mnJobnumberJOBSMATH_NUMERICOPTNONE

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

Related Functions

B9800088 Retrieve and Format User Defined Codes
B9800500 F0019 Get Generic Rates Type

Related Tables

F00191 Generic Message/Rates
F30026 Item Cost Component Add-Ons