Skip to Content
0
Former Member
Aug 01, 2016 at 06:25 AM

Journal.lgf script overwrites previous records

150 Views

Hi experts,

I have created a Journal.lgf with script shown below:

//To close net income in income statement to current net income in retained earnings section

*XDIM_MEMBERSET VERSION = ACTUAL

*XDIM_MEMBERSET TRANSTYPE <> INC

*XDIM_MEMBERSET GROUPS = %GROUPS_SET%

*XDIM_MEMBERSET COMPANY = %COMPANY_SET%

*XDIM_MEMBERSET TPARTNER = %TPARTNER_SET%

*XDIM_MEMBERSET TIME = %TIME_SET%

*WHEN ACCOUNT

*IS BAS(NET_INCOME) //base-members of the account NET_INCOME

*REC(FACTOR=1,ACCOUNT="CURR_NI",TRANSTYPE="INC")

*ENDWHEN

Purpose: for every income statement account posted via journal entry in BPC, create an adjustment to the CURR_NI account (a Retained Earnings account in the balance sheet) for the same amount.

Basically, if the account is a base member of the NET_INCOME account (examples of these are account 6900010002 and EQTYNI_SHARE_ASS, as shown below), a record should be created in the CURR_NI account with AUDITTRAIL (TRANSTYPE in our case) INC.

ACCOUNT DIM relevant members are displayed below:

ID DESCRIPTION ACCTYPE H1 6900010002 Dividend Income INC NET_INCOME EQTYNI_SHARE_ASS Share in Net Income of Associate INC NET_INCOME NET_INCOME Net Income INC CURR_NI Current Income LEQ UNAPP_RET UNAPP_RET Unappropriated Retained Earnings LEQ

The testing went as follows:

1. Posted the first journal below:

Expected result is that, a CURR_NI account of 791,143.71 should be created since the account 6900010002 passed the WHEN/IS condition.

2. Checked the created records of the posted journal in the backend cube:

Logic script seems to be working as expected. The correct records has been written.

However, when another journal is to be posted, it seems to overwrite the CURR_NI account.

3. Posted the second journal below:

Expected result is that, a CURR_NI account of -43,392.37 should be created since the account EQTYNI_SHARE_ASS passed the WHEN/IS condition.

Total CURR_NI should now be 791,143.71 (from journal 1) and -43,392.37 (from journal 2)


4. Checked the backend cube for the created records:

The CURR_NI total is now -43,392.37.

It seems like the Journal.lgf does not APPEND the created records, instead, it OVERWRITES the previous record.

I am under the impression that the BPC Journal.lgf is executed every time a journal is posted. Therefore, previous records created by the journal and the journal.lgf should not be taken into account by another journal posted subsequently. However, that is not the case in the example above. Since the two income statement accounts will create records in the same data intersection (account CURR_NI), the system overwrites the data of the first record created with the latest data.

The BPC Journal per se works fine and appends the journal entries correctly. The issue is with the logic script which creates the CURR_NI account in an overwrite behavior.

The question is, how do I make the logic script behave as that of the BPC Journals (i.e. append records)? Any ideas?

System SP is displayed below:

Thanks in advance.

Regards,

Jen

Attachments

Journal 1.png (8.4 kB)
Cube 1.png (8.7 kB)
Journal 2.png (6.7 kB)
Cube 2.png (4.2 kB)
status.png (27.9 kB)