cancel
Showing results for 
Search instead for 
Did you mean: 

SCM average macro

Former Member
0 Kudos

Hi Experts,

I'm trying to write a macro to calculate the average of different CVC's in the same time bucket.

I have a macro to create the raw data for the CVC's at the lowest level (material, location, sales group and sales org).

Now I want macro (that executes in the background) to average the values for all of the CVC's for each of the different sales groups that we have (eg SG1, SG2, ...) disregarding all of the other characteristic values.

Do I need a new KF for each of sales group for the result?

And is the anything I need to do with the KF calculation settings (I've left it a pro rata for now)?

thanks

Paul

Accepted Solutions (1)

Accepted Solutions (1)

rajkj
Active Contributor
0 Kudos

Hi Paul,

I am thinking of using calculation type as A and time-based disaggregation type as P for the new KF. Then, copy the value of main kf value (e.g. sales) to new kf at detailed level. When, you access the data view at sales group level, the new kf is automatically populated with the avg value. Please check the following link for an example.

http://help.sap.com/saphelp_SCM700_ehp02/helpdata/en/47/d12b801fb26c68e10000000a42189b/frameset.htm

If you maintain the new kf value at sales group level, it will be disaggregated to detailed levels on pro-rata basis.

Thanks,
Rajesh

Former Member
0 Kudos

Hi Rajesh,

I had already tried that approach. But what I've found in my test that my average is 9 times (the number of products in my test data) what the average should be.

And I have struggled with the SAP help text which is why I have posted this question. I'm hoping to find another user that has already solved this problem and can guide me.

thanks

Paul

rajkj
Active Contributor
0 Kudos

Hi Paul,

You may try with a BAdI or user exit macro that gives you the flexibility to manipulate data view data based on your requirement.

Please check the following SAP notes for an example and reference.

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

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

Thanks,
Rajesh

Answers (0)