cancel
Showing results for 
Search instead for 
Did you mean: 

Copy key figues without the characteristic values

former_member400599
Discoverer
0 Kudos

Hi Everyone

I need some help /advice to copy key figues without charateristic values. Sounds easy, well I thought so...

My customer wants to plan certain key figures against a “reference employee”, for example chargeable hours.

• This reference employee, and therefore all other employees will belong to an employee group (and several other characteristics – just try to keep it simple).

• The employee group will not be a attribute of the employee, as this could change sevaral times during the year. One employee could belong therefore belong to multiple employee groups during one year.

• All key figures will be planned against a fiscal period.

As a start we would plan one of the key figures of the reference employee and then copy it to all other employees in that profit centre.

At this stage we can assume that there will already be some plan data against the same /and or another key figures for the “target” employees. This means that there will already a be a plan record with an “existing” employee group for that employee in the cube.

For example.

Existing records:

Employee Employee Group Period Standard Hours Chargeable Hours

B101 B 1 100 200

B101 B 2 0 0

B101 B 3 0 0

Now we would plan the “reference” employee:

Employee Employee Group Period Standard Hours Chargeable Hours

A100 A 1 80 0

A100 A 2 80 0

A100 A 3 - 12 100 0

When I now want to copy the chargeable hours from the reference employee to the target employees to for all periods (1-12), the following happens:

Employee Employee Group Period Standard Hours Chargeable Hours

Original B101 B 1 100 200

Reverse B101 B 1 0 200-

New B101 A 1 0 80

New B101 A 2 0 80

New B101 A 3 - 12 0 100

What we would like to achieve is the following:

• Copy key figures without having to copy the “related” characteristics

• Create new records for the other periods using same employee group as the existing record.

Employee Employee Group Period Standard Hours Chargeable Hours

Original B101 B 1 100 200

Delta B101 B 1 0 -120

New B101 B 2 0 80

New B101 B 3 - 12 0 100

I have tried sevaral versions of Fox formulas and the standard copy function, but they all give the same results:

For example:

DO.

PERIOD = PERIOD + 1.

ZP = TMVL(ZP, 1).

  • Find reference values

FOREACH ZP,ZEG,ZC,ZPOS.

ZV = {ZCHGHR,ZEG,ZP,ZC,B101,ZPOS}.

*Copy to all employees

FOREACH ZEMP.

{ZCHGHR,ZEG,ZP,ZC,ZEMP,ZPOS} = ZV.

ENDFOR.

IF PERIOD > 12.

EXIT.

ENDIF.

ENDFOR.

ENDDO.

Now for the question: Can I copy key figures values without the existing characteristic values, AND , update the new record with charateristic values from a existing record which are not attributes? And if yes, how can I do it.

Many thanks in advance

Wendy

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member93896
Active Contributor
0 Kudos

Hi Wendy,

ok, here's my point of view on this. If I get it right, all you need is standard delete and copy functions and one line of FOX:

Step 1:

Type: Delete

Condition: Employee = B101 (and others)

Step 2:

Type: Formula

Fields to be changed: KF

Fields for conditions: Employee

Parameter group:

Condition: Employee = A

Formula: {chargable hours} = {standard hours}.

Step 3:

Type: Copy to several target objects

Fields to be changed: Employee, Employee group

Fields for conditions: KF

Parameter group:

- Overwrite values

- Condition/Old values: KF = chargable hours, Employee = A100, Emp.Group = A

- New values: Employee = B101, Emp.Group = A (list all other employees here that you want to copy to)

Step 4:

Type: Delete

Fields for conditions: Employee, KF

Parameter group:

Employee = A, KF = chargable hours

If you enter the hours for your reference employee directly on "chargable hours", you can simplify the sequence and remove steps 2 and 4.

Optionally, you can make everything more dynamic by using (exit) variables instead of hardcoding values.

Regards,

Marc

SAP NetWeaver RIG

