Quantcast
Channel: SCN: Message List - ABAP Connectivity
Viewing all articles
Browse latest Browse all 3125

Re: Downloading Data to excel using GUI_DOWNLOAD

$
0
0

Hi ,

Very late to reply.

 

Pass values in Filednames parameter.

 

Sample :

 

LOOP AT it_fcat_pnl INTO lw_fldcat.

 

     CLEAR :wa_field_name.

     wa_field_name-field_name = lw_fldcat-coltext.

     APPEND wa_field_name TO i_field_name.

 

     CLEAR : lw_fldcat.

   ENDLOOP.

 

CALL FUNCTION 'GUI_DOWNLOAD'

     EXPORTING

       filename                        = p_file

      filetype                        = 'ASC'

*     APPEND                          = ' '

      write_field_separator           = 'X'

 

*   IMPORTING

*     FILELENGTH                      =

     TABLES

      data_tab                        = <lfs_table>

      fieldnames                      = i_field_name

    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.

 

It will surely help.


Viewing all articles
Browse latest Browse all 3125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>