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: 

GUI_UPLOAD

Former Member
0 Kudos

Hello all,

I am having a pipe delimited file. There is no carriage return or line feed. All the lines are continous. To put it simple...if you open the file...you will get a feeling that you are looking at a MATRIX )

I am trying to download that flat file records in to an internal table using the FM GUI_UPLOAD. I gave the file name, field separator, file type as input parameters.

But the problem is it is reading 'pipe' also as a character. What am I doing wrong? Please help.

Thanks,

Naren

1 ACCEPTED SOLUTION

suresh_datti
Active Contributor
0 Kudos

I think the separator only works with tab delimited files.. you are better off creating an interanl table with one fieldd of type string. Load it using GUI_UPLOAD.

loop at it & split the reacord at '|' into different fields.

Regards,

Suresh Datti

7 REPLIES 7

suresh_datti
Active Contributor
0 Kudos

I think the separator only works with tab delimited files.. you are better off creating an interanl table with one fieldd of type string. Load it using GUI_UPLOAD.

loop at it & split the reacord at '|' into different fields.

Regards,

Suresh Datti

0 Kudos

Suresh is exactly right. The SEPARATOR parameter accepts the values of SPACE or "X". "X" will handle the separator(only tab, I think). I find that comma delimited files are easiest to work with, but it you don't have a choice, you will need to handle the same way. As Suresh has suggested, you will need to bring the data in as a flat structure or string and parse it manually. I'm concerned how you will know when the record breaks to the next row, or is it just one continuous record that needs not to be broken into rows?

Regards,

Rich Heilman

0 Kudos

Suresh & Rich,

Thanks a lot for your replies. It solved one part of problem. Other part is....as Rich said....how to identify when the record breaks to the next row because it is a continous record that needs to be broken in to rows. Please help.

Thanks,

0 Kudos

Hi Naren,

There must be some indication in the fiel(Some character say '@') to indicate you have to split at that character into an internal table and then you need to split each of the recrods into a different itab.

split v_str at '@' into table itab_records.

loop at itab_records.

split itab_records at '|' into itab-field1 itab-field2.

append itab.

clear itab.

endloop.

Regards,

Ravi

0 Kudos

If the file is located on the presentation server, how can I transfer the file contents to a string? Is there any FM for this?

Thanks,

0 Kudos

HI Naren,

YOu can use the same GUI_UPLOAD FM for string also.

Declare an internal table with only one field that is of type string.

data: begin of itab occurs 0,

value type string,

endof itab.

Regards,

ravi

Former Member
0 Kudos

Hi Naren,

what u can do is read the entire file in the string.

1. i think u can use the count of the coulmn as the break for new row.

2. i.e u can count the number of seperator in the string.

for eg. take 1st 6 seperator has 1st row and next 6 seperator for next row.

we can assume that seperator are present even for empty columns.

Message was edited by: Manoj Gupta