abap2xlsx/ZA2X/CLAS/ZCL_EXCEL_CONVERTER_RESULT_EX.slnk

98 lines
4.4 KiB
XML

<?xml version="1.0" encoding="utf-16"?>
<CLAS CLSNAME="ZCL_EXCEL_CONVERTER_RESULT_EX" VERSION="1" LANGU="E" DESCRIPT="SALV - ALV converter for export" UUID="4F665952949E0125E1008000C008015A" CATEGORY="00" EXPOSURE="2" STATE="1" RELEASE="0" AUTHOR="RTURNHEIM" CREATEDON="20120319" CHANGEDBY="RTURNHEIM" CHANGEDON="00000000" CHGDANYON="00000000" CLSFINAL="X" CLSCCINCL="X" FIXPT="X" UNICODE="X" R3RELEASE="700" CLSBCCAT="00" DURATION_TYPE="0 " RISK_LEVEL="0 " REFCLSNAME="ZCL_EXCEL_CONVERTER_RESULT">
<publicSection>class ZCL_EXCEL_CONVERTER_RESULT_EX definition
public
inheriting from ZCL_EXCEL_CONVERTER_RESULT
final
create public .
*&quot;* public components of class ZCL_EXCEL_CONVERTER_RESULT_EX
*&quot;* do not include other source files here!!!
public section.
methods ZIF_EXCEL_CONVERTER~CAN_CONVERT_OBJECT
redefinition .
methods ZIF_EXCEL_CONVERTER~CREATE_FIELDCATALOG
redefinition .</publicSection>
<protectedSection>*&quot;* protected components of class ZCL_EXCEL_CONVERTER_RESULT_EX
*&quot;* do not include other source files here!!!
protected section.</protectedSection>
<privateSection>*&quot;* private components of class ZCL_EXCEL_CONVERTER_EX_RESULT
*&quot;* do not include other source files here!!!
private section.</privateSection>
<localImplementation>*&quot;* local class implementation for public class
*&quot;* use this source file for the implementation part of
*&quot;* local helper classes</localImplementation>
<localTypes>*&quot;* use this source file for any type declarations (class
*&quot;* definitions, interfaces or data types) you need for method
*&quot;* implementation or private method&apos;s signature</localTypes>
<localMacros>*&quot;* use this source file for any macro definitions you need
*&quot;* in the implementation part of the class</localMacros>
<inheritance CLSNAME="ZCL_EXCEL_CONVERTER_RESULT_EX" REFCLSNAME="ZCL_EXCEL_CONVERTER_RESULT" VERSION="1" STATE="1" AUTHOR="RTURNHEIM" CREATEDON="20120319" CHANGEDON="00000000">
<redefinition CLSNAME="ZCL_EXCEL_CONVERTER_RESULT_EX" REFCLSNAME="ZCL_EXCEL_CONVERTER_RESULT" VERSION="1" MTDNAME="ZIF_EXCEL_CONVERTER~CAN_CONVERT_OBJECT"/>
<redefinition CLSNAME="ZCL_EXCEL_CONVERTER_RESULT_EX" REFCLSNAME="ZCL_EXCEL_CONVERTER_RESULT" VERSION="1" MTDNAME="ZIF_EXCEL_CONVERTER~CREATE_FIELDCATALOG"/>
</inheritance>
<interfaceMethod CLSNAME="ZCL_EXCEL_CONVERTER_RESULT_EX" CPDNAME="ZIF_EXCEL_CONVERTER~CAN_CONVERT_OBJECT">
<source>METHOD ZIF_EXCEL_CONVERTER~CAN_CONVERT_OBJECT.
DATA: lo_result TYPE REF TO cl_salv_ex_result_data_table.
TRY.
lo_result ?= io_object.
CATCH cx_sy_move_cast_error .
RAISE EXCEPTION TYPE zcx_excel.
ENDTRY.
ENDMETHOD.</source>
</interfaceMethod>
<interfaceMethod CLSNAME="ZCL_EXCEL_CONVERTER_RESULT_EX" CPDNAME="ZIF_EXCEL_CONVERTER~CREATE_FIELDCATALOG">
<source>METHOD zif_excel_converter~create_fieldcatalog.
DATA: lo_result TYPE REF TO cl_salv_ex_result_data_table,
lo_ex_cm TYPE REF TO cl_salv_ex_cm,
lo_data TYPE REF TO data.
FIELD-SYMBOLS: &lt;fs_table&gt; TYPE STANDARD TABLE.
TRY.
zif_excel_converter~can_convert_object( io_object = io_object ).
ENDTRY.
lo_result ?= io_object.
CLEAR: es_layout,
et_fieldcatalog.
IF lo_result IS BOUND.
lo_data = get_table( io_object = lo_result-&gt;r_model-&gt;r_data ).
IF lo_data IS BOUND.
ASSIGN lo_data-&gt;* TO &lt;fs_table&gt; .
lo_ex_cm ?= lo_result-&gt;r_model-&gt;r_model.
ws_layo = lo_ex_cm-&gt;s_layo.
* T_DRDN Instance Attribute Public Type LVC_T_DROP
wt_fcat = lo_ex_cm-&gt;t_fcat.
wt_filt = lo_ex_cm-&gt;t_filt.
* T_HYPE Instance Attribute Public Type LVC_T_HYPE
* T_SELECTED_CELLS Instance Attribute Public Type LVC_T_CELL
* T_SELECTED_COLUMNS Instance Attribute Public Type LVC_T_COL
wt_sort = lo_ex_cm-&gt;t_sort.
apply_sort( EXPORTING it_table = &lt;fs_table&gt;
IMPORTING eo_table = eo_table ) .
get_color( EXPORTING io_table = eo_table
IMPORTING et_colors = et_colors ) .
get_filter( EXPORTING io_table = eo_table
IMPORTING et_filter = et_filter ) .
update_catalog( CHANGING cs_layout = es_layout
ct_fieldcatalog = et_fieldcatalog ).
else.
* We have a problem and should stop here.
ENDIF.
ENDIF.
ENDMETHOD.</source>
</interfaceMethod>
</CLAS>