调用类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....
datarefTYPEREFTOdata, struct typeREFTOcl_abap_structdescr, tab typeREFTOcl_abap_tabledescr.FIELD-SYMBOLS:<lfs_s>TYPEany,<lfs_t>TYPEanyTABLE.*for table ”SCARR”struct ?= cl_abap_structdescr=>DESCRIBE_BY_NAME( ‘SCARR’ ). comp_tab= struct->GET_COMPONENTS( ).**1-1. only need CAR...
调用类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....
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_...
=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.
r_metadata = r_adbc_result->get_struct_ref( md_tab = it_metadata p_strict = abap_false ). *创建一个数据对象-内表 ex_structdescr ?= cl_abap_typedescr=>describe_by_data_ref( r_metadata ). r_tabletype = cl_abap_tabledescr=>create( p_line_type = ex_structdescr ...
终于找到了一个方法,DATA: l_tabledesc_ref TYPE REF TO cl_abap_tabledescr, l_descr_ref TYPE REF TO cl_abap_structdescr.FIELD-SYMBOLS: TYPE abap_compdescr.l_tabledescr_ref ?= cl_abap_typedescr=>describe_by_data( i_itab ).l_descr_ref ?= l_tabledescr_ref->get_table_...
r_metadata = r_adbc_result->get_struct_ref( md_tab = it_metadata p_strict = abap_false ). *创建一个数据对象-内表 ex_structdescr ?= cl_abap_typedescr=>describe_by_data_ref( r_metadata ). r_tabletype = cl_abap_tabledescr=>create( p_line_type = ex_structdescr ...
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 : 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' ). ...