Former Member
0 Kudos

Hi Wendy,

It seems you have at least 2 options:

First of all solve the problem of copying first - forget the DO loop for a period, you can add this later.

I.

Plan only on employee level - hence remove employee group from the level, and derive it on planning area from the attribute.

Then all you have to worry about is how to copy from reference employee to another employees by your foreach formula (relevant employee group for target employees would be derived and shouldn't be in fields to be changed in your FOX)

II.

Put "Employee group" in fields to be changed in your FOX - you can do it the following way:

after reading you ref data and before "copying to target empl" add lines with ATRV statement reading employee group from target employee attribute,

next assign read attribute value to target employee group value,

... continue your FOX with copying

I hope it helps,

Regards,

Adam

former_member400599
Discoverer
0 Kudos

Hi Adam

Many thanks for the answer and suggestions.

What I was trying to achieve is deriving the "attributes" from "existing data" without deriving it from the master data attribute.

One of the main issues that I have is that even though the the employee group( and several other employee related charateristics) is an attribute of the employee, one employee can belong to two employee groups for a single year.

Time dependent attributes was considered, but was thought that it would complicate the reporting aspect of the budget / actuals as we would like to report several aspects of the budget in a single report / layout for a year. Hence the decision to go for seperate characteristics in the cube. However, the derivation from time dependent characteristics could be the answer.....

I will investigate the following options :

1) charateristic relationship derivation "from reference data" on the planning level and,

2) charateristic relationship derivation "from time dependent attributes"

and update this message with the results.

Once again, thanks for the suggestions

Wendy

Former Member
0 Kudos

One more thing.

Consider again, if you really need to store employee group in transaction data in your cube.

Maybe employee number will do fine.

In your case scenario is similiar to Cost Centers (one CC to many CC Groups). Instead of creating historical data regarding empl. groups, consider using time-dependant BW hierarchies for char. employee for reporting purposes.

Best regards,

Adam

former_member400599
Discoverer
0 Kudos

Hi

The reason why the employee related charateristics are seperate fields in the cube is because the users can "plan or change" it. We do however have a function module that will update the master data attributes (time dependent) when it changed in the layout.

I have now tried several options to try to get this to work...with some mixed results.

I have tried the characteristic relationship derivation and the ATRV function in my fox formula. Both derives the masterdata attributes of the last period (or the key data defined on the planning area.)

In short, I need copy the plan data for period 1 - 12 of the reference employee to all of the employees in the profit centre. There could be no data for that specific keyfigure, or for just one period for the target period (Do statement)

During the copy I need to derive the masterdata attributes twice, once from period 1 - 6, and secondly, period 7-12.

I have tried the following formula:

*Employee

DATA ZREMP TYPE Employee.

DATA ZEMP TYPE Employee.

*Bugdet Position

DATA ZPOS TYPE Position.

DATA ZPOS1 TYPE Position.

DATA ZPOS2 TYPE Position.

*Employee Group

DATA ZEG TYPE Employee Group.

DATA ZEG1 TYPE v.

DATA ZEG2 TYPE Employee Group.

*Job

DATA ZC TYPE JOB.

DATA ZC1 TYPE JOB.

DATA ZC2 TYPE JOB.

*Period

DATA ZP TYPE Period.

DATA ZP1 TYPE Period.

*Other

DATA ZV TYPE F.

DATA PERIOD TYPE I.

ZP = '001'.

FOREACH ZEG,ZC,ZPOS.

ZV = {ZCHGHR,ZEG,ZP,ZC,ZREMP,ZPOS}.

DO.

FOREACH ZEMP.

  • Exclude Reference Employee

IF ZEMP <> ZREMP.

  • Update Period 1- 6.

IF ZP < 007.

  • Derive Attributes

ZEG2 = ATRV('0EMPLGROUP',ZEMP).

ZC2 = ATRV('0JOB',ZEMP).

