cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-planning areas

Former Member
0 Kudos

Hello,

I have two planning areas <b>AREA1</b> and <b>AREA2</b>.

The structures of these areas are mostly identical except for 1 or 2 fields.

I need to copy two <u>"volume"</u> fields (a <i>numeric</i> value) from <b>AREA1</b> to <b>AREA2</b>. One of the fields has the same technical name, and the second name differs between the two areas.

<b>(i.e. AREA1: VOL001 --> AREA2: VOL001

AREA1: VOL013 --> AREA2: VOL022)</b>

So, I have created a multi planning area <b>MAREA3</b> (which contains <b>AREA1</b> and <b>AREA2</b>).

I created a planning function in MAREA3, under which is a FOX Formula. In this formula, how do I copy these two values?? I have read documentation but dont understand if the data from these 2 areas within the multi-area are merged based on common data, or remain completely independent. In this case in my FOX formula, wouldnt I have to copy these 2 values for common data between AREA and AREA2?

Thanks,

Tim

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Timothy,

In both cases you could use a simmilar in a single fox formula.

The following code will overwrite AREA2 values with the corresponding values from AREA1.

Fields to be changed are Key figure and Planning Area.

{VOL001,AREA2} = {VOL001,AREA1}.

{VOL022,AREA2} = {VOL013,AREA1}.

Cheers,

Alberto

Former Member
0 Kudos

Thanks Alberto,

I've implemented the logic you indicated.... seems logical however I get a dump

Could this be due to inconsistencies in the overall structures of AREA1 and AREA2?

Another question: in my multi-planning area MAREA1, when I overwrite my volume values from AREA1 to AREA2 (as in your solution above), does it automatically know "from" which line in AREA1 to overwrite "to" which line in AREA2?? Based on what? some key?

Thanks again!

Tim

Former Member
0 Kudos

Tim,

To start simple just make sure that the characteristics that you select in the level exist in both cubes. Once you solve the short dump you can make it more complex.

Regarding the 2nd question. If you just execute the formula I gave you the system won't modify any other characteristic value than planning area. So, if in Cube AREA1 you had volume of 34 in material 4, then a volume of 34 will be copied to material 4 in cube AREA2. However, the foolowing formula:

{ KF1, AREA2, 1004} = { KF2, AREA1, 1005}.

will copy to the key figure KF1 and materail 1004 in AREA2 whatever value you have in the key figure KF2, in AREA1 for the material 1005.

Hope it's clear.

Cheers,

Alberto

Former Member
0 Kudos

Tim,

You can use all the characteristics as keys that are included in the planning level.

You can use these characteristics as conditions or fields to be changed in the function defintion.

once you defined your keys, write necessary coding as required.

If you select MATERIAL as a key in the conditions, it'll overwrite only those material lines that you select in your parameter group.

if you select MATERIAL as "fields to be changed", you will have to define what all material lines need to be overwritten.

for example,

FOREACH MATERIAL

{MATERIAL, VOL001,AREA2} = {MATERIAL, VOL001,AREA1}.

{MATERIAL,VOL022,AREA2} = {MATERIAL,VOL013,AREA1}.

ENDFOR.

above code overwrites all the material lines.

you can extend these keys to as many characteristics as you want.

for more information, go here on help.sap.com which is a very good source.

http://help.sap.com/saphelp_sem320bw/helpdata/en/0a/2fc394616311d4b2e70050dadfb23f/content.htm

hope this helps.

Former Member
0 Kudos

Thanks Alberto and Hari..

I will continue this on monday -- maybe I'll have more questions...

Former Member
0 Kudos

Hello!

Thanks for you're help, my test reads data from AREA1 but nothing in AREA2 is changed... and to understand why could it be because:

(1) must the data exist also in AREA2 to overwrite or does it just create a new line?

(2) you said I can specify for which fields the overwrite occurs in key fields... I see this point, but if the structures from AREA1 abd AREA2 differ by one field and I specify no key fields or all (whatever), how does it know which for which line to put in the new volume number since this one field will always differ?

Thanks again,

Tim

Former Member
0 Kudos

Tim,

Question 1)

If you are using a foreach statement, for performance reasons, the system "jumps" over records in which in the target area no key figure has a value other than zero. There are solutions to solve this, maybe feeding a key figure with a dummy value set to 1 or executing first a standard copy function. Try feeding a number first in your target area without a foreach statement and then execute the foreach statement. You will see how records get modified.

Question 2)

If the field that only exists in one structure has been placed in the level, this field MUST be in fields to be changed, because the function will modify it from characteristic value "X" to #. If the field is not in the level, the system does not care because "X" and "Y" are agregated.

Cheers,

Alberto Sabate

Former Member
0 Kudos

Thanks!

Tim

Answers (0)