Loading Multiple Flat File around 80+
Hi,
Loading multiple flat file in to BI system.
My issue: I got a scenerio of loading multiple i.e., 80+ flat file into BI system every month and my client want it to be done through process chain r automation with out manual intervention.
Can any one suggest me how can i achiev this one.
Regards,
Prabhakar.
Hi All,
We have developed a logic to upload multiple flat file at a time i.e., .CSV file. Please find below is the logic regarding that routine.
*+ program filename_routine.
Global code
$$ begin of global - insert your declaration only below this line -
Enter here global variables and type declarations
as well as additional form routines, which you may call from the
main routine COMPUTE_FLAT_FILE_FILENAME below
data : v_filename type string.
data : v_foldername type string.
data : v_uploadfile type string.
data: v_download_file type string.
data : v_ext(4) type c.
data : v_FILE_EXISTS type c.
data : v_file type DXFILE-FILENAME.
data : v_count(3) type c.
data : v_length type i.
TYPES: BEGIN OF TY_file,
LINE(900),
END OF TY_file.
DATA: GIT_file TYPE TABLE OF TY_file.
$$ end of global - insert your declaration only before this line -
form compute_flat_file_filename
using p_infopackage type rslogdpid
p_datasource type rsoltpsourcer
p_logsys type rsslogsys
changing p_filename type RSFILENM
p_subrc like sy-subrc.
$$ begin of routine - insert your code only below this line -
This routine will be called by the adapter,
when the infopackage is executed.
v_count = 1.
*---- As per the folder location of the files & system we have to change
*the path fo the folder in the below variable i.e., 'c:\............
v_foldername =
'C:\Documents and Settings\Prabhakar-HP\Desktop\test\'.
*---- As per the Prefix of the files like 'CSI_01_..' we have change the
*prefix if required in the below variable i.e., 'CSI_01_..', IF REQUIRED
*OR IF WANT TO CHANGE THE PREFIX TO SOME OTHER.
v_filename = 'CSI_01_'.
v_ext = '.csv'.
condense v_count.
concatenate v_foldername
v_filename
v_count
v_ext into v_uploadfile.
v_file = v_uploadfile.
CALL FUNCTION 'DX_FILE_EXISTENCE_CHECK'
EXPORTING
FILENAME = v_file
PC = 'X'
IMPORTING
FILE_EXISTS = v_FILE_EXISTS
EXCEPTIONS
RFC_ERROR = 1
FRONTEND_ERROR = 2
NO_AUTHORITY = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
while v_FILE_EXISTS = 'X'.
v_file = v_uploadfile.
CALL FUNCTION 'DX_FILE_EXISTENCE_CHECK'
EXPORTING
FILENAME = v_file
PC = 'X'
IMPORTING
FILE_EXISTS = v_FILE_EXISTS
EXCEPTIONS
RFC_ERROR = 1
FRONTEND_ERROR = 2
NO_AUTHORITY = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
if v_file_exists = 'X'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = v_uploadfile
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = GIT_file
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
elseif sy-subrc = 0.
**----- As per the REQUIRMENT, want to change the down loading file
*path means we have to change the path in the below variable i.e.,
*'c:\.......
v_download_file =
'C:\Documents and Settings\Prabhakar-HP\Desktop\test\satheesh.CSV'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = v_download_file
FILETYPE = 'ASC'
APPEND = 'X'
TABLES
DATA_TAB = git_file
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
refresh git_file.
ENDIF.
endif.
if v_file_exists = 'X'.
if p_subrc = 0.
v_count = v_count + 1.
condense v_count.
concatenate
v_foldername
v_filename
v_count
v_ext into v_uploadfile.
endif.
else.
endif.
endwhile.
v_uploadfile = v_download_file.
p_filename = v_uploadfile.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform. +*
Reagrds,
Prabhakar.
Similar Messages
-
Loading Multiple Flat File in to BI System with one InfoPackage
Greetings,
i have developed a routine to Load Multiple Flate File in one InfoPackage, but it doesn't work. Only the Last File are loaded. Who can Help me?
Loading 'R:\Verzeichnis \ing_wan_b_002.fall.csv' to 'R:\Verzeichnis \ing_wan_b_240*.fall.csv'
Routine:
DATA: VerzUndDateiname TYPE string value 'R:\Verzeichnis \ing_wan_b_000.fall.csv',
VerzUndDateinameKomplett TYPE string,
count TYPE i value 2,
countN(3) TYPE n.
WHILE count <= 240.
countN = count.
VerzUndDateinameKomplett = VerzUndDateiname.
REPLACE '000' WITH zaehlerN
INTO VerzUndDateinameKomplett.
p_filename = VerzUndDateinameKomplett.
count = count + 1.
ENDWHILE.
Best Regards
Jens
Edited by: JB6493 on May 18, 2009 1:03 PM
Edited by: JB6493 on May 18, 2009 1:07 PMHello Jens,
you have to process the InfoPackage 239 times. Your routine would be executed once during one processing of the InfoPackage. This would run the WHILE statement and end up with the last filename after 239 iterations.
Either try to concatenate the files you want to load (if possible) and load them in one go. Alternatively you could try to use a process chain to run the InfoPackage 239 times.
Kind regards,
Christoph -
InfoPackage to load multiple flat file for different plant
Hi
There is a requirements to load the data from multiple flat files by different plant into BI which source data is coming from other system. Each flat file has it own naming convention.
As data has to load via infopackage into the targeted cube. Then I have to create multiple infopackage in order to load the data according to the number of flat files that provided. However, new plant will be created due to expansion of bussiness. If that is the case, additional infopackage is required to create as and when there is a new plant.
Is there a way to create a infopackage to load the data from flat file by plant? Your advice is much appreciated.
Thanks and regards
Kang RingHi,
The best way I can suggest is....
1. Create a folder in AL11 for your requirements.
2. In InfoPackage under Extraxction Tab you can have File Name , just side of this you can fine ABAP Routines ICon there you click on that and asks Name give some and then it will takes to your into ABAP Code there you can access the AL11 and then write code in such way that to take file irrespective of the File name, whatever the file is there in that Folder it ahoud take from that AL11 Folder path.
3. Load the Data using PC.
4.At the end of the PC Delete the File in AL11 folder , becasue we don't need it for next load.
Else
See the thread
Re: Automation of load from application server
Thanks
Reddy
Edited by: Surendra Reddy on Jun 4, 2010 11:03 AM -
How to load multiple flat files
Hi,
I am new to ODI 10, I have one requirement where I need load flat files containing the folder size11GB.
I want to load them all in a single instances with using of single data server, single physical schema and single logical schema.
How can we do this.
Also to execute this in package what steps and precautions do we need to follow.
ThxIs the data in your files the same format?
If so, simply follow one of the many guides to looping around files that use a common structure to load them, you can do this in parallel if you want.
http://odiexperts.com/multiple-files-single-interface/
or
http://www.odigurus.com/2011/05/multiple-files-single-target-table.html -
Loading multiple flat file at a time.
hi experts,
I am having 15 flat files with same data structure.so how do i load all the fileswith out creating 15 info packges .
( say all the files are on the desktop.)
I had seen the option that ABAP code an be written in info package in extraction tab.
Can any one share me the abap code
Regards
Laxman.You can write dynamic code using ABAP if your number of flat files are not fixed...but if you have to 15 flat files always just creating multiple infopackages.
For code, you have to store file names/name pattern in some table and reading it at run time. You can use function modules starting with BAPI_IPAK* to create/change/start template IP like BAPI_IPAK_START. You can set IP parameters at run time using FM RSBATCH_MAINTAIN_PAR_SETTINGS.
Kamaljeet -
Parallel loading of flat files into BPC 7.0 NW - Help required
Hi All
Can I load multiple flat files in parallel into BPC using IMPORT process chain.
If yes , How ?
Regards
AKPlease import SAP Note [1507226|https://service.sap.com/sap/support/notes/1507226] titled "FileService should support running DM package simultaneously" which is contained in BPC 7.0 NW SP10 and BPC 7.5 NW SP05.
Best regards,
[Jeffrey Holdeman|http://wiki.sdn.sap.com/wiki/display/profile/Jeffrey+Holdeman]
SAP Labs, LLC
BusinessObjects Division
Americas Applications Regional Implementation Group (RIG) -
Loading from multiple flat files to same table using SQL Loader
Hi Gurus,
Can anyone please brief me the pros and cons of kicking of multiple sql loader sessions that reads multiple flat files but inserting it into just one table.
The table is not partitioned. Avg record counts for each flat file is about 5-6 million.
Oracle 11g,
OS: Linux
Regards
Cherrish VaidiyanVaidiyan wrote:
Hi Gurus,
Can anyone please brief me the pros and cons of kicking of multiple sql loader sessions that reads multiple flat files but inserting it into just one table.Cherrish,
Pros -> Faster loading of more data
Cons -> Potential performance degradation
Test to see how much resource consuming this task would be and do a priority comparison of that multi-multi load task with other stuff that will be happening in the database in the multi-multi load time so you could decide how to share resources in that time. -
How to load a flat file with lot of records
Hi,
I am trying to load a flat file with hundreds of records into an apps table. when i create the process and deploy it onto the console it asks for an input in an html form. why does it ask for an input when i have specified the input file directory in my process? is there any way around tis where in it just reads all the records from the flat file directly??is custom queues anyway related to what I am about to do?any documents on this process will be greatly appreciated.If any one can help me on this it will be great. thank you guys....After deploying it, do you see if it is active and the status is on from the BPEL console BPEL Process tab? It should not come up to ask for input unless you are clicking it from the Dashboard tab. Do not click it from the Dashboard. Instead you should put some files into the input driectory. Wait few seconds you should see the instances of the BPEL process is created and start to process the files asynchrously.
-
Multiple flat file in and multiple target tables
Hi,
How can we have multiple flat file into multiple targets.
I am trying to load data from multiple flat files into respective tables. But it gives error like
VLD-2411: Cannot handle two file structures
Make sure that only one file structure is used in a SQL*Loader map
Can anyone help.
Regards
Rakesh KumarI donot thing in one mapping you can take multiple sqlloader file.
If want to load data form multiple file use External table. -
SSIS project - read multiple flat files with different formats
hi all,
i need to import multiple flat files with different formats into different tables of the sql server database and not able to figure out the best way out in ssis to do so...
please advise the possible methods in ssis to do so and if possible the process which can be dynamic as file names or columns might change in future.Hi AK1987,
To import flat files with dynamic columns, we can use Script Task inside a Foreach Loop Container to parse the first row of the flat file to get the columns names and save them into a .NET variable, then, we can create “Create Table” script based on this
variable, and then store the script into a SSIS package variable. After that, we create a staging table based on the package variable, load the flat file data to the staging table. Eventually, we load data from the staging table to the destination table. For
the detail steps, please walk through the following blog:
http://www.citagus.com/citagus/blog/importing-from-flat-file-with-dynamic-columns/
Regards,
Mike Yin
TechNet Community Support -
I'm from chile, sorry for my English writing
could be supported with the following error please.
Error
RPE-01013: SQL Loader reported error condition, number 1.
LRM-00112: multiple values not allowed for parameter 'control'
SQL*Loader: Release 10.2.0.3.0 - Production on Thu Oct 14 12:02:55 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL*Loader-100: Syntax error on command-line
This happens when I try to load a flat file (CSV)
thank you very much for your helpThis seems to be an error coming from Oracle SQL*Loader "SQL Loader reported error condition, number 1.".
How do you access your csv - file? Is the error occurring within OWB deployment? -
Loading of flat file (csv) into PSA – no data loaded
Hi BW-gurus,
We have an issue regarding loading a flat file (csv) into PSA using an infopackage u2013 (BI 7.0)
The infopackage has been used for a while. Prior the consultants with SAP_ALL-profile have run the infopackage. Now we want a few super users to run the infopackage.
We have created a role for the super users, including authorization objects:
Data Warehousing objects: S_RS_ADMWB
Activity: 03, 16, 23, 63, 66
Data Warehousing Workbench obj: INFOAREA, INFOOBJECT, INFOPACKAG, MONITOR, SOURCESYS, WORKBENCH
Data Warehousing Workbench u2013 datasource (version > BW 3.x): S_RS_DS
Activity: All
Datasource: All
Subobject for New DataSource: All
Sourcesystem: FILE
Data Warehousing Workbench u2013 infosource (flex update): S_RS_ISOUR
Activity: Display, Maintain, Request
Application Component: All
InfoSource: All
InfoSource Subobject: All values
As mentioned, the infopackage in question, has been used by consultants with SAP_ALL-profile for some time, and been working just fine. When the super users with the new role are executing the infopackage, the records are found, but not loaded into PSA. The load seems to be stuck, but no error message occurs. The file we are trying to load contains only 15 records.
Details monitor:
Overall status: Missing messages or warnings (yellow)
Requests (messages): Everything ok (green)
-> Data request arranged (green)
-> Confirmed with: OK (green)
Extraction (messages): Errors occurred (yellow)
-> Data request received (green)
-> Data selection scheduled (green)
-> 15 Records sent (0 Records received) (yellow)
-> Data selection ended (green)
Transfer (IDocs and TRFC): Missing messages (yellow)
Processing (data packet): Warnings received (yellow)
-> Data package 1 (? Records): Missing messages (yellow)
-> Inbound processing (0 records): Missing messages (yellow)
-> Update PSA (0 Records posted): Missing messages (yellow)
-> Processing end: Missing messages (yellow)
Have we forgotten something? Any assistance will be highly appreciated!
Cheers,
Anne Therese S. JohannessenHi,
Try to use the transaction ST01 to trace the authorization of the upload with the SAP_ALL.
And the enhance your Profile for the super user.
Best regards
Matthias -
Load a flat file into BW-BPS using SAP GUI
Hi,
We are using BW BPS 3.5 version, i implemented how to guide " How to load a flat file into BW-BPS using SAP GUI" successfully without any errors.
I inlcuded three infoobjects in the text file costelemt, Posting period and amount. the same three infoobjects i inlcuded the file structure in the global data as specified in the how to document
The flat file format is like this
Costelmnt Postingperiod Amount
XXXXX #
XXXXX 1 100
XXXXX 2 800
XXXXX 3 700
XXXXX 4 500
XXXXX 5 300
XXXXX 6 200
XXXXX 7 270
XXXXX 8 120
XXXXX 9 145
XXXXX 10 340
XXXXX 11 147
XXXXX 12 900
I successfully loaded above flat file in to BPS cube and it dispalyed in the layout also.
But users are requesting to load flatfile in the below format
Costelmnt Annual(PP=#) Jan(PP=1) Feb(PP=2) ........................................Dec(PP=12)
XXXXX Blank 100 800 900
Is it possible to load a flat file like this
They wants load a single row instead of 13 rows for each costelement
How to do this. Please suggest me if anybody accorss this requirment.
In the infocube we have got only one Info object 0FISCPER3(Posting period) and one 0AMOUNT(Amount)
do we need 13 Infobjects for each posting period and amount.
Is there any possiblity we can implement any user exit which we use in BEX Quer's
Please share your ideas on this.
Thanks in advance
Best regards
SSHi,
There are 2 ways to do this.
One is to change the structure of the cube to have 12 key figures for the 12 posting periods.
Another way is to write an ABAP Function Module to fetch the values from each record based on the posting period and store it in the cube for the corresponding characteristic. This way, you dont have to change the structure of the cube.
If this particular cube is not used anywhere else, I would suggest to change the structure itself.
Hope this helps. -
How can we load a flat file with very, very long lines into a table?
Hello:
We have to load a flat file with OWB. The problem is that each of the lines in the file might be up to 30.000 characters long (up to 1.000 units of information in each line, 30 characters long each)
Of course, our mapping should insert these units of information as independent rows in a table (1.000 rows, in our example).
We do not know how to go about it. We usually load flat files using table functions, but we am not sure that they will be able to cope with these huge lines. And how should we pivot those lines? Will the Pivot operator do the trick? Or maybe we should pivot those lines outside the database before loading them?
We are a bit lost. Any suggestion would be appreciated.
Regards
Edited by: [email protected] on Oct 29, 2008 8:43 AM
Edited by: [email protected] on Oct 29, 2008 8:44 AMYes, well, we could define a 1.000 column external table, and then map those 1.000 columns to the Pivot operator… perhaps it would work. But we have been investigating a little bit, and we think that we have found a better solution: there is a unix utility called “fold”. This utility can split our 30.000 character lines in 1.000 lines, 30 characters long each: just what we needed. Then we can load the resulting file using an external table.
We think this is a much better solution that handling 1.000 columns in the external table and in the Pivot operator.
Thanks for your help.
Regards
Edited by: [email protected] on Oct 29, 2008 10:35 AM -
How to load a flat file with utf8 format in odi as source file?
Hi All,
Anybody knows how we can load a flat file with utf8 format in odi as source file.Please everybody knows to guide me.
Regards,
SaharCould you explain which problem are you facing?
Francesco
Maybe you are looking for
-
Can't install drivers for HP Photosmart Prem C410 series
OS = windows 7 SP1 64 bit. Printer = HP Photosmart Prem C410 series. Driver = PS_AIO_07_C410_FSW_Full_Win_EMEA_140_222-4 in the middle of the install i get the following error: Fatal error during installation "sameer.el-khal" is not a valid short fil
-
Hi All, I've got XSLT issue. Suppose in XML I have string like that : world.country.town.Moskow.SomeOtherValue Capitalized word/s/ is/are/ always at the end. Using XSLT how to get substring returning capitalized words only i.e Moskow.SomeOtherValue T
-
Is it possible to change way names are arranged in login screen?
I want to put all the administrators first in the login screen regardless of the name. Is the possible?
-
When i first time switch on my new laptop macbook air i had french keyboard
when i first time turn on my new macbook air i wrote my new passport. i wrote on qwerty keyboard but when i changed langues on french, i need writing everytime on "imagine french keyboard" but when i changed again langues ENGLISH this stay same... in
-
Dear All, i have two internal tables itab1 & itab2. ITAB1 is of strecture EBANX, and ITAB2 is declared as fallows: TYPES: BEGIN OF gty_temp_stru, BANFN TYPE eban-BANFN, matnr TYPE eban-matnr, werks TYPE eban-werks,