on 03-04-2015 10:18 PM
Hello,
Im a newbie in ABAP and I need to create an End Routine in a DSO transformation, but since i'm working with a 3.x DataFlow, i do not have the option (button) to create an end or expert routine...the only button shown is 'Change Start Routine'.
The requirement is to calculate the time difference between three infoObjects (each mapped in the DataSource) and store the result in a key figure that is mapped only in the DSO.
This is the code i'm using; but since the key figure is not mapped in the DataSource, the Start Routine shows that it doesn't exist... so i came up with the idea of the End Routine and now i don't know what to modify in my code for it to work. I hard coded it and it works as it should, the problem is when i start mapping within DATA_PACKAGE, etc.
Thank you!
DATA:
str(50) TYPE c,
dat TYPE d,
hora TYPE t,
dat2 TYPE d,
hora2 TYPE t,
time_stamp2 TYPE timestamp,
dst TYPE c,
tz TYPE ttzz-tzone,
x type i,
y type i.
tz = 'PST'. "End of Global Declaration
tz = ''.
str = DATA_PACKAGE-/BIC/PMMITTEXT.
dat = DATA_PACKAGE-/BIC/PMMDOCDAT.
hora = DATA_PACKAGE-TIME.
dat2 = str+15(8).
CONCATENATE str+24(2) str+27(2) str+30(2) into hora2.
CONVERT DATE dat2 TIME hora2 DAYLIGHT SAVING TIME 'X'
INTO TIME STAMP time_stamp2 TIME ZONE tz.
clear: dat2 , hora2.
CONVERT TIME STAMP time_stamp2 TIME ZONE tz
INTO DATE dat2 TIME hora2 DAYLIGHT SAVING TIME dst.
CALL FUNCTION 'SWI_DURATION_DETERMINE'
EXPORTING
start_date = dat
end_date = dat2
start_time = hora
end_time = hora2
IMPORTING
duration = x.
y = x / 60.
DATA_PACKAGE-PMMTIMDIF = y. (This is the key figure)
clear: dat, dat2, hora, hora2, x, y, str, time_stamp2.
Hi Fernanda
I also think that the easiest and fastest way would be to build a routine for the key figure in the update rule (like Oliver suggested). The result would then be:
<your coding logic>
RESULT = y.
An alternative would be of course to migrate the 3.x dataflow to 7.0. This will give you much more flexibility.
br
Roland
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fernanda,
May I know what is your source?
I would suggest to just add a DUMMY KF in your source as "temporary storage" of this DATA_PACKAGE-PMMTIMDIF..Then in transformation just directly map your DUMMY KF to your keyfigure PMMTIMDIF..
Regards,
Loed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
One solution is to write an abap routine inside the update rule to the infoobject.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.