on 09-10-2008 7:54 AM
Hi ebverybody,
I want to load data from an excel file.
In this excel file, i have the following fields:
Job_Status ¦ USERS ¦ DATE
-
-
Open ¦ 12365, 15462, 13634 ¦ 02.03.2008
But i want to split this line, to load in my infocube these records:
Job_Status ¦ ID_EMPLOYEE ¦ DATE
-
-
Open ¦ 12365 ¦ 02.03.2008
Open ¦ 15462 ¦ 02.03.2008
Open ¦ 13634 ¦ 02.03.2008
Where can i create a ABAP routine ?
How can i proceed in this routine ?
Thanks a lot,
rewarded points.
Rodolphe.
Hi Rodolphe,
few questions back:
- are you using BW 3.x or BI 7? This influences the way to define your structures
In my opinion the best way to solve it (when you don't want to do it in Excel) is to create a datasource which contains the three fields from the CSV file and and an extra ID-field at the end of the structure.
USERS must a be CHAR fields which is long enough to contain all the possible ID's.
ID must be e NUMC which is long enough to contain an employee id.
In the startroutine from your cube you should take care of those two different infoobjects.
For any line in your package you should scan your USERS field for commas and add/generate a record to your data_package in which you use a part of the USERS field to populate the ID field.
Is this helpful?
Marco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Marco,
I'm using BI 7.
I already create the Datasource from the CSV file ...
But, i don 't know , in programmation point of view, how i can separate the ID ?
you said that routine should be created in cube level ?
but how from a line, can i create several lines ?
Thanks
Rodolphe.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rodolphe,
i am not an ABAP guru, but i know that in a start routine you can manipulate the source_package and you can create/change and delete lines.
I have tried to make a little example, but i don't have a good piece of datamodel available.
look at this example, maybe you or an ABAP guy has enough info from it. This should be in the startroutine when getting from PSA to infocube.
DATA:
new_sp TYPE Table OF tys_SC_1.
cuberecord Type .....
cubetable type table of cuberecord.
LOOP at source_package into <source_fields>.
loop at your source_package-field2 for ,
and get this one out in a variable
cubrecord-field1 = <source_fields>-field1
cubrecord-field2 = your found id field with only the piece before a comma
cubrecord-field3 = <source_fields>-date field
Append cubrecord to cubtable
endloop.
Endloop.
now replace the source_package you got by your newly built cubetable
Delete source_package.
Source_package = cubetable.
Marco
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.