*&---------------------------------------------------------------------* *& Report ZIFE_TEST_EXCEL *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* 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, lv_file TYPE xstring, lv_bytecount TYPE i, lt_file_tab TYPE STANDARD TABLE OF solisti1. CREATE OBJECT lo_excel. " Get active sheet lo_worksheet = lo_excel->get_active_worksheet( ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3arrows. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'B' ip_start_row = 5 ip_stop_column = 'B' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'B' ip_value = 'C_ICONSET_3ARROWS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'B' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'B' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'B' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'B' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'B' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3arrowsgray. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'C' ip_start_row = 5 ip_stop_column = 'C' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = 'C_ICONSET_3ARROWSGRAY' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'C' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'C' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'C' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3flags. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'D' ip_start_row = 5 ip_stop_column = 'D' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'D' ip_value = 'C_ICONSET_3FLAGS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'D' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'D' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'D' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'D' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'D' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'E' ip_start_row = 5 ip_stop_column = 'E' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'E' ip_value = 'C_ICONSET_3TRAFFICLIGHTS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'E' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'E' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'E' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'E' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'E' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3trafficlights2. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'F' ip_start_row = 5 ip_stop_column = 'F' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'F' ip_value = 'C_ICONSET_3TRAFFICLIGHTS2' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'F' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'F' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'F' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'F' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'F' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3signs. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'G' ip_start_row = 5 ip_stop_column = 'G' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'G' ip_value = 'C_ICONSET_3SIGNS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'G' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'G' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'G' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'G' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'G' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3symbols. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'H' ip_start_row = 5 ip_stop_column = 'H' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'H' ip_value = 'C_ICONSET_3SYMBOLS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'H' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'H' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'H' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'H' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'H' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_3symbols2. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'I' ip_start_row = 5 ip_stop_column = 'I' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'I' ip_value = 'C_ICONSET_3SYMBOLS2' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'I' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'I' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'I' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'I' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'I' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4arrows. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'B' ip_start_row = 12 ip_stop_column = 'B' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'B' ip_value = 'C_ICONSET_4ARROWS' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'B' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'B' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'B' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'B' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'B' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4arrowsgray. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'C' ip_start_row = 12 ip_stop_column = 'C' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'C' ip_value = 'C_ICONSET_4ARROWSGRAY' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'C' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'C' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'C' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'C' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'C' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4redtoblack. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'D' ip_start_row = 12 ip_stop_column = 'D' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'D' ip_value = 'C_ICONSET_4REDTOBLACK' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'D' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'D' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'D' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'D' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'D' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4rating. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'E' ip_start_row = 12 ip_stop_column = 'E' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'E' ip_value = 'C_ICONSET_4RATING' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'E' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'E' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'E' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'E' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'E' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_4trafficlights. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'F' ip_start_row = 12 ip_stop_column = 'F' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'F' ip_value = 'C_ICONSET_4TRAFFICLIGHTS' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'F' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'F' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'F' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'F' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'F' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_5arrows. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'B' ip_start_row = 19 ip_stop_column = 'B' ip_stop_row = 23 ). lo_worksheet->set_cell( ip_row = 18 ip_column = 'B' ip_value = 'C_ICONSET_5ARROWS' ). lo_worksheet->set_cell( ip_row = 19 ip_column = 'B' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 20 ip_column = 'B' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 21 ip_column = 'B' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 22 ip_column = 'B' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 23 ip_column = 'B' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_5arrowsgray. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'C' ip_start_row = 19 ip_stop_column = 'C' ip_stop_row = 23 ). lo_worksheet->set_cell( ip_row = 18 ip_column = 'C' ip_value = 'C_ICONSET_5ARROWSGRAY' ). lo_worksheet->set_cell( ip_row = 19 ip_column = 'C' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 20 ip_column = 'C' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 21 ip_column = 'C' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 22 ip_column = 'C' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 23 ip_column = 'C' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_5rating. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'D' ip_start_row = 19 ip_stop_column = 'D' ip_stop_row = 23 ). lo_worksheet->set_cell( ip_row = 18 ip_column = 'D' ip_value = 'C_ICONSET_5RATING' ). lo_worksheet->set_cell( ip_row = 19 ip_column = 'D' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 20 ip_column = 'D' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 21 ip_column = 'D' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 22 ip_column = 'D' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 23 ip_column = 'D' ip_value = 50 ). lo_style_conditional = lo_worksheet->add_new_conditional_style( ). lo_style_conditional->rule = zcl_excel_style_conditional=>c_rule_iconset. lo_style_conditional->iconset = zcl_excel_style_conditional=>c_iconset_5quarters. lo_style_conditional->priority = 1. lo_style_conditional->set_range( ip_start_column = 'E' ip_start_row = 19 ip_stop_column = 'E' ip_stop_row = 23 ). lo_worksheet->set_cell( ip_row = 18 ip_column = 'E' ip_value = 'C_ICONSET_5QUARTERS' ). lo_worksheet->set_cell( ip_row = 19 ip_column = 'E' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 20 ip_column = 'E' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 21 ip_column = 'E' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 22 ip_column = 'E' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 23 ip_column = 'E' ip_value = 50 ). create object lo_excel_writer type zcl_excel_writer_2007. lv_file = lo_excel_writer->write_file( lo_excel ). "convert to table CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = lv_file IMPORTING output_length = lv_bytecount TABLES binary_tab = lt_file_tab. "Save the file CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING bin_filesize = lv_bytecount filename = 'C:\Iconset.xlsx' filetype = 'BIN' TABLES data_tab = lt_file_tab.