cancel
Showing results for 
Search instead for 
Did you mean: 

Internal table to binary for EXCEL

Mahadev_2
Discoverer
0 Kudos
201

<html>

TRY.
        cl_salv_table=>factory(                               "#EC CI_NOORDER
          IMPORTING
            r_salv_table DATA(r_salv)                          " Basis Class Simple ALV Tables
          CHANGING
            t_table      t_intab
        ).
      CATCH cx_salv_msg" ALV: General Error Class with Message
    ENDTRY.
    TRY.
        DATA(it_fcatcl_salv_controller_metadata=>get_lvc_fieldcatalog(
          EXPORTING
            r_columns      r_salv->get_columns)                 " ALV Filter
            r_aggregations r_salv->get_aggregations).
      CATCH cx_salv_msg.
        RETURN.
    ENDTRY.
    READ TABLE it_fcat ASSIGNING FIELD-SYMBOL(<fs_fcat>WITH KEY fieldname 'PO_LIFNR'.
    IF sy-subrc 0.
      <fs_fcat>-reptext 'PO Supplier'(003).
    ENDIF.
    TRY.
        cl_salv_bs_lex=>export_from_result_data_table(
          EXPORTING
            is_format            if_salv_bs_lex_format=>mc_format_xlsx
            ir_result_data_table =  cl_salv_ex_util=>factory_result_data_table(
          EXPORTING
            r_data              =  r_data
            t_fieldcatalog      it_fcat )
          IMPORTING
            er_result_file       DATA(er_result_file).
      CATCH cx_salv_unexpected_param_value" Unexpected value in method parameter
    ENDTRY.
*  t_btab = cl_bcs_convert=>xstring_to_solix( er_result_file ).
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
      EXPORTING
        buffer        er_result_file
      IMPORTING
        output_length len
      TABLES
        binary_tab    t_btab.

</html>

Sandra_Rossi
Active Contributor
0 Kudos
What is your issue, what is your question?
raymond_giuseppi
Active Contributor

Accepted Solutions (0)

Answers (0)