SAP提供了几个标准类别,其中一些重要类别如下: 1 CL_ABAP_TYPEDESCR:用于在运行时创建类型属性 2 CL_ABAP_DATADESCR:用于在运行时处理数据类型 3 CL_ABAP_STRUCTDESCR:用于在运行时创建和描述结构 4 CL_ABAP_TABLEDESCR:用于在运行时创建和描述表 声明和使用示例: RTTS 6.权限检查对象:另一个习惯是使用权限检...
| |--CL_ABAP_REFDESCR | |--CL_ABAP_COMPLEXDESCR | |--CL_ABAP_STRUCTDESCR | |--CL_ABAP_TABLEDESCR |--CL_ABAP_OBJECTDESCR |--CL_ABAP_CLASSDESCR |--CL_ABAP_INTFDESCR DATA: structtypeTYPEREFTOcl_abap_structdescr. structtype ?= cl_abap_typedescr=>describe_by_name('spfli'). DATA: ...
| |--CL_ABAP_REFDESCR | |--CL_ABAP_COMPLEXDESCR | |--CL_ABAP_STRUCTDESCR | |--CL_ABAP_TABLEDESCR |--CL_ABAP_OBJECTDESCR |--CL_ABAP_CLASSDESCR |--CL_ABAP_INTFDESCR DATA: structtypeTYPEREFTOcl_abap_structdescr. structtype ?= cl_abap_typedescr=>describe_by_name('spfli'). DATA: ...
r_tabletype = cl_abap_tabledescr=>create( p_line_type = ex_structdescr p_table_kind = cl_abap_tabledescr=>tablekind_std ). CREATE DATA ex_result_ref TYPE HANDLE r_tabletype. *传递结果集一个数据对象-内表 r_adbc_result->set_param_table( itab_ref = ex_result_ref ). *获取数据内...
LOOP AT lt_table INTO ls_table. 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
r_adbc_result TYPE REF TO cl_sql_result_set, r_tabletype TYPE REF TO cl_abap_tabledescr, r_cxadbc TYPE REF TO cx_dba_adbc, r_cxsql TYPE REF TO cx_sql_exception, tabix_n(4) TYPE n, column_names TYPE HASHED TABLE OF adbc_name WITH UNIQUE KEY table_line. ...
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
DATA: DESCR_REF TYPE REF TO CL_ABAP_STRUCTDESCR, tab type REF TO cl_abap_tabledescr, comp_tab type cl_abap_structdescr=>component_table, WA_COMP LIKE LINE OF COMP_TAB. FIELD-SYMBOLS: <COMP_WA> TYPE ABAP_COMPDESCR, <COMP_FIELD> TYPE ANY. FIELD-SYMBOLS: <DL_TABLE> TYPE TABLE. DAT...
= 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 作为参数。但是...
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 EXCEPTIONS type_not_found = 1 OTHERS = 2. IF sy-subrc ...