Download Android App of sapabap-vamsi

sapabap-vamsi : Download Android App for Mobiles

Saturday, August 27, 2011

How to download internal table into an Excel file?


Use the function module SAP_CONVERT_TO_XLS_FORMAT to download the internal table to an excel file.

PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'c:\tmp\test.xls'.
DATA: t100_Lines TYPE STANDARD TABLE OF t001 WITH DEFAULT KEY.

SELECT * FROM t001 INTO TABLE t100_Lines.

CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
EXPORTING
  i_filename     = p_file
TABLES
  i_tab_sap_data = t100_Lines.

2 comments: