This the way that I use to describe the fields. DATA: l_oref_structure TYPE REF TO cl_abap_structdescr, l_abap_compdescr type abap_compdescr. DATA: l_fields_table type SOI_FIELDS_TABLE. ASSIGN r_dyn_table->* TO <t_dyn_table>. CREATE DATA r_wa_dyn_table LIKE LINE OF <t_dyn_...
DATAlw_tab_refTYPE REF TO data. CREATE DATAlw_tab_refLIKE LINE OFpt_tab. DATAtablestructureTYPE REF TOcl_abap_structdescr. tablestructure ?= cl_abap_typedescr=>describe_by_data_ref(lw_tab_ref). *set column name得到列名 LOOP ATtablestructure->componentsREFERENCE INTO DATA(compone...
= cl_abap_typedescr=>describe_by_data_ref( lw_tab_ref ).*set column name 得到列名LOOPATtablestructure->componentsREFERENCEINTODATA(component). first_xlsx_sheet->set_cell_content( iv_row =1iv_column=lv_column iv_value= component->name ). lv_column= lv_column +1.ENDLOOP.DATA(lv_row) ...
DATA : LR_REF_TABLE_DES TYPE REF TO CL_ABAP_STRUCTDESCR . “定义field变量,type any FIELD-SYMBOLS : 《L_FIELD》 TYPE ANY, 《L_FIELD_C》 TYPE ANY. **动态得到内表结构 ”全局结构 LR_REF_TABLE_DES ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( 'LIKP' ). LT_IDETAILS[] = LR_REF_TABLE...
tablestructure ?= cl_abap_typedescr=>describe_by_data_ref( lw_tab_ref ). "获取内表的 componentsDATA(tablecomponents) = tablestructure->get_components( )."get the content of excel.TYPES:BEGINOFcolumninfo, columnTYPEi, columnnameTYPEstring,ENDOFcolumninfo.TYPEScolumnsinfoTYPESTANDARDTABLEOFcolumn...
调用类cl_abap_structdescr中的方法describe_by_data()和get_ddic_field_list()能得到表或结构的列名字(colomn name). 代码: [crayon-67468d1774f1d669 ... 阅读全文 如何连接HANA数据库读取表数据 1, 取保SAP系统与HANA 数据库服务器网络连接 在SE38中运行report RSBDCOS0,ping一下HANA database,确保没有...
DATA: ref_struct TYPE REF TO cl_abap_structdescr, ref_element TYPE REF TO cl_abap_elemdescr, ddic TYPE dfies, component TYPE abap_compdescr. ref_struct ?= cl_abap_typedescr=>describe_by_name( 'TY_SELECTED' ). LOOP AT ref_struct->components INTO component.. ref_element ?= cl_abap_...
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...
DATA : REF_TABLE_DES TYPE REF TO CL_ABAP_STRUCTDESCR. DATA : INT_DETAILS TYPE ABAP_COMPDESCR_TAB, * Get the structure of the table. REF_TABLE_DES ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( DB_TABLE ). INT_DETAILS[] = REF_TABLE_DES->COMPONENTS[]. ...
有时候我们要在程序运行的时候取得某个内表或者某个结构它的属性或者它的字段的属性,可能通过类CL_ABAP_TYPEDESCR和它的子类取得指定内表的属性。 类CL_ABAP_TYPEDESCR和它的子类的结构图 CL_ABAP_TYPEDESCR | |--CL_ABAP_DATADESCR | | | |--CL_A