ZPOS2 = ATRV('ZBUDPOS',ZEMP).

  • Update

{ZCHGHR,ZEG2,ZP,ZC2,ZEMP,ZPOS2} = ZV.

ENDIF.

  • Update Period 7-12.

ELSEIF ZP > 006.

  • Derive Attributes

ZEG1 = ATRV('0EMPLGROUP',ZEMP).

ZC1 = ATRV('0JOB',ZEMP).

ZPOS1 = ATRV('ZBUDPOS',ZEMP).

*Update

{ZCHGHR,ZEG1,ZP,ZC1,ZEMP,ZPOS1} = ZV.

ENDIF.

ENDFOR.

PERIOD = PERIOD + 1.

ZP = TMVL(ZP, 1).

IF PERIOD > 12.

EXIT.

ENDIF.

ENDDO.

ENDFOR.

PS. The masterdata attributes can only ever be changed in period 7 - business rule .

This formula has worked on a planning level with very limited data, and one attribute only. It is however not really giving me the results when I run it through multiple attributes and multiple employees.

I have also used a similar formula with the ATRVT function, but same issue...

My question still remains ... Is it possible to derive the masterdata attributes for different time periods , and if yes, how?

Thanks in advance

Wendy

gerd_schoeffl
Advisor
Advisor
0 Kudos

Hello Wendy,

I am not sure whether I fully understood your problem - this is what I think it is:

You have data records containing employee, employee group and period. You have a time dependent relationship between employee and employee group like this:

period employee emp. group

1 B101 B

2 B101 B...

7 B101 C

8 B101 C...

and you want to enter data for a sample employee (having some employee group) that should be copied to the actual employees:

emp. emp. group period value

A101 A 1 80

A101 A 2 100

Now if you already have existing records for some employees when copying they should be adapted:

emp. emp.group period value

B101 B 1 200 (old record)

B101 B 1 -120 (new delta)

You have two options to reach this goal:

1. Do your copy function on a planning level that contains employee only (no employee group) and use a derivation to fill in the employee group. You cannot use a derivation type attribute together with time dependent attributes as the time reference to be used is in the data record and not the system time or some key data.

You can either create some reference data (like in the table above) that contains the proper relationship for the single periods and use a characteristic relationship of type reference data (use employee and period as the source characteristics and emp group as the target). Or you can create a derivation type user exit. Again use employee and period as sources and emp. group as target. You can define the rules for the derivation either in a InfoCube (in a table like above) or in a time dependent attribute - you just have to make sure that in the exit you grab the right data/read the attribute with say the first day of each period as key date (e.g. use FM UPC_CHA_VALUES_GET and fill the field I_Dateto to the first day of the current period).

2. You can use a do loop pretty much like you did but use the ATRVT instead of ATRV. ATRVT gives you time dependent attributes of a characteristic. You loop over the records (do or foreach loop) and for each record you get the period, determine the key data (e.g. first day) and read the time dependent attribute (this is quite similar to what you would do in the exit in case 1).

I hope this should solve the problem, if not then tell us...

Cheers,

Gerd

Former Member
0 Kudos

Hi Wendy,

The reason why you are not able to use the Copy function is because there is no common characteristic value based on which the copy function can be performed in your case, as you are trying to copy employee A* data to employee B* data but the system does not know that A1 is to be copied to B1 and so on and so forth.

If in the reference data you had B instead of A

Employee Employee Group Period Standard Hours Chargeable Hours

B100 B 1 80 0

B100 B 2 80 0

B100 B 3 - 12 100 0

then you would be able to use the copy data function to get the desired result.

hope I understood your problem correctly.

Cheers

Anurag

former_member400599
Discoverer
0 Kudos

Hi Anurag

Thanks for your reply.

The reference employee could be assigned to a different employee group as the target employees for a part of the year..hence the issue. I hope I have explain it a bit better in my previous update...

Regards

Wendy

Message was edited by: Wendy Du Toit