DATA: lv_stmt_type TYPE string. DATA: ex_structdescr TYPE REF TO cl_abap_structdescr, ex_result_ref TYPE REF TO data. *获取sql语句的类型 lv_stmt_type = cl_hdb_sql_executor=>get_statement_type( gv_sql ). *创建默认数据库的链接对象 r_adbc_conn = cl_db6_con=>get_connection( 'MT...
DATA: lv_stmt_type TYPE string. DATA: ex_structdescr TYPE REF TO cl_abap_structdescr, ex_result_ref TYPE REF TO data. *获取sql语句的类型 lv_stmt_type = cl_hdb_sql_executor=>get_statement_type( gv_sql ). *创建默认数据库的链接对象 r_adbc_conn = cl_db6_con=>get_connection( 'MT...
*&--- 获取内表字段名、类型、长度DATA:L_TABLEDESCR_REFTYPEREFTOCL_ABAP_TABLEDESCR, L_DESCR_REFTYPEREFTOCL_ABAP_STRUCTDESCR. L_TABLEDESCR_REF ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( GT_ALV ). L_DESCR_REF ?= L_TABLEDESCR_REF->GET_TABLE_LINE_TYPE( ).LOOPATL_DESCR_REF->COMPONENTS ...
m3( struc ).ENDMETHOD.METHODm2.TYPESspfliTYPEspfli.DATAstrucTYPEspfli. m3( struc ).ENDMETHOD.METHODm3.DATAtype_descrTYPEREFTOcl_abap_typedescr. type_descr= cl_abap_typedescr=>describe_by_data( p ).WRITE/ type_descr->absolute_name.ENDMETHOD.ENDCLASS.START-OF-SELECTION. data c1_ref typeRE...
Solved: Afternoon all I am using cl_abap_typedescr=>describe_by_data( ) to retrieve the fieldlist of my dynamically created ALV fieldcatalog. However, I have just
=cl_abap_typedescr=>describe_by_data_ref(lw_tab_ref).DATA(tablecomponents)=tablestructure->get_components()."getthe contentofexcel.将excel结构和内表结构对比,判断是否一致TYPES:BEGINOFcolumninfo,columnTYPEi,columnnameTYPEstring,ENDOFcolumninfo.TYPEScolumnsinfoTYPESTANDARDTABLEOFcolumninfoWITHEMPTYKEY....
DATA(lv_column) = 1."设置列 = 1 DATA lw_tab_ref TYPE REF TO data. CREATE DATA lw_tab_ref LIKE LINE OF pt_tab. DATA tablestructure TYPE REF TO cl_abap_structdescr. tablestructure ?= cl_abap_typedescr=>describe_by_data_ref( lw_tab_ref ). ...
=cl_abap_typedescr=>describe_by_data(p_data=p_data).lw_comp-name=iv_name.lw_comp-as_include=iv_as_include.lw_comp-suffix=iv_suffix.append lw_comptot_comp.endmethod.*<SIGNATURE>---+*| Static Public Method ZCL_DYNAMIC_OBJ=>ADD_COMP_BY_DATA_REF*+---...
first_xlsx_sheet->change_sheet_name(iv_sheetname)."设置sheet的名称DATA(lv_column)=1."设置列=1DATAlw_tab_refTYPEREFTOdata.CREATEDATAlw_tab_refLIKELINEOFpt_tab.DATAtablestructureTYPEREFTOcl_abap_structdescr.tablestructure?=cl_abap_typedescr=>describe_by_data_ref(lw_tab_ref).*setcolumn name...
= cl_abap_typedescr=>describe_by_data( i_itab ).l_descr_ref ?= l_tabledescr_ref->get_table_line_type( ).LOOP AT l_descr_ref->components ASSIGNING . -name :字段名ENDLOOP.describe l_descr_ref->componentslenths len.就可以了。还有个问题:在方法中,我用table 作为参数。但是...