cancel
Showing results for 
Search instead for 
Did you mean: 

FOX Formula to calculate # values by manual distribution

Former Member
0 Kudos

Dear Gurus,

I have a question regarding a FOX formula which would calculate the # (unassigned) value by manual distribution.

My scenario is:

Planning step 1: Data is planned for the whole Controlling area.

Planning step 2: The user selects one or more profit centers and distributes the plan for the whole controlling area to those profit centers (I don't want to use standard distribution functions).

I just need a formula which will calculate the # profit center value according to the values the user plans for different profit centers. The goal is to distribute everything so # is equal to 0.

Any code advice will be highly appreciated.

Thanks in advance

Jan

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member93896
Active Contributor
0 Kudos

Hi Jan,

here's some code to get you started. Field to be changed is Key Figure and Profit Center.


DATA p TYPE 0PROFIT_CTR.
DATA total TYPE f.
DATA i TYPE i.

FOREACH p.
  i = i + 1.
ENDFOR.

total = { 0amount, # }.

FOREACH p.
  { 0amount, p } = total / i.
ENDFOR.

{ 0amount, # } = 0.

Regards,

Marc

SAP NetWeaver RIG

Former Member
0 Kudos

Hi Marc,

thanks for the code. Unfortunately my scenario is to distribute the unassigned values manually and the fox formula has to update the unnassigned value according to the user input.

For example:

1. step: # = 500

2. step # = 250, 1 = 200, 2 = 50. User doesn't plan # but plans profit center 1, 2 etc.

I would appreciate any further help anyone can give me.

Regards

Jan