Professional Documents
Culture Documents
For more information about the xxl_simple_api, ABAP developers can refer to SAP Help
documentation at xxl_simple_api.
Here is the ABAP example code used to export SAP data to Excel in spreadsheet format using
the XXL_SIMPLE_API function module call.
REPORT zexcelsample .
es_filename = 'TPAR.xls'.
es_header = 'SAP TPAR Table Contents'.
ls_col_text-col_no = '2'.
ls_col_text-col_name = 'PARVW'.
APPEND ls_col_text TO lt_col_text.
ls_col_text-col_no = '3'.
ls_col_text-col_name = 'STEIN'.
APPEND ls_col_text TO lt_col_text.
ls_col_text-col_no = '4'.
ls_col_text-col_name = 'UPARV'.
APPEND ls_col_text TO lt_col_text.
ls_col_text-col_no = '5'.
ls_col_text-col_name = 'FEHGR'.
APPEND ls_col_text TO lt_col_text.
ls_col_text-col_no = '6'.
ls_col_text-col_name = 'ERNAM'.
APPEND ls_col_text TO lt_col_text.
ls_col_text-col_no = '7'.
ls_col_text-col_name = 'NRART'.
APPEND ls_col_text TO lt_col_text.
ls_col_text-col_no = '8'.
ls_col_text-col_name = 'HITYP'.
APPEND ls_col_text TO lt_col_text.
When you execute the above ABAP report, first the followin screen will be displayed
You select the Table option rather than the Pivot table option and press Enter key to continue
with the next screen.
The only available option seems to be Microsoft Excel. Press Enter button to continue.
And in the above screenshot you can see the SAP TPAR table data exported to Excel using the
ABAP function module xxl_simple_api
As you can see in the screenshot if you "Save the data in the spreadsheet" the SAP data export to
Excel spreadsheet file format will be completed successfully.