Skip to Content
0
Former Member
Aug 23, 2007 at 06:38 AM

GUI_DOWNLOAD --> WRITE_FIELD_SEPARATOR

838 Views

Hi,

I am using this code to save/download table to txt file.

I am using WRITE_FIELD_SEPARATOR = ';' but stil separator is SPACE??

Can someone help. plz..

  DATA: ldf_filename TYPE string,
  ldf_path TYPE string,
  ldf_fullpath TYPE string,
  ldf_fname TYPE string.

  CALL METHOD cl_gui_frontend_services=>file_save_dialog
  EXPORTING
* WINDOW_TITLE =
* DEFAULT_EXTENSION =
  default_file_name = ldf_fname
* FILE_FILTER =
* INITIAL_DIRECTORY =
* WITH_ENCODING =
* PROMPT_ON_OVERWRITE = 'X'
  CHANGING
  filename = ldf_filename
  path = ldf_path
  fullpath = ldf_fullpath
* USER_ACTION =
* FILE_ENCODING =
  EXCEPTIONS
  cntl_error = 1
  error_no_gui = 2
  OTHERS = 4.

  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
*   BIN_FILESIZE                  =
      filename                      = ldf_filename
   FILETYPE                      = 'ASC'
*   APPEND                        = ' '
   WRITE_FIELD_SEPARATOR         = ';'
*   HEADER                        = '00'
*   TRUNC_TRAILING_BLANKS         = ' '
*   WRITE_LF                      = 'X'
*   COL_SELECT                    = ' '
*   COL_SELECT_MASK               = ' '
*   DAT_MODE                      = ' '
* IMPORTING
*   FILELENGTH                    =
    TABLES
      data_tab                      = lt_spoollst
* EXCEPTIONS
*   FILE_WRITE_ERROR              = 1
*   NO_BATCH                      = 2
*   GUI_REFUSE_FILETRANSFER       = 3
*   INVALID_TYPE                  = 4
*   NO_AUTHORITY                  = 5
*   UNKNOWN_ERROR                 = 6
*   HEADER_NOT_ALLOWED            = 7
*   SEPARATOR_NOT_ALLOWED         = 8
*   FILESIZE_NOT_ALLOWED          = 9
*   HEADER_TOO_LONG               = 10
*   DP_ERROR_CREATE               = 11
*   DP_ERROR_SEND                 = 12
*   DP_ERROR_WRITE                = 13
*   UNKNOWN_DP_ERROR              = 14
*   ACCESS_DENIED                 = 15
*   DP_OUT_OF_MEMORY              = 16
*   DISK_FULL                     = 17
*   DP_TIMEOUT                    = 18
*   FILE_NOT_FOUND                = 19
*   DATAPROVIDER_EXCEPTION        = 20
*   CONTROL_FLUSH_ERROR           = 21
*   OTHERS                        = 22
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.