Download internal table ke file excel

  DATA     : ld_file LIKE rlgrap-filename.

  DATA: BEGIN OF lt_display OCCURS 0,
        ebeln(15),
        ebelp(15),
        matnr(15),
        txz01(15),
        menge(15),
        meins(15),
        fob(25),
        waers(15),
        invno(15),
        vslname(15),
        cntno(15),
      END OF lt_display.

  IF ld_file CP '*.xls'.
  ELSE.
    CONCATENATE ld_file '.xls' INTO ld_file.
    CONDENSE ld_file.
  ENDIF.

  CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
    EXPORTING
      i_filename        = ld_file
    TABLES
      i_tab_sap_data    = lt_display
    EXCEPTIONS
      conversion_failed = 1
      OTHERS            = 2.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s