abap2xlsx/ZA2X/PROG/ZDEMO_EXCEL7.slnk
2010-12-24 11:34:08 +00:00

352 lines
21 KiB
XML

<?xml version="1.0" encoding="utf-16"?>
<PROG NAME="ZDEMO_EXCEL7" VARCL="X" SUBC="1" CNAM="FEMIA" CDAT="20100711" UNAM="BCUSER" UDAT="20101224" VERN="000028" RSTAT="T" RMAND="001" RLOAD="E" FIXPT="X" SDATE="20101224" STIME="105126" IDATE="20101224" ITIME="105126" UCCHECK="X">
<textPool>
<language SPRAS="E">
<textElement ID="R" ENTRY="abap2xlsx Demo: All conditional formating possibilities" LENGTH="55 "/>
<textElement ID="S" KEY="P_PATH" ENTRY="D ." LENGTH="9 "/>
</language>
</textPool>
<programDocumentation/>
<source>*&amp;---------------------------------------------------------------------*
*&amp; Report ZDEMO_EXCEL7
*&amp;
*&amp;---------------------------------------------------------------------*
*&amp;
*&amp;
*&amp;---------------------------------------------------------------------*
REPORT zdemo_excel7.
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,
lo_style_conditional TYPE REF TO zcl_excel_style_conditional.
DATA: lv_file TYPE xstring,
lv_bytecount TYPE i,
lt_file_tab TYPE solix_tab.
DATA: lv_full_path TYPE string,
lv_workdir TYPE string,
lv_file_separator TYPE c.
CONSTANTS: lv_default_file_name TYPE string VALUE &apos;07_ConditionalAll.xlsx&apos;.
PARAMETERS: p_path TYPE zexcel_export_dir.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
lv_workdir = p_path.
cl_gui_frontend_services=&gt;directory_browse( EXPORTING initial_folder = lv_workdir
CHANGING selected_folder = lv_workdir ).
p_path = lv_workdir.
INITIALIZATION.
cl_gui_frontend_services=&gt;get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ).
p_path = lv_workdir.
START-OF-SELECTION.
IF p_path IS INITIAL.
p_path = lv_workdir.
ENDIF.
cl_gui_frontend_services=&gt;get_file_separator( CHANGING file_separator = lv_file_separator ).
CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path.
CREATE OBJECT lo_excel.
&quot; Get active sheet
lo_worksheet = lo_excel-&gt;get_active_worksheet( ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_3arrows.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;B&apos;
ip_start_row = 5
ip_stop_column = &apos;B&apos;
ip_stop_row = 9 ).
lo_worksheet-&gt;set_cell( ip_row = 4 ip_column = &apos;B&apos; ip_value = &apos;C_ICONSET_3ARROWS&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 5 ip_column = &apos;B&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 6 ip_column = &apos;B&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 7 ip_column = &apos;B&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 8 ip_column = &apos;B&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 9 ip_column = &apos;B&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_3arrowsgray.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;C&apos;
ip_start_row = 5
ip_stop_column = &apos;C&apos;
ip_stop_row = 9 ).
lo_worksheet-&gt;set_cell( ip_row = 4 ip_column = &apos;C&apos; ip_value = &apos;C_ICONSET_3ARROWSGRAY&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 5 ip_column = &apos;C&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 6 ip_column = &apos;C&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 7 ip_column = &apos;C&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 8 ip_column = &apos;C&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 9 ip_column = &apos;C&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_3flags.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;D&apos;
ip_start_row = 5
ip_stop_column = &apos;D&apos;
ip_stop_row = 9 ).
lo_worksheet-&gt;set_cell( ip_row = 4 ip_column = &apos;D&apos; ip_value = &apos;C_ICONSET_3FLAGS&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 5 ip_column = &apos;D&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 6 ip_column = &apos;D&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 7 ip_column = &apos;D&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 8 ip_column = &apos;D&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 9 ip_column = &apos;D&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_3trafficlights.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;E&apos;
ip_start_row = 5
ip_stop_column = &apos;E&apos;
ip_stop_row = 9 ).
lo_worksheet-&gt;set_cell( ip_row = 4 ip_column = &apos;E&apos; ip_value = &apos;C_ICONSET_3TRAFFICLIGHTS&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 5 ip_column = &apos;E&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 6 ip_column = &apos;E&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 7 ip_column = &apos;E&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 8 ip_column = &apos;E&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 9 ip_column = &apos;E&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_3trafficlights2.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;F&apos;
ip_start_row = 5
ip_stop_column = &apos;F&apos;
ip_stop_row = 9 ).
lo_worksheet-&gt;set_cell( ip_row = 4 ip_column = &apos;F&apos; ip_value = &apos;C_ICONSET_3TRAFFICLIGHTS2&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 5 ip_column = &apos;F&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 6 ip_column = &apos;F&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 7 ip_column = &apos;F&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 8 ip_column = &apos;F&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 9 ip_column = &apos;F&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_3signs.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;G&apos;
ip_start_row = 5
ip_stop_column = &apos;G&apos;
ip_stop_row = 9 ).
lo_worksheet-&gt;set_cell( ip_row = 4 ip_column = &apos;G&apos; ip_value = &apos;C_ICONSET_3SIGNS&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 5 ip_column = &apos;G&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 6 ip_column = &apos;G&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 7 ip_column = &apos;G&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 8 ip_column = &apos;G&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 9 ip_column = &apos;G&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_3symbols.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;H&apos;
ip_start_row = 5
ip_stop_column = &apos;H&apos;
ip_stop_row = 9 ).
lo_worksheet-&gt;set_cell( ip_row = 4 ip_column = &apos;H&apos; ip_value = &apos;C_ICONSET_3SYMBOLS&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 5 ip_column = &apos;H&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 6 ip_column = &apos;H&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 7 ip_column = &apos;H&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 8 ip_column = &apos;H&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 9 ip_column = &apos;H&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_3symbols2.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;I&apos;
ip_start_row = 5
ip_stop_column = &apos;I&apos;
ip_stop_row = 9 ).
lo_worksheet-&gt;set_cell( ip_row = 4 ip_column = &apos;I&apos; ip_value = &apos;C_ICONSET_3SYMBOLS2&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 5 ip_column = &apos;I&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 6 ip_column = &apos;I&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 7 ip_column = &apos;I&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 8 ip_column = &apos;I&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 9 ip_column = &apos;I&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_4arrows.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;B&apos;
ip_start_row = 12
ip_stop_column = &apos;B&apos;
ip_stop_row = 16 ).
lo_worksheet-&gt;set_cell( ip_row = 11 ip_column = &apos;B&apos; ip_value = &apos;C_ICONSET_4ARROWS&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 12 ip_column = &apos;B&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 13 ip_column = &apos;B&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 14 ip_column = &apos;B&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 15 ip_column = &apos;B&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 16 ip_column = &apos;B&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_4arrowsgray.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;C&apos;
ip_start_row = 12
ip_stop_column = &apos;C&apos;
ip_stop_row = 16 ).
lo_worksheet-&gt;set_cell( ip_row = 11 ip_column = &apos;C&apos; ip_value = &apos;C_ICONSET_4ARROWSGRAY&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 12 ip_column = &apos;C&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 13 ip_column = &apos;C&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 14 ip_column = &apos;C&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 15 ip_column = &apos;C&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 16 ip_column = &apos;C&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_4redtoblack.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;D&apos;
ip_start_row = 12
ip_stop_column = &apos;D&apos;
ip_stop_row = 16 ).
lo_worksheet-&gt;set_cell( ip_row = 11 ip_column = &apos;D&apos; ip_value = &apos;C_ICONSET_4REDTOBLACK&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 12 ip_column = &apos;D&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 13 ip_column = &apos;D&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 14 ip_column = &apos;D&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 15 ip_column = &apos;D&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 16 ip_column = &apos;D&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_4rating.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;E&apos;
ip_start_row = 12
ip_stop_column = &apos;E&apos;
ip_stop_row = 16 ).
lo_worksheet-&gt;set_cell( ip_row = 11 ip_column = &apos;E&apos; ip_value = &apos;C_ICONSET_4RATING&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 12 ip_column = &apos;E&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 13 ip_column = &apos;E&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 14 ip_column = &apos;E&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 15 ip_column = &apos;E&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 16 ip_column = &apos;E&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_4trafficlights.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;F&apos;
ip_start_row = 12
ip_stop_column = &apos;F&apos;
ip_stop_row = 16 ).
lo_worksheet-&gt;set_cell( ip_row = 11 ip_column = &apos;F&apos; ip_value = &apos;C_ICONSET_4TRAFFICLIGHTS&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 12 ip_column = &apos;F&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 13 ip_column = &apos;F&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 14 ip_column = &apos;F&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 15 ip_column = &apos;F&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 16 ip_column = &apos;F&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_5arrows.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;B&apos;
ip_start_row = 19
ip_stop_column = &apos;B&apos;
ip_stop_row = 23 ).
lo_worksheet-&gt;set_cell( ip_row = 18 ip_column = &apos;B&apos; ip_value = &apos;C_ICONSET_5ARROWS&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 19 ip_column = &apos;B&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 20 ip_column = &apos;B&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 21 ip_column = &apos;B&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 22 ip_column = &apos;B&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 23 ip_column = &apos;B&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_5arrowsgray.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;C&apos;
ip_start_row = 19
ip_stop_column = &apos;C&apos;
ip_stop_row = 23 ).
lo_worksheet-&gt;set_cell( ip_row = 18 ip_column = &apos;C&apos; ip_value = &apos;C_ICONSET_5ARROWSGRAY&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 19 ip_column = &apos;C&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 20 ip_column = &apos;C&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 21 ip_column = &apos;C&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 22 ip_column = &apos;C&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 23 ip_column = &apos;C&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_5rating.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;D&apos;
ip_start_row = 19
ip_stop_column = &apos;D&apos;
ip_stop_row = 23 ).
lo_worksheet-&gt;set_cell( ip_row = 18 ip_column = &apos;D&apos; ip_value = &apos;C_ICONSET_5RATING&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 19 ip_column = &apos;D&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 20 ip_column = &apos;D&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 21 ip_column = &apos;D&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 22 ip_column = &apos;D&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 23 ip_column = &apos;D&apos; ip_value = 50 ).
lo_style_conditional = lo_worksheet-&gt;add_new_conditional_style( ).
lo_style_conditional-&gt;rule = zcl_excel_style_conditional=&gt;c_rule_iconset.
lo_style_conditional-&gt;iconset = zcl_excel_style_conditional=&gt;c_iconset_5quarters.
lo_style_conditional-&gt;priority = 1.
lo_style_conditional-&gt;set_range( ip_start_column = &apos;E&apos;
ip_start_row = 19
ip_stop_column = &apos;E&apos;
ip_stop_row = 23 ).
lo_worksheet-&gt;set_cell( ip_row = 18 ip_column = &apos;E&apos; ip_value = &apos;C_ICONSET_5QUARTERS&apos; ).
lo_worksheet-&gt;set_cell( ip_row = 19 ip_column = &apos;E&apos; ip_value = 10 ).
lo_worksheet-&gt;set_cell( ip_row = 20 ip_column = &apos;E&apos; ip_value = 20 ).
lo_worksheet-&gt;set_cell( ip_row = 21 ip_column = &apos;E&apos; ip_value = 30 ).
lo_worksheet-&gt;set_cell( ip_row = 22 ip_column = &apos;E&apos; ip_value = 40 ).
lo_worksheet-&gt;set_cell( ip_row = 23 ip_column = &apos;E&apos; ip_value = 50 ).
CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007.
lv_file = lo_excel_writer-&gt;write_file( lo_excel ).
&quot; Convert to binary
CALL FUNCTION &apos;SCMS_XSTRING_TO_BINARY&apos;
EXPORTING
buffer = lv_file
IMPORTING
output_length = lv_bytecount
TABLES
binary_tab = lt_file_tab.
* &quot; This method is only available on AS ABAP &gt; 6.40
* lt_file_tab = cl_bcs_convert=&gt;xstring_to_solix( iv_xstring = lv_file ).
* lv_bytecount = xstrlen( lv_file ).
&quot; Save the file
cl_gui_frontend_services=&gt;gui_download( EXPORTING bin_filesize = lv_bytecount
filename = lv_full_path
filetype = &apos;BIN&apos;
CHANGING data_tab = lt_file_tab ).</source>
</PROG>