Académique Documents
Professionnel Documents
Culture Documents
Issue: The current architecture of Group Account Numbers supports mapping only the Natural
Account segment values to a Group Account Number. It doesnt support mapping multiple charts
of accounts (COA) segments to Group Account Number.
Code Fix:
In order to achieve this, the following changes have to be made to the code. For a single chart of
accounts configuration, refer to the steps given below. In case you have a multiple chart of accounts
configuration, in addition to these refer to the extra steps given in section 2.
For example FROM ACCT & TO ACCT will be for natural account, FROM SEG1 & TO SEG1 is
for cost center and FROM SEG2 & TO SEG2 is for Balancing Segment. Assign the Group
Account Numbers accordingly.
d. Save the file. The file after your changes should something like the one given below.
ODI Changes:
Source and target table changes:
1. Since we are adding new columns in the source file, the corresponding table definition in ODI
needs to be modified reflect these changes.
a.
b.
c.
d.
e.
f.
a.
b.
c.
d.
e.
f.
3. Apply the same DDL change(s) manually to the underlying Data warehouse
database if necessary.
ALTER TABLE W_ORA_GROUP_ACCOUNT_NUM_D_TMP ADD(FROM_SEG1
VARCHAR2(30 CHAR), TO_SEG1 VARCHAR2(30), FROM_SEG2 VARCHAR2(30),
TO_SEG2 VARCHAR2(30));
FILE_GROUP_ACCT_NUM.FROM_ACCT_NUM||'~'||
FILE_GROUP_ACCT_NUM.FROM_SEG1||'~'||
FILE_GROUP_ACCT_NUM.FROM_SEG2).
10. Modify the filter condition to include the new columns being mapped as follows:
16. Modify the expression to include the additional joins (conditions) to account for the two new
account segment ranges that we are planning to include as follows:
Assumptions in the example:
In the below join expression(s), it is assumed that FROM_SEG1 & TO_SEG1 contains segment
values that are mapped to SEG1 in the file_glacct_segment_config_ora.csv file. Similarly
FROM_SEG2 & TO_SEG2 contains segment values that are mapped to SEG2 in the csv file.
Hence the 2 join conditions below use the columns LKP_HIER_CONFIG.SEG1 &
LKP_HIER_CONFIG.SEG2 respectively. You need to use appropriate column(s) for the join
condition depending on which segment column in the file_glacct_segment_config_ora.csv file
that the ranges you are providing fall into.
For example, if FROM_SEG1 & TO_SEG1 contains segment values that fall into SEG5 in the
file_glacct_segment_config_ora.csv file, use LKP_HIER_CONFIG.SEG5 instead of
LKP_HIER_CONFIG.SEG1 in the below example.
However, if you are providing ranges for "Cost Center" or "Balancing Segment" segments,
then instead of LKP_HIER_CONFIG.SEG1/LKP_HIER_CONFIG.SEG2, you need to use the
columns COST_CENTER_NUM & BALANCING_SEGMENT_NUM respectively.
Lets take an example where you have 3 COAs. For COA 101, the group account number is
determined using natural account, cost center and balancing segment. For COA 102, its based
on natural account and cost center. For COA 103, its based on natural account only. That means,
you have 3 distinct segments (natural account, cost center, balancing segment) among all the 3
COAs that are used for group account number derivation. So, have 3 pairs of range columns in
the file, as shown below. Designate one pair of range to one segment - for example, FROM ACCT
& TO ACCT is for natural account, FROM SEG1 & TO SEG1 is for cost center, and FROM SEG2
& TO SEG2 is for balancing segment.
In step c, when you are defining the ranges, fill the ranges that are applicable for the COA and
use a default value (such as NA) for the range which is not relevant for a particular COA. In this
example, you will populate all 3 ranges for COA 101, FROM ACCT, TO ACCT & FROM SEG1, TO
SEG1 for COA 102 and just FROM ACCT, TO ACCT for COA 103 and populate the default value
for the remaining ranges, as illustrated in the screenshot below.
Note: Use a default value that wouldnt be a valid segment value. For example, if you happen to
have a segment which has NA as a valid value, then you cannot use NA but pick something else.
You will be using the same default value you pick here in one of the ODI mapping changes
explained in later sections.
ODI Changes:
All the steps (1-15) mentioned above for single chart of account configuration would remain the
same.
For Step 16 above the new join expression should now consider the above scenario where some
of the segment ranges are not applicable for various chart of accounts. So, the new join
expression for the above scenario is as follows:
NEW Join Expression:
TO_CHAR(SQ_BCI_GL_ACCOUNTS.CHART_OF_ACCOUNTS_ID)=
LKP_W_ORA_GROUP_ACNT_NUM_D_TMP.CHART_OF_ACCOUNTS_ID
AND #DATASOURCE_NUM_ID=LKP_W_ORA_GROUP_ACNT_NUM_D_TMP.DATASOURCE_NUM_ID
/* set to 'NA' for COAs that dont use from_seg1 and to_seg1 range */
CASE WHEN TO_CHAR(SQ_BCI_GL_ACCOUNTS.CHART_OF_ACCOUNTS_ID) IN ('103') THEN 'NA' ELSE
CASE
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT1' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT1
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT2' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT2
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT3' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT3
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT4' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT4
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT5' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT5
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT6' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT6
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT7' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT7
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT8' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT8
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT9' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT9
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT10' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT10
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT11' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT11
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT12' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT12
WHEN LKP_HIER_CONFIG.SEG1 = 'SEGMENT13' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT13
/* set to 'NA' for COAs that dont use from_seg2 and to_seg2 range */
CASE WHEN TO_CHAR(SQ_BCI_GL_ACCOUNTS.CHART_OF_ACCOUNTS_ID) IN ('102','103') THEN 'NA' ELSE
CASE
WHEN LKP_HIER_CONFIG.SEG2 = 'SEGMENT1' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT1
WHEN LKP_HIER_CONFIG.SEG2 = 'SEGMENT2' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT2
WHEN LKP_HIER_CONFIG.SEG2 = 'SEGMENT3' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT3
WHEN LKP_HIER_CONFIG.SEG2 = 'SEGMENT4' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT4
WHEN LKP_HIER_CONFIG.SEG2 = 'SEGMENT5' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT5
WHEN LKP_HIER_CONFIG.SEG2 = 'SEGMENT6' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT6
WHEN LKP_HIER_CONFIG.SEG2 = 'SEGMENT7' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT7
WHEN LKP_HIER_CONFIG.SEG2 = 'SEGMENT8' THEN SQ_BCI_GL_ACCOUNTS.SEGMENT8