CacheGroupCostsCalculation

Cache Total Costs Calculation Per Group

Minor Business Rule

Object Name: B1600190

Parent DLL: CFIN

Location: Client/Server

Language: C

Business Function Specification Source Name B1600190 Designer Anna Kyazyan Data Structure  D1600190 Programmer Anna 
Knyazyan Function Name Cache Total Costs Calculation Per Group System Code 16 Function Category Cache Function Function Use Revisions Log 
Date Modifications by SAR Number Description 02/23/99 Anna Knyazyan 2631164 Created 1. Functional Description 1.1 Purpose This is 
the cache business function which is used to load the cache with F1640 records with the summarized activity costs, to roll up costs of all parent 
activities and to sequence records in parent/child structure.  The function is called from B1600200.c, also from R1640 (UBE) and P1641 to 
terminate the cache.  1.2 Setup Notes and Prerequisites 1.2 Special Logic Processing option or the flag defines the sequence of records need to 
be read from the cache: If multi-level and no selection--> retrieves all records in parent/child sequence If multi-level and selection--> retrieves 
all children of selected (or specified) activity or activities If single level (with and without selection)--> retrieves the rolled up activity costs 
While records are added to cache from F1640, the MultiLevelIndex is created for each activity.  Concatenating the individual indexes of all parent 
activities for the current activity creates the index.  That index allows to sequence records in parent/child structure. 2. Technical 
Specifications 2.1 Parameters: Data Item  Description  Required  I/O Notes ACTB  Activity Code Y  I/O Member of Cache Key 1 (F1640) PARA  Parent 
Activity Code Y  I/O Member of Cache Key 1 (F1640) LLX  Level Code   Y  I/O Member of Cache Key 1 (F1640) ACGR  Activity/Group Y  
I/O '1' = Group '0' = Activity  F1640 field MATH01  Activity Cost   Y  O Calculated field MODE  Process Mode Y  I '1' = get first record 
from the cache '2' = add the record to the cache without roll-up '6' = get the following record from the cache '7' = add the record with the roll up '8' = 
terminate cache and close cursor Used as an Input parameter for B1600190.c INT01  Number of Keys   Y I Used for partial keys, defines the 
number of members of the key used in fetching a record INT01  Index Number Y I Used in Multiple Index Caches, shows the number of 
indexes (or keys) used GENLNG  ID Cursor   Y I/O Used to store and to retrieve the cursor EV01  Return Cursor Y I/O Flag indicating whether or 
not the cursor is returned 2.2 Related Tables  Table  Table Description F1640 Activity Master File 2.3 Related Business Functions Source 
Name Function Name B1600200 F1640, F1602 Sequencing Activities 2.4 Processing  The function receives records from B1600200.c as input 
and adds them to the cache.  Add to cache is done with update.  Every time when a new record is added to the cache, the summarized cost of 
activity is rolled up to the costs of all "parents" and "grandparents.  Also while records are added to the cache a multi-level index is created. 
 The multi-level index will allow sequencing records in parent/child structure.  The multi-level index carries the information about all parents 
