Skip to Content
0
Former Member
Apr 15, 2014 at 02:40 PM

Write back Badi

33 Views

HI Everyone,

We have developed Write Back Badi, Which does distribution values equally at two different Parent level (Entity, Product) and all other base members and working fine

Actually there are some accounts we have called percentage rate accounts.

If I plan at this all rate accounts against Parent level and all base members. It has to distribute the same value to all Base members and should not roll up.


Ex: If I plan 4% value at any rate account against parent level, Then BAdi has to be distribute same 4% value to all base members and Value of Rate account is same 4%, So it should not be the roll up


I used below code to distribute same value to all base members for specific accounts and account is getting roll up.


Please let me know how to solve this issues.


"IF SPD_account is anything other than the accounts below then ELSE part will be executed

IF <zlf_chk> = 'Drivers_001_01_N' OR <zlf_chk> = 'Drivers_002_01_N' OR <zlf_chk> = 'Driver_003_01N' OR <zlf_chk> = 'Driver_003_03_N' OR <zlf_chk> = 'Driver_003_05_N' OR <zlf_chk> = 'Driver_003_07_N' OR <zlf_chk> = 'Driver_004_01_N'.

" Avoid divide by zero

IF l_num_base > 0.

<l_keyfigure> = <l_keyfigure>.

" Copy N times with new base members

LOOP AT lt_SPD_PRODUCT_mbr ASSIGNING <l_base_mbr>.

<l_SPD_PRODUCT> = <l_base_mbr>.

" When IF_CALC_DELTA = true, appending means the latest records take effects,

" previous records with same dimension member will be overwritten.

" The newly appended records will also be looped and processed.

APPEND <ls_record> TO ct_array.

ENDLOOP.

ENDIF.

ELSE.

IF l_num_base > 0.

<l_keyfigure> = <l_keyfigure> / l_num_base.

" Copy N times with new base members

LOOP AT lt_SPD_PRODUCT_mbr ASSIGNING <l_base_mbr>.

<l_SPD_PRODUCT> = <l_base_mbr>.

" When IF_CALC_DELTA = true, appending means the latest records take effects,

" previous records with same dimension member will be overwritten.

" The newly appended records will also be looped and processed.

APPEND <ls_record> TO ct_array.

ENDLOOP.

ENDIF. " divide by zero

endif.

" Remove the old one

DELETE ct_array.