cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy key figure value from one location to other location

Former Member
0 Kudos

Dear all,

I have a problem when copy key figure value from one location to other location.

This is my scenario

I have a planning table with 2 key figure KF1 and KF2, 3 location K110, K210, 5210.

Key figure      Location     Value

KF1              K110          0

                    K210          100

                    5210          200

KF2              K110          0

                    K210          0

                    5210          0

Now, i want to copy key figure value from KF1 in location K210 and 5210 to key figure KF2 in location K110.

This is the result i want:

KF1              K110          0

                    K210          100

                    5210          200

KF2              K110          0

                    K210          0

                    5210          300

Please help me to solve this problem.

Thanks,

Thai.

Accepted Solutions (1)

Accepted Solutions (1)

rajkj
Active Contributor
0 Kudos

Thai,

Neither standard macro functions nor t.codes such as /sapapo/tscopy can meet such requirement. Since location characteristic value change is required, the drill down and then, copying the key figure values at right level become complicated.

However, you can use BAdI based macro that allows you read all the characteristics with their values as well as the key figure values. Using ABAP, you can manage the calculations flexibly. Please check the following link for a SAP note on BAdI macro

https://service.sap.com/sap/support/notes/1119651

Thanks,
Rajesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Thai,

Using macro to do the calculation would be able to fulfill your requirement or you want to use /SAPAPO/TSCUBE?

Best Regards,

Former Member
0 Kudos

Hi Phenix,

I want to use macro to fulfill my requirement.

Thanks,

Former Member
0 Kudos

Hi Thai,

As mentioned by Rajesh below,  Badi Macro should be the most easy way to handle this request. However, if you want to avoid badi macro coding and this requirement is not required to be executed online in planning book, you might consider below structure:

1) Extract KF from Planning Area into a InfoCube

2) Via transformation to do calculation Or changes characteristic according to your business rule

3) Using /SAPAPO/TSCUBE to load back the key figure

This approach will be more easy for future trouble shooting, and more easy to understand the data flow/calculation. Hope this can help.

Best Regards,