cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Copy Actual data to Plan data.

praveen_kumar334
Participant
0 Kudos
279

Hi team,

My requirement is to copy the actual data to plan data using BADI. I can use Logic script also but my client wants that to be implemented in BADI as they are flexible with ABAP.

I have a model ( zsales_001 ) and it has the following dimension :

1. Account

2. Category

3. Entity

4. Product

5. Time

6. Z_Keyfigure( it has ZKF1 and ZKF2 ).

I have attached the sample source data.

The data is flowing from IC1(BW) to BPC Model.

Now my requirement is to copy the actual data of 2015.01 to plan category of 2015.02 by incrementing the value of ZKEY1 and ZKEY2 to 10%.

I have attached the sample target data

I have written BADI, but while debugging the BADI is not getting executed. Please advise.

method IF_UJ_CUSTOM_LOGIC~EXECUTE.


  TYPES : BEGIN OF TY_ZSALES_BPC2_1              ,
           ZACCOUNT      TYPE STRING             ,
           ZCATEGORY     TYPE STRING             ,
           ZENTITY       TYPE STRING             ,
           ZPRODUCT      TYPE STRING             ,
           ZTIME         TYPE /BI0/OICALMONTH    ,
           ZZ_KEYFIG     TYPE STRING             ,
         END OF TY_ZSALES_BPC2_1.


  DATA : IS_ZSALES_BPC2_1 TYPE TY_ZSALES_BPC2_1 ,
         IS_TEMP TYPE TY_ZSALES_BPC2_1 ,
         IS_TEMP_2 TYPE TY_ZSALES_BPC2_1 ,
         IT_TEMP TYPE STANDARD TABLE OF TY_ZSALES_BPC2_1,
         IT_TEMP_2 TYPE STANDARD TABLE OF TY_ZSALES_BPC2_1,
         IT_ZSALES_BPC2_1 TYPE STANDARD TABLE OF TY_ZSALES_BPC2_1.

  IF CT_DATA IS NOT INITIAL.
    IT_TEMP[] = CT_DATA[].
    LOOP AT IT_TEMP INTO IS_TEMP.
      IS_TEMP_2 = IS_TEMP.
      IS_TEMP_2-ZCATEGORY = 'Plan'.
      APPEND IS_TEMP_2 TO IT_TEMP_2.
    ENDLOOP.
      SORT IT_TEMP_2 BY ZACCOUNT ZCATEGORY ZENTITY ZPRODUCT ZTIME.
      DELETE ADJACENT DUPLICATES FROM IT_TEMP_2.
      CT_DATA[] = IT_TEMP_2[].
  ENDIF.
endmethod.
below is the piece of logic script code : 

*XDIM_MEMBERSET TIME = 2015.01
*XDIM_MEMBERSET CATEGORY = ACTUAL
*XDIM_MEMBERSET ACCOUNT  = PL010
*START_BADI ZUJ_CUSTOM_LOGIC_FILT_001
*END_BADI.

Regards,

Praveen.


Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

First - to my mind it's absolutely strange to perform copy using badi (no extra flexibility!) Standard copy package (or script logic) will do this job without issues!

If you want to train yourself in writing badi - please read:

https://archive.sap.com/kmuuid2/20f4252d-98ca-2b10-e689-f85085ae2d12/How%20to%20Pass%20Parameters%20...

The only thing you don't need in this description - you don't need to create a custom chain to run script logic, use standard.

To debug badi execution insert endless loop in the beginning of the badi code and use SM50 to debug.

P.S. Very simple example of custom logic badi is provided in BPC Help:

https://help.sap.com/viewer/a2049170bfeb4178ace32222842c3ec1/10.1/en-US/f04254a006574fed9a65f3661a07...

Look on the script to run it:

*START_BADI DECD

QUERY = ON //To get data into ct_data

WRITE = ON //to write results of ct_data

YEAR = 1

PERCENTAGE = 10

*END_BADI