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 can't upload data in a tab-delimited text file

Former Member
0 Kudos

Hi.

I was trying to upload data in a tab-delimited textfile.

I could do it for a ASC textfile (by setting FILETYPE = 'ASC'), but I couldn't do it for a tab-delimited textfile (by setting FILETYPE = 'DAT').

Any help is appreciated.

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Kian

With respect to <b>Unicode </b>you should no longer use function modules for GUI upload/download but replace this by the corresponding methods GUI_UPLOAD and GUI_DOWNLOAD of class <b>CL_GUI_FRONTEND_SERVICES</b>.

Like already said method GUI_UPLOAD has a parameter HAS_FIELD_SEPARATOR where 'X' means "<i>Columns Separated by Tabs in Case of ASCII Upload</i>".

Regards

Uwe

8 REPLIES 8

Former Member
0 Kudos

Hi,

For the DAT type file. You have to mentioned the HAS_FIELD_SEPARATOR parameter then only it will work it is mandatory for DAT file type.

set HAS_FIELD_SEPARATOR = X'

<b><REMOVED BY MODERATOR></b>

Thanks,

Muthu.

Message was edited by:

Muthu Prabakaran Selvam

Message was edited by:

Alvaro Tejada Galindo

0 Kudos

Hi Muthu,

FILETYPE = 'DAT'

HAS_FIELD_SEPARATOR = X'

generated an error "Wrong value of the parameter filetype".

When I changed FILETYPE to 'ASC', I have many '#' when I save the records to database.

null

Former Member
0 Kudos

You may use file separater importing parameter and file type as ASCI.

harimanjesh_an
Active Participant
0 Kudos

hi kian,

If u r using DAT file then HAS_FIELD_SEPERATOR should contain X.

<b>check the following code:</b>

parameters: p_file like rlgrap-filename. " File Name.

call function 'GUI_UPLOAD'

exporting

filename = p_file " NAME of the file

<b> filetype = 'DAT'

has_field_separator = 'X '</b> " <b>X indicates Fields are separated by tabs.</b>

tables

data_tab = t_file " Internal table that contains the file data

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.

<b>IF the file type is DAT then following rules applies.</b>

The components of the internal table are filled from the file. If the

table contains several columns, the entries in the file must be

separated by tabs. No conversion exits are carried out.

The following applies for the different data types:

- I or N or P or F

The numbers must be formatted according to the decimal representation

defined in the user settings.

- D

The date must be defined according to the date format defined in the

user settings.

- T

The time must have the format hh:mm:ss.

Reward me if useful...

Harimanjesh AN

uwe_schieferstein
Active Contributor
0 Kudos

Hello Kian

With respect to <b>Unicode </b>you should no longer use function modules for GUI upload/download but replace this by the corresponding methods GUI_UPLOAD and GUI_DOWNLOAD of class <b>CL_GUI_FRONTEND_SERVICES</b>.

Like already said method GUI_UPLOAD has a parameter HAS_FIELD_SEPARATOR where 'X' means "<i>Columns Separated by Tabs in Case of ASCII Upload</i>".

Regards

Uwe

0 Kudos

Hi Uwe,

when i set

FILETYPE = 'DAT'

HAS_FIELD_SEPARATOR = 'X'

I got an error message ''Wrong value of the parameter filetype".

When I changed FILETYPE = 'ASC',

My DB records become errorneous with many # in the fields of the records.

0 Kudos

Hi Kian

now try with some other set of data

i mean to say when uploading data use some other data (not same as before )

0 Kudos

Hi Sumant, it doesn't solve the problem