*&---------------------------------------------------------------------* *& Report ZDEMO_EXCEL25 *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT zdemo_excel25. DATA: lo_excel TYPE REF TO zcl_excel, lo_excel_writer TYPE REF TO zif_excel_writer, lo_worksheet TYPE REF TO zcl_excel_worksheet. DATA: lv_file TYPE xstring. CONSTANTS: lv_default_file_name TYPE string VALUE '/tmp/25_HelloWorld.xlsx'. " Creates active sheet CREATE OBJECT lo_excel. " Get active sheet lo_worksheet = lo_excel->get_active_worksheet( ). lo_worksheet->set_title( ip_title = 'Sheet1' ). lo_worksheet->set_cell( ip_column = 'B' ip_row = 2 ip_value = 'Hello world' ). CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. lv_file = lo_excel_writer->write_file( lo_excel ). OPEN DATASET lv_default_file_name FOR OUTPUT IN BINARY MODE. TRANSFER lv_file TO lv_default_file_name. CLOSE DATASET lv_default_file_name.