Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Down load of Pipe delimited Text file

Former Member
0 Kudos

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.

3 REPLIES 3

former_member187255
Active Contributor
0 Kudos

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.

andreas_mann3
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.