Skip to Content
avatar image
Former Member

Report using FOX code - FOX code problem

My requriment is to repost the data in real time info providers .

For Eg: my transaction data in real time cube1 is as follows:

ccneter | division | sub-division | amount

a00001,| 1234, | 1111 | 3000

division and sub-division are attributes of ccenter.

master data for the cost center has been changed as below by end users:

ccneter | division | sub-division |

a00001,| 6789, | 2222 |

Now my requirement is to repost with new master data alignment using the below FOX code:

*****************************************************************

DATA CC_IC TYPE 0COSTCENTER.

DATA DIV TYPE ZDIV.

DATA DIV_M TYPE ZDIV.

DATA SUBDIV TYPE ZSUBDIV.

DATA SUBDIV_M TYPE ZSUBDIV.

CC_IC = VARV(SV_0COSTCENTER).

FOREACH CC_IC.

FOREACH DIV , SUBDIV.

DIV_M = ATRV(ZDIV, CC_IC).

SUBDIV_M = ATRV(ZSUBDIV, CC_IC).

{ZAMOUNT , CC_IC, DIV_IC, MET_IC'} =

{ZAMOUNT , CC_IC, DIV_M, MET_M'} =

ENDFOR.

ENDFOR.

************************************************************************************

After executing the above code , that particular record is set to zero in the cube as below:

ccneter | division | sub-division | amount

a00001,| 1234, | 1111 | 3000

a00001,| 1234, | 1111 | -3000

my requirement is to obtain is as below :

ccneter | division | sub-division | amount

a00001,| 1234, | 1111 | 3000

a00001,| 1234, | 1111 | -3000

a00001,| 6789, | 2222 | 3000

Please help me tuning my fox code to my requrement.

Thanks in advance.

Regards,

veera

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Sep 20, 2010 at 02:58 PM

    Hi

    You can use standard repost function with charecterstics relationship. It is quite simple to achive your requirement.

    You have to set up characteristics relationship at Planning area level (Source is Cost center and target are Division and Sub-Division) and create a PF of type Repost (Char Relationship). Select your division and sub division as field to be changed.

    Thanks,

    SAC

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Pratyush Panda

      Hi,

      As per my understaning your Master data for cost center has been changed with new attribute values.

      Please ensure you have not used any where costcenter,divsion,and sub division in any characteristic relationship,else system will not allow you to post data by validating master data.

      Secondly you can use the code suggested above with a small change .As I think costcenter you have captured using ATRV should be cross checked in foreach to ensure we are changing data for correct cost center

      DATA CC_IC TYPE 0COSTCENTER.

      DATA CC_ICL TYPE 0COSTCENTER.

      DATA DIV TYPE ZDIV.

      DATA DIV_M TYPE ZDIV.

      DATA SUBDIV TYPE ZSUBDIV.

      DATA SUBDIV_M TYPE ZSUBDIV.

      CC_IC = VARV(SV_0COSTCENTER).

      FOREACH CC_ICL.

      IF CC_ICL = CC_IC.

      FOREACH DIV , SUBDIV.

      DIV_M = ATRV(ZDIV, CC_IC).

      SUBDIV_M = ATRV(ZSUBDIV, CC_IC).

      {ZAMOUNT , CC_IC, DIV_M, SUBDIV_M} =

      {ZAMOUNT , CC_IC, DIV , SUBDIV} =

      {ZAMOUNT , CC_IC, DIV , SUBDIV} = 0.

      ENDFOR.

      ENDIF.

      ENDFOR.