03-14-2007 2:18 PM
Hi Guys,
I have a requirement where I need to Upload the Pipe Delimited Text file into SAP internal table. Presently I am using the FM "GUI_UPLOAD" with file type as 'ASC' and I have tried using the Separators but could not succeed in uploading the File into SAP internal table.If You people have worked priorly on this kind of Pipe Delimited File Please answer my Query...
Thanks,
Venkat.
03-14-2007 2:37 PM
Venkat,
Try this....
Upload the flat file into a flat itab using the GUI_UPLOAD.
Types: Begin of ttab,
rec(1000) type c,
end of ttab.
data: itab type table of ttab with header line.
After you have the data in the flat itab. Loop thru it and split at the pipe(|). Update another itab with your data.
data: Begin of itab2 occurs 0,
field1(10) type c,
field2(10) type c,
field3(10) type c,
endo of itab2.
Loop at itab.
split itab-rec at '|' into itab2-field1
itab2-field2
itab2-field3.
append itab2.
endloop.
03-14-2007 3:08 PM
hi,
try sth like this:
call function gui_upload...
...
tables ftab
loop at ftab.
split ftab at '|' into table sptab.
loop at sptab.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE itab TO <F>.
IF SY-SUBRC <> 0.
EXIT.
endif.
<f> = sptab-line.
endloop.
endloop.
Andreas
Message was edited by:
Andreas Mann
03-15-2007 8:38 AM
Hi Guys,
I tried with Split Statement but it did not work because the Split statement splits the record into many rows and since there can be lakhs of records it is not possible to use this . Is there any other way to bring the records into internal table from Pipe Delimited text file.
Thanks,
Venkat.