on 09-10-2008 8:43 AM
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.
Resolved by my self
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did u find the solution for this? If yes can you share to sreechakka@gmail.com.
thanks
Since the no. of files are not fixed, will suggest you to go for one IP for file. This will give you flexibility to add/delete any IP at any time in the proces chain.
Thanks...
Shambhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If i create one IP per file means, every month i need to customize the process chain also to include all these IP of those files.
Is any other process is there to acieve this, like if we keep all these file in a folder in sequential order and from that folder is it possible to upload those files in a sequential order as per sequence of files.
Suggest me the approach.
Regards,
Prabhakar.
Hi,
same InfoPackage can be used to load all the files and this IP can be assigned to process chain.
as experts given comments, in IP we have write ABAP code to load all fine in sequence.
ie for April files <Filename_04_1.csv>... <Filename_04_80.csv>
for May file <Filename_05_1.csv>... <Filename_05_80.csv>
after file name month and file should be in increasing format and after dec again jan and for no of files, if file not exist code should stop looping.
hope this helps
Regards
Daya Sagar
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.
Hi,
You can do that through process chains.
Take a look at this link:
http://help.sap.com/saphelp_nw04/helpdata/EN/8f/c08b3baaa59649e10000000a11402f/content.htm
You would need to think about upload file naming conventions etc.
In the infopackage there is a provision to create a routine for varying file names.
Best regards
Mathew.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mathew,
Here in this case the number of files will get varied month by month i.e., in one month number of flat file may be 80 and in the next month they may be 100 file of the same format.
how can we schedule all these number of file in a sequence, wether to create a single info package and to create a multiple info package for individual file to load data.
How to proceed in this case, please suggest me the approach.
Regards,
Prabhakar.
User | Count |
---|---|
85 | |
10 | |
9 | |
9 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.