cancel
Showing results for 
Search instead for 
Did you mean: 

Update routine for 0proc_unit conversion

Former Member
0 Kudos

Hi all,

My infoobject 0OPR_ACTWRK uses 0PROC_UNIT for units. It holds data in days and in hours. When I load it to a cube, I want to convert all values to working hours.

I figured out that I have to use an update routine in my update rules. A lot of forum threads about unit conversion mention the function module UNIT_CONVERSION_SIMPLE. Can I use this function for my problem? Or should I use a different function module?

This will be my first ABAP code, so can anyone help me and tell me what I have to fill in exactle in the routine format below?

$$ begin of routine - insert your code only below this line -

  • fill the internal table "MONITOR", to make monitor entries

  • result value of the routine

RESULT = .

  • result value of the unit

UNIT = .

  • if the returncode is not equal zero, the result will not be updated

RETURNCODE = 0.

  • if abort is not equal zero, the update process will be canceled

ABORT = 0.

$$ end of routine - insert your code only before this line -

Thanks in advance!

Regards, Pieter

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear Peters,

1) You have to give us the 'KeyFigure' name in the cube where you want to update as working hours..

2) Basiaclly U have to folow the following steps..

a) Go to Update rules in change mode.

b) Click on the Required 'Keyfigure'.

c) Select the 'Formula' ( U need not have Routine for this one really.. looks like atleast.. )

d)On the editor Use left side charactristics by double clicking and use right side to build the formula..

Regards,

Hari

Former Member
0 Kudos

Hi Hari,

I would like to do this for two key figures:

- 0opr_pldwrk

- 0opr_actwrk

What should my formula look like?

Regards, Pieter

Former Member
0 Kudos

Hi Vikash and Hiri,

The paper you refer to doesnt help me, and neither the suggestion for using a formula in the update rules (as far as I can see). I could use a formula if the data is always in days and I wanted to convert is always to hours. But the problem is that the data is sometimes in days, sometimes in hours. I think I need some simple function like this, but I don't know how to ABAP it:

if unit = days then result = pldwrk * 8

else pldwrk = pldwrk

Any suggestions?

Regards, Pieter

Former Member
0 Kudos

Dear Pieter,

I am not infront of the system..

the following surely will give error.. :).. so post back here.. so that me or someone else will reply you..

So let us start witht he following coding in the 'Start routine'.

LOOP AT DATA_PACKAGE.

IF DATA_PACKAGE-UNIT= 'DAY'.

DATA_PACKAGE-opr_pldwrk = DATA_PACKAGE-opr_pldwrk * 8.

ELSE.

  • Do nothing.

ENDIF.

MODIFY DATA_PACKAGE.

ENDLOOP.

Regards,

Hari

Message was edited by: Hari Kiran Y

Message was edited by: Hari Kiran Y

Former Member
0 Kudos

Hi Pieter,

Not sure whether you have see this -

https://websmp101.sap-ag.de/~sapdownload/011000358700000488512003E/Howto_alternate_uom5.pdf

regards

Vikash