Skip to Content
author's profile photo Former Member
Former Member

GUI_UPLOAD can't upload data in a tab-delimited text file

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Oct 22, 2007 at 11:59 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:22 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:25 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2007 at 11:41 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.