Skip to Content
0
Feb 24, 2021 at 09:21 PM

Aggregation in Fox Formula

120 Views Last edit Feb 24, 2021 at 09:22 PM 2 rev

Hi,

Here is my requirement:

step1: Load actuals to planning ADSO.

Each GL account has a planning account associated with it. One planning GL can have many actuals GL accounts

step2: In the fox formula, Planning GL needs to be derived from GL master data and load it into the ADSO.

I have written the fox code and the code is validated in DEV multiple times. When the code is moved to QA, If I execute the planning sequence via RSPLAN, data is saved without any issue. When I execute the sequence using AO, BW is going to the Hanging mode and eventually timing out.

Any help is appreciated.

Fox Code:

* constants
V_VERSN = 'ACTUAL'.
V_AREA = 'STD'.
V_AREA_TO = 'DNU_004'.

V_AMT = 0.
V_AMT_U = 0.

FOREACH V_PLGLA IN REFDATA.
V_VERSN_TO = VARV( ZPLVERSN_M_S_V001 ).
V_PLNGLA = ATRV( ZPLPLNGLA, V_PLGLA ).
V_AMT_T = 0.
V_AMT = 0.
V_AMT_U = 0.
V_AMT_UT = 0.

FOREACH V_PLGLA IN REFDATA.

V_PLNGLA1 = ATRV( ZPLPLNGLA, V_PLGLA ).

IF V_PLNGLA1 = V_PLNGLA.
V_AMT_T = { ZAMT_LC, V_AREA, V_PLGLA, V_VERSN }.
V_AMT = V_AMT_T + V_AMT.

V_AMT_UT = { ZUSD_AMT, V_AREA, V_PLGLA, V_VERSN }.
V_AMT_U = V_AMT_UT + V_AMT_U.

ENDIF.

{ ZAMT_LC, V_AREA_TO, V_PLNGLA, V_VERSN_TO } = V_AMT.
{ ZUSD_AMT, V_AREA_TO, V_PLNGLA, V_VERSN_TO } = V_AMT_U.

ENDFOR.
ENDFOR.