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: 

How to download DAT file type in Unicdoe environment???

Former Member
0 Kudos

Can anyone help me to download the output in the excel sheet in DAT filetype without using DOWNLOAD and WS_DOWNLOAD coz i want this in Unicode environment...we can only use GUI_DOWNLOAD but it doesnt downloads in DAT format so can anyone suggest me any other FM or include...plz help its urgent!!

5 REPLIES 5

Former Member
0 Kudos

do this way

* Display save dialog window
  CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
*      window_title      = ' '
      DEFAULT_EXTENSION = 'XLS'
      default_file_name = 'accountsdata'
      INITIAL_DIRECTORY = 'c:temp'
    CHANGING
      filename          = ld_filename
      path              = ld_path
      fullpath          = ld_fullpath
      user_action       = ld_result.

* Check user did not cancel request
  CHECK ld_result EQ '0'.

  CALL FUNCTION 'GUI_DOWNLOAD'
   EXPORTING
        filename         = ld_fullpath
        filetype         = 'DAT'
*       APPEND           = 'X'
        write_field_separator = 'X'
*       CONFIRM_OVERWRITE = 'X'
   TABLES
        data_tab         = it_datatab[]     "need to declare and populate
   EXCEPTIONS
        file_open_error  = 1
        file_write_error = 2
        OTHERS           = 3.

Former Member
0 Kudos

try using the GUI_DOWNLOAD method of the CL_GUI_FRONTEND_SERVICES classes

Regards,

Santosh

0 Kudos

GUI _DOWNLOAD doesn't support DAT filetype that's why i am asking for help!!

0 Kudos

do that way:

CONSTANTS: c_tab_hex(1) TYPE x VALUE '09', "<- tab_delimited

c_tab_char(1) VALUE c_tab_hex.

.

.

.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = filename

filetype = 'ASC'

has_field_separator = c_tab_char

  • IMPORTING

  • FILELENGTH =

TABLES

data_tab = input

  • EXCEPTIONS

  • file_write_error = 1

.

.

.

All should be ok

DOWNLOAD:

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = vl_path

filetype = 'DAT'

write_field_separator = 'X'

TABLES

data_tab = it_out2

EXCEPTIONS

OTHERS = 1.

It woks fine

BR, Jacek

Message was edited by:

Jacek Slowikowski

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

Use Data sets if the file there in Application Server.

Regards,

kumar