调用类cl_abap_structdescr中的方法describe_by_data()和get_ddic_field_list()能得到表或结构的列名字(colomn name). 代码: REPORT ztest_convers_row. DATA: gwa_data TYPE t001w, desc_struc TYPE REF TO cl_abap_structdescr, git_fields TYPE ddfields. FIELD-SYMBOLS: <gfs_component> TYPE dfies....
调用类cl_abap_structdescr中的方法describe_by_data()和get_ddic_field_list()能得到表或结构的列名字(colomn name). 代码: REPORT ztest_convers_row. DATA: gwa_data TYPE t001w, desc_struc TYPE REF TO cl_abap_structdescr, git_fields TYPE ddfields. FIELD-SYMBOLS: <gfs_component> TYPE dfies....
Unfortunately I am having to use a type ref to cl_abap_tabledescr rather than cl_abap_structdescr as it dumps when I use the later and then use the following ref_descr ?= cl_abap_typedescr=>describe_by_data( <gt_table> ). My issue then occurs with the resultant table that is retu...
=CL_ABAP_TYPEDESCR=>DESCRIBE_BY_data(name). BREAK-POINT. 例2: TYPES: my_table TYPE HASHED TABLE OF i WITH UNIQUE KEY TABLE LINE. DATA: descr_ref TYPErefto cl_abap_tabledescr. FIELD-SYMBOLS: <key_comp_wa>TYPE abap_keydescr. START-OF-SELECTION. descr_ref?=cl_abap_typedescr=>descri...
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' ). ...
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_...
DATA(lv_column) =1."设置列= 1 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).
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 ). ...
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( WA_DEPT ). LOOP AT DESCR_REF->COMPONENTS ASSIGNING <fs_dept>. WRITE: / <fs_dept>-NAME. ENDLOOP. 例子2: TYPES: my_table TYPE HASHED TABLE OF i WITH UNIQUE KEY TABLE LINE. DATA: descr_ref TYPE ref to cl_abap_tabledescr. FIELD-...