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
						^
D1600190 - Cache Total Costs Calculation Per Group
| Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both | 
|---|---|---|---|---|
| szActivityCode_ACTB | ACTB | char | OPT | NONE | 
The aggregation of actions performed within an organization that are useful for purposes of activity-based costing.  | ||||
| szParentActivity_PARA | PARA | char | OPT | NONE | 
Identifies the parent of an activity. It is the mechanism used to establish activity hierarchies.  | ||||
| mnLevelCode_LLX | LLX | MATH_NUMERIC | OPT | NONE | 
This identifies the lowest level in any bill of material at which a particular component may appear..  | ||||
| cActivityGroup_ACGR | ACGR | char | OPT | NONE | 
This field indicates whether this entry in the Activity Master is a single activity or a group of activities, such as subprocesses.  | ||||
| mnActivityCost_MATH01 | MATH01 | MATH_NUMERIC | OPT | NONE | 
- - - Good Performance Low Value.  | ||||
| cProcessMode_MODE | MODE | char | OPT | NONE | 
The processing mode used in Purchase Order Consolidator to signify when specific orders are being processed.  | ||||
| cSuppressErrorMessages_SUPPS | SUPPS | char | OPT | NONE | 
A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.
       0 = allow 
  | ||||
| nNumberOfKeys_INT01 | INT01 | integer | OPT | NONE | 
Number of Days in Future to Query for Responses Due.  | ||||
| szErrorMessageID_DTAI | DTAI | char | OPT | NONE | 
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 
  | ||||
| mnJobNumber_JOBS | JOBS | MATH_NUMERIC | OPT | NONE | 
The job number (work station ID) which executed the particular job.  | ||||
| idCursor_GENLNG | GENLNG | ID | OPT | NONE | 
General purpose ID variable.  | ||||
| cReturnCursor_EV01 | EV01 | char | OPT | NONE | 
An option that specifies the type of processing for an event.  | ||||
| cValidFlag_EV01 | EV01 | char | OPT | NONE | 
An option that specifies the type of processing for an event.  | ||||
| cCacheCodeError_EV01 | EV01 | char | OPT | NONE | 
An option that specifies the type of processing for an event.  | ||||
| nIndexNumber_INT01 | INT01 | integer | OPT | NONE | 
Number of Days in Future to Query for Responses Due.  | ||||
| szMultiLevelIndex_S11 | S11 | char | OPT | NONE | 
User Defined Codes (10 separate codes are allowed) which can be used to generate selective reporting based on user assigned values 
  | ||||
| szDriverCode_DRCD | DRCD | char | OPT | NONE | 
A code that identifies drivers within the Advanced Cost Accounting system.  | ||||
| cActivityAttribute1_ATR1 | ATR1 | char | OPT | NONE | 
One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
  | ||||
| cActivityAttribute2_ATR2 | ATR2 | char | OPT | NONE | 
One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
  | ||||
| cActivityAttribute3_ATR3 | ATR3 | char | OPT | NONE | 
One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
  | ||||
| cActivityAttribute4_ATR4 | ATR4 | char | OPT | NONE | 
One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
  | ||||
| cActivityAttribute5_ATR5 | ATR5 | char | OPT | NONE | 
One of five attributes used to identify specific characteristics of activities. For example, assign attributes that identify mission-related 
  | ||||
| szCategoryCode1_ACC1 | ACC1 | char | OPT | NONE | 
One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
  | ||||
| szCategoryCode2_ACC2 | ACC2 | char | OPT | NONE | 
One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
  | ||||
| szCategoryCode3_ACC3 | ACC3 | char | OPT | NONE | 
One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
  | ||||
| szCategoryCode4_ACC4 | ACC4 | char | OPT | NONE | 
One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
  | ||||
| szCategoryCode5_ACC5 | ACC5 | char | OPT | NONE | 
One of five reporting codes that you can assign to an activity, process,subprocess, etc. Use these codes to classify activities for reporting 
  | ||||
| szCostObject1_ABR1 | ABR1 | char | OPT | NONE | 
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 
  | ||||
| cCostObjectType1_ABT1 | ABT1 | char | OPT | NONE | 
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 
  | ||||
| szCostObject2_ABR2 | ABR2 | char | OPT | NONE | 
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 
  | ||||
| cCostObjectType2_ABT2 | ABT2 | char | OPT | NONE | 
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 
  | ||||
| szCostObject3_ABR3 | ABR3 | char | OPT | NONE | 
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 
  | ||||
| cCostObjectType3_ABT3 | ABT3 | char | OPT | NONE | 
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 
  | ||||
| szSubledger_SBL | SBL | char | OPT | NONE | 
A code that identifies a detailed, auxiliary account within a general ledger account. A subledger can be an equipment item number or an 
  | ||||
| cSubledgerType_SBLT | SBLT | char | OPT | NONE | 
A user defined code (00/ST) that is used with the Subledger field to identify the subledger type and how the system performs subledger 
  | ||||
| szBusinessUnit_MCU | MCU | char | OPT | NONE | 
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
  | ||||
| szAccountId_AID | AID | char | OPT | NONE | 
A number that the system assigns to each general ledger account in the Account Master table (F0901) to uniquely identify it.  | ||||
| szACTBDescription_DL01 | DL01 | char | OPT | NONE | 
A user defined name or remark.  | ||||
| mnParentLevel_MATH01 | MATH01 | MATH_NUMERIC | OPT | NONE | 
- - - Good Performance Low Value.  | ||||
| None | 
| F1640 Activity Master File |