Question:
I am in deep trouble. Could any one please save my skin.
Here is the date that is getting from a flat file.
We need to modify this data and load into the Infocube as shown in the second table. I am not getting the right direction. Gurus! Do you please help me the ABAP code part???
Record no.------Status--------Open date----------Close date
C1----------------OPEN--------03/15/2003
C2----------------OPEN--------03/16/03
C2----------------CLOSE------03/16/2003------03/18/2003
C3----------------OPEN--------03/20/2003
C1----------------CLOSE------03/15/2003------03/25/2003
C2----------------OPEN--------03/26/2003
C2----------------CLOSE------03/26/2003------03/30/2003
Data (and fields) to be appeared in the InfoCube.
R No.--First open date--Last open date--- First close date-- Last open date
C1------03/15/2003-----03/15/2003---------03/25/2003-------03/25/2003
C2------03/16/2003-----03/26/2003---------03/18/2003-------03/18/2003
C3------03/20/2003-----03/20/2003
waiting for the response.....
Thanks In advance
Answer:
Gebs,
The information given is insufficient.
Based on what you have posted you have following objects in Cube
R No.--First open date--Last open date--- First close date-- Last open date
and you want to populate it from a flat file . i think i can assume that the infosource does not have the last open date and the last close date.
1. change the flatfile structure to reflect the changes
2. change the data in the start routine.
cant write the code but you will have to :
create internal table to add the new fields
loop the data_package with unique record no
manipulate data to get the closed/last dates.
save changes in the internal table
in update rule for the particular infoobject - read the corresponding data from the internal table.
regards
TJ
_________________
Change is The only Constant Factor in Life
Answer:
You can load the data as you intended. This process can not be done directly from a flat file to a cube, due to the reason that some matching and processing needs to be done, prior to loading into the cube. In order to match, you need to have all data available in an internal table.
I would process the file as under
1. Write an abap program code, that reads the flat file into an ABAP internal table
2. Process all data based on record number and status
3. Store the processed data in another internal table with structure
R No.--First open date--Last open date--- First close date-- Last open date
4. Down load the file to a flat file.
5. raise an event at the end of the program, using bp_event_raise function module. Events are created using sm62.
6. create infopackage, and process using after event. Enter the event name that you raised in step 5. Also, use the external file as the new file created in step 4.
Create a job using sm37 and run the first program. Use sm62 to create an event.
TJ seems to be suggesting that the process 1 be done in the start up routine. This may be OK, if you have under 1000 records at a time. The flat file records are loaded 1000 at a time, due to idoc limitations.
On the other hand, if you have under 100,000 records ( max in a datapacket), you could use Function module as generic datasource. and you can do both processes in one function module.
If the file size is unknown, then I would suggest that you use step 1 - 6.
I can not provide the code, only the ideas, there is a lot of techncial expertise required to write abap, to create a job, events, raise events and processing
Thanks
William Dsouza
Answer:
Thank you so much. Now I am in the loop.