of an activity.  It is the second index to the cache.  To retrieve records from the cache multi-level index is used.  There are several processing 
modes that need to be passed into the function to load the cache with updating costs and to retrieve records in desired order.  B1600200.c 
defines ADD modes: If activity cost  =  0   use processing mode '2' (add without update) Else use processing mode '7' (add with update) The 
modes to read records from cache are part of the input to B1600200.c and are passed into B1600190.c.  The following four modes are possible 
to read records from the cache: /* Read all records in parent/child structure */ If ((Multi-Level Flag == 1)&& (Valid Flag == 1)&& (Mode == 
1)) Set the multi-level index  Reset the cursor   Fetches the first record Record is assigned to output data structure If ((Multi-Level Flag == 1)&& 
(Valid Flag == 1)&& (Mode == 6)) Fetches next record Record is assigned to output data structure /* Read only selected group (family) of records 
in parent/child structure */ /* Must pass in keys: Activity Code, Parent Activity Code, Level Code, Parent Level Code */ If ((Multi-Level Flag == 
1)&& (Valid Flag == 2)&& (Mode == 1)) Set the multi-level index  Reset the cursor   Fetches the first record of the group Record is assigned to 
output data structure If ((Multi-Level Flag == 1)&& (Valid Flag == 2)&& (Mode == 6)) Fetches next record If level code of fetched record is greater 
than Parent Level Code Cache Code Error = 0 Record is assigned to output data structure Else Cache Code Error = 9 /* reached end of 
group */ /* Read sinlge record from cache */ If ((Multi-Level Flag != 1)&& (Valid Flag == 0)&& (Mode == 1)) Set the multi-level index  Reset the 
cursor   Fetches a record  Record is assigned to output data structure Example of calling B1600200.c which passes all input parameters to 
B1600190.c.   VA rpt_mnCenturyFiscalYear_CENTYR  -> mnCenturyFiscalYear_CFY  (required for B1600230.c) RV ML_ACTB  <-> 
szActivityCode_ACTB RV ML_ParentCode  <-> szParentActivityCode_PARA RV ML_LevelCode  <-> mnLevelCode_LLX RV ML_ACGR  <-> 
cActivityGroup_ACGR UNDEFINED  X  mnOriginalPosting_MATH01 PO mnViewNumber_VWNM  -> mnViewNumber_VWNM (required for 
B1600230.c) PO szLedgerType_LT  -> szLedgerType_LT  (required for B1600230.c) UNDEFINED  X  szAccountId_AID UNDEFINED  X  
szBusinessUnit_MCU PO cMultiLevel_EV01  -> cFlagMultiLevel_EV01  (required for sequencing) UNDEFINED  X  cFlagOriginalPosting_EV01 PO 
mnPeriodFrom_PN  -> mnPeriodFrom_PN  (required for B1600230.c) PO mnPeriodThru_PN  -> mnPeriodThru_PN  (required for B1600230.c) "1" 
-> cProcessMode_MODE  (required for B1600190) VA rpt_mnJobNumber_JOBS  -> mnJobNumber_JOBS  (required for B1600190) VA 
rpt_cMultiLevelFlag_EV01  -> cValidFlag_EV01  (required for B1600190) VA rpt_cCacheCodeError_EV01  <-> cCacheCodeError_EV01 (required 
for B1600190) VA rpt_szErrorMessageID_DTAI  <- szErrorMessageID_DTAI "1"  -> cSuppressErrorMessages_SUPPS UNDEFINED  X  
mnEndingPosting_MATH01 UNDEFINED  X  szCostObject1_ABR1 UNDEFINED  X  cCostObjectType1_ABT1 UNDEFINED  X  
szCostObject2_ABR2 UNDEFINED  X  cCostObjectType2_ABT2 UNDEFINED  X  szCostObject3_ABR3 UNDEFINED  X  
cCostObjectType3_ABT3 UNDEFINED  X  szSubledger_SBL UNDEFINED  X  cSubledgerType_SBLT RV ML_MultiLevelID  <- szMultiLevelIndex_S11 
(pass IN when call B1600190.c in Mode 6 and Valid Flag = 2) RV ML_ActivityCost  <-> mnActivityCost_MATH01 REPORTVAR(23-21)  <-> 
szDriverCode_DRCD RV ML_ATR1  <- cActivityAttribute1_ATR1 RV ML_ATR2  <- cActivityAttribute2_ATR2 RV ML_ATR3  <- 
cActivityAttribute3_ATR3 RV ML_ATR4  <- cActivityAttribute4_ATR4 RV ML_ATR5  <- cActivityAttribute5_ATR5 RV ML_Category1  <- 
szCategoryCode1_ACC1 RV ML_Category2  <- szCategoryCode2_ACC2 RV ML_Category3  <- szCategoryCode3_ACC3 RV ML_Category4  <- 
szCategoryCode4_ACC4 RV ML_Category5  <- szCategoryCode5_ACC5 RC ML_Activity-Based Costing Description <- 
szACTBDescription_DL01 VA rpt_idCursor_GENLNG  <-> idCursor_GENLNG VA rpt_mnCurrentParent  <-> mnParentLevel_MATH01 (required if Valid Flag = 
2) UNDEFINED  X  szCostObject4_ABR4 UNDEFINED  X  cCostObjectType4_ABT4 ^

Data Structure

D1600190 - Cache Total Costs Calculation Per Group

Parameter NameData ItemData TypeReq/OptI/O/Both
szActivityCode_ACTBACTBcharOPTNONE

The aggregation of actions performed within an organization that are useful for purposes of activity-based costing.

szParentActivity_PARAPARAcharOPTNONE

 Identifies the parent of an activity. It is the mechanism used to establish activity hierarchies.

mnLevelCode_LLXLLXMATH_NUMERICOPTNONE

This identifies the lowest level in any bill of material at which a particular component may appear..

cActivityGroup_ACGRACGRcharOPTNONE

This field indicates whether this entry in the Activity Master is a single activity or a group of activities, such as subprocesses.

mnActivityCost_MATH01MATH01MATH_NUMERICOPTNONE

- - - Good Performance Low Value. 

cProcessMode_MODEMODEcharOPTNONE

The processing mode used in Purchase Order Consolidator to signify when specific orders are being processed.

cSuppressErrorMessages_SUPPSSUPPScharOPTNONE

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.

nNumberOfKeys_INT01INT01integerOPTNONE

Number of Days in Future to Query for Responses Due. 

szErrorMessageID_DTAIDTAIcharOPTNONE

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.

mnJobNumber_JOBSJOBSMATH_NUMERICOPTNONE

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

idCursor_GENLNGGENLNGIDOPTNONE

General purpose ID variable.

cReturnCursor_EV01EV01charOPTNONE

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

cValidFlag_EV01EV01charOPTNONE

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

cCacheCodeError_EV01EV01charOPTNONE

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

nIndexNumber_INT01INT01integerOPTNONE

Number of Days in Future to Query for Responses Due. 

szMultiLevelIndex_S11S11charOPTNONE

User Defined Codes (10 separate codes are allowed) which can be used to generate selective reporting based on user assigned values 
of these codes.

szDriverCode_DRCDDRCDcharOPTNONE

A code that identifies drivers within the Advanced Cost Accounting system.

cActivityAttribute1_ATR1ATR1charOPTNONE

One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
activities versus non-mission related activities. Attributes are user defined codes (system 16, types 6 through 10).

cActivityAttribute2_ATR2ATR2charOPTNONE

One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
activities versus non-mission related activities. Attributes are user defined codes (system 16, types 6 through 10).

cActivityAttribute3_ATR3ATR3charOPTNONE

One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
activities versus non-mission related activities. Attributes are user defined codes (system 16, types 6 through 10).

cActivityAttribute4_ATR4ATR4charOPTNONE

One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
activities versus non-mission related activities. Attributes are user defined codes (system 16, types 6 through 10).

cActivityAttribute5_ATR5ATR5charOPTNONE

One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
activities versus non-mission related activities. Attributes are user defined codes (system 16, types 6 through 10).

szCategoryCode1_ACC1ACC1charOPTNONE

One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
based on specific characteristics. For example, assign codes that identify customer-related activities versus product-related activities. 
Category codes are user defined (system 16, types 11 through 15).

szCategoryCode2_ACC2ACC2charOPTNONE

One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
based on specific characteristics. For example, assign codes that identify customer-related activities versus product-related activities. 
Category codes are user defined (system 16, types 11 through 15).

szCategoryCode3_ACC3ACC3charOPTNONE

One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
based on specific characteristics. For example, assign codes that identify customer-related activities versus product-related activities. 
Category codes are user defined (system 16, types 11 through 15).

szCategoryCode4_ACC4ACC4charOPTNONE

One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
based on specific characteristics. For example, assign codes that identify customer-related activities versus product-related activities. 
Category codes are user defined (system 16, types 11 through 15).

szCategoryCode5_ACC5ACC5charOPTNONE

One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
based on specific characteristics. For example, assign codes that identify customer-related activities versus product-related activities. 
Category codes are user defined (system 16, types 11 through 15).

szCostObject1_ABR1ABR1charOPTNONE

A cost object code, such as an equipment item number or an address book number. If you enter a cost object code, you must also specify 
the cost object type. This field functions the same and is validated the same as the subledger field, but the system does not post the data in 
the cost object code field to the Account Balances file (F0902).

cCostObjectType1_ABT1ABT1charOPTNONE

A code that specifies the type of cost object and the type of editing. Valid types are stored in the Cost Object Types table (F1620) and can 
be added or modified using the Cost Object Types program (P1620).

szCostObject2_ABR2ABR2charOPTNONE

A cost object code, such as an equipment item number or an address book number. If you enter a cost object code, you must also specify 
the cost object type. This field functions the same and is validated the same as the subledger field, but the system does not post the data in 
the cost object code field to the Account Balances file (F0902).

cCostObjectType2_ABT2ABT2charOPTNONE

A code that specifies the type of cost object and the type of editing. Valid types are stored in the Cost Object Types table (F1620) and can 
be added or modified using the Cost Object Types program (P1620).

szCostObject3_ABR3ABR3charOPTNONE

A cost object code, such as an equipment item number or an address book number. If you enter a cost object code, you must also specify 
the cost object type. This field functions the same and is validated the same as the subledger field, but the system does not post the data in 
the cost object code field to the Account Balances file (F0902).

cCostObjectType3_ABT3ABT3charOPTNONE

A code that specifies the type of cost object and the type of editing. Valid types are stored in the Cost Object Types table (F1620) and can 
be added or modified using the Cost Object Types program (P1620).

szSubledger_SBLSBLcharOPTNONE

A code that identifies a detailed, auxiliary account within a general ledger account. A subledger can be an equipment item number or an 
address book number. If you enter a subledger, you must also specify the subledger type.

cSubledgerType_SBLTSBLTcharOPTNONE

A user defined code (00/ST) that is used with the Subledger field to identify the subledger type and how the system performs subledger 
editing. On the User Defined Codes form, the second line of the description controls how the system performs editing. This is either hard-coded 
or user defined. Valid values include: A Alphanumeric field, do not edit   N Numeric field, right justify and zero fill   C Alphanumeric field, right 
justify and blank fill  

szBusinessUnit_MCUMCUcharOPTNONE

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.

szAccountId_AIDAIDcharOPTNONE

A number that the system assigns to each general ledger account in the Account Master table (F0901) to uniquely identify it. 

szACTBDescription_DL01DL01charOPTNONE

A user defined name or remark.

mnParentLevel_MATH01MATH01MATH_NUMERICOPTNONE

- - - Good Performance Low Value. 

Related Functions

None

Related Tables

F1640 Activity Master File