Application Development and Automation 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: 
Read only

Does 'GUI_UPLOAD' support 'DAT' filetype..?

Former Member
0 Likes
7,475

Hi All,

I am working on an Upload program. In that they have used the file type as 'DAT'.

My doubt is whether <b>'GUI_UPLOAD'</b> supports <b>'DAT'</b> filetype or not.

Bacause, while uploading the tool, I am getting '<b>Invalid file type error</b>'.

can anyone let me know the reason this issue.

Thanks & Regards,

Paddu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,834

Hi,

It supports 'DAT' & 'ASC' both files.

Try the follwoing code:


DATA: v_file type string.

  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                = v_file
      has_field_separator     = 'X'
    TABLES
      data_tab                = it_invc
    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><REMOVED BY MODERATOR></b>

Ashvender

Message was edited by:

Alvaro Tejada Galindo

6 REPLIES 6
Read only

Former Member
0 Likes
2,835

Hi,

It supports 'DAT' & 'ASC' both files.

Try the follwoing code:


DATA: v_file type string.

  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename                = v_file
      has_field_separator     = 'X'
    TABLES
      data_tab                = it_invc
    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><REMOVED BY MODERATOR></b>

Ashvender

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
2,834

Yes it does support DAT file type, please read the function documntation for usage

Read only

Former Member
0 Likes
2,834

GUI_UPLOAD does not support DAT file types.Instead use ASC or BIN

Read only

Former Member
0 Likes
2,834

Hi Paddu

while we update the data from a file , that file should be in .txt format.

It shows error while the file is in .dat format. txt file contain the ascii data or text which is supported. But .dat may contain both text or binary data. so it is not supported.

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

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
2,834

Hi Paddu,

gui_upload <b>does not</b> support <b>DAT</b> format.

It should be either <b>ASC</b> or <b>BIN</b>.

For reference check Function Module Documentation.....

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

Best Regards,

Ram.

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
2,834

<b>GUI_UPLOAD does support "ASC", "BIN" & "DAT" Filetypes.</b>

details regd filetypes:

'BIN'

A binary representation of the internal table is read from the file.

No conversion or interpretation is carried out. Usually, this produces

meaningful results only if the internal table consists of a single

column of type 'X'.

'DAT'

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

table contains more than one column, the entries in the file must be

separated by tabs. Conversion exits are not carried out.

For the different data types, the following applies:

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 formatted according to the date format defined in the

user settings.

T

The time must have format hh:mm:ss.

'ASC'.

The components of the internal table are filled from the file. Only data

types of fixed length are allowed. The data must be contained on the

file in its entire length.

refer from the documentation of gui_upload from tcode se37.

regards,

srinivas