DATA(typedescr) = cl_abap_typedescr=>describe_by_data( param ).
DATA:
elemdescr TYPE REF TO cl_abap_elemdescr,
structdescr TYPE REF TO cl_abap_structdescr,
tabledescr TYPE REF TO cl_abap_tabledescr.
TRY.
elemdescr ?= typedescr.
...
CATCH cx_sy_move_cast_error.
TRY.
structdescr ?= typedescr.
...
CATCH cx_sy_move_cast_error.
TRY.
tabledescr ?= typedescr.
...
CATCH cx_sy_move_cast_error.
...
ENDTRY.
ENDTRY.
ENDTRY.
DATA(typedescr) = cl_abap_typedescr=>describe_by_data( param ).
IF typedescr IS INSTANCE OF cl_abap_elemdescr.
DATA(elemdescr) = CAST cl_abap_elemdescr( typedescr ).
...
ELSEIF typedescr IS INSTANCE OF cl_abap_structdescr.
DATA(structdescr) = CAST cl_abap_structdescr( typedescr ).
...
ELSEIF typedescr IS INSTANCE OF cl_abap_tabledescr.
DATA(tabledescr) = CAST cl_abap_tabledescr( typedescr ).
...
ELSE.
...
ENDIF.
DATA(typedescr) = cl_abap_typedescr=>describe_by_data( param ).
CASE TYPE OF typedescr.
WHEN TYPE cl_abap_elemdescr INTO DATA(elemdescr).
...
WHEN TYPE cl_abap_structdescr INTO DATA(structdescr).
...
WHEN TYPE cl_abap_tabledescr INTO DATA(tabledescr).
...
WHEN OTHERS.
...
ENDCASE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |