Skip to Content
0
Former Member
Feb 01, 2012 at 12:05 PM

How to download all data from BOL Collection

198 Views

Hi Experts,

How to download all data from BOL Collection into '*.xls' into local computer drive.

I am using this code but it is not working...

FORM file_creation .


CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
 EXPORTING
   DATE_INTERNAL                  = SY-DATUM
 IMPORTING
   DATE_EXTERNAL                  = lv_date
 EXCEPTIONS
   DATE_INTERNAL_IS_INVALID       = 1
   OTHERS                         = 2
          .
IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.


  CONCATENATE lv_date '.xls' INTO  lv_filename.
   CALL METHOD cl_gui_frontend_services=>gui_download
    EXPORTING
*              bin_filesize              =
      filename                  =  lv_filename "'ABC.als'
*              filetype                  = 'ASC'
      append                    = 'X'
      write_field_separator     = 'X'
*              header                    = '00'
*              trunc_trailing_blanks     = SPACE
*              write_lf                  = 'X'
*              col_select                = SPACE
*              col_select_mask           = SPACE
*              dat_mode                  = SPACE
*              confirm_overwrite         = SPACE
*              no_auth_check             = SPACE
*              codepage                  = SPACE
*              ignore_cerr               = ABAP_TRUE
*              replacement               = '#'
*              write_bom                 = SPACE
*              trunc_trailing_blanks_eol = 'X'
*              wk1_n_format              = SPACE
*              wk1_n_size                = SPACE
*              wk1_t_format              = SPACE
*              wk1_t_size                = SPACE
*              show_transfer_status      = 'X'
*              fieldnames                =
*              write_lf_after_last_line  = 'X'
*            IMPORTING
*              filelength                =
    CHANGING
      data_tab                  = gt_but000_download
    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
      not_supported_by_gui      = 22
      error_no_gui              = 23
      OTHERS                    = 24
          .
  IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   

  ENDIF.

ENDFORM.                    " FILE_CREATION

It is giving error ' not_supported_by_gui ' .Is there any solution??????

Best Regards,

Vishal