“定义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_DES->COMPONENTS[]. "循环判断结构每个字段 LOOP AT LT_IDETAILS...
= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME( P_NAME ). LR_TABLE ?= CL_ABAP_TABLEDESCR=>CREATE( P_LINE_TYPE =LR_STRUC ).*ASSIGN DYN_WA->* TO <DYN_WA> CASTING TYPE HANDLE LR_STRUC.*ASSIGN DYN_TABLE->* TO <DYN_TABLE> CASTING TYPE HANDLE LR_TABLE.CREATEDATADYN_WATYPEHANDLE LR_STRUC....
= cl_abap_typedescr=>describe_by_name('LVC_S_SCOL'). comp_tab-type = cl_abap_tabledescr=>create( struct_type ).INSERTcomp_tabINTOcomp_tab INDEX1. struct_type= cl_abap_structdescr=>create( p_components = comp_tab[] p_strict =abap_false ). itab_type= cl_abap_tabledescr=>create...
Hello Friends, I am using "CALL METHOD cl_abap_typedescr=>describe_by_name" for creating a dynamic table . With this the table gets generated correctly.
CONCATENATE ls_table-tabname '-' ls_table-fieldname INTO l_string. ls_comp-name = ls_table-fieldname. *读取字段类型 CALL METHOD cl_abap_datadescr=>describe_by_name EXPORTING p_name = l_string RECEIVING p_descr_ref = lr_type
CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME method gives incorrect length. In my case, i am trying to prepare dynamic internal table for KNKA table. For all the fields i am
DATA(descr) = cl_abap_typedescr=>describe_by_data( my_data ). cl_demo_output=>display( |Typename: { descr->absolute_name }\n| && |Kind: { descr->type_kind }\n| && |Length: { descr->length }\n| && |Decimals: { descr->decimals }\n| ). ...
CALL METHOD CL_ABAP_DATADESCR=>DESCRIBE_BY_NAME EXPORTING P_NAME = L_STRING RECEIVING P_DESCR_REF = LR_TYPE EXCEPTIONS TYPE_NOT_FOUND = 1 OTHERS = 2. IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ...
=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*+---...
struktur ?= cl_abap_typedescr=>describe_by_data( <aber> ). NEW-LINE. tab = 1. LOOP AT struktur->components INTO beschrieb. WRITE AT tab(10) beschrieb-name. ADD 11 TO tab. ENDLOOP. ULINE. tab = 1. 2)6.40以后可以使用代码