IV_INPUT TYPE ANY
value( EV_OUTPUT ) TYPE ANY
data: lo_elem type ref to cl_abap_elemdescr,
lo_type type ref to cl_abap_typedescr,
ls_fieldinfo type rsanu_s_fieldinfo.
"Set initial output value to input value. This allows to exit in failure conditions.
ev_output = iv_input.
lo_elem ?= cl_abap_elemdescr=>describe_by_data( iv_input ).
"If the data has no DDIC structure, exit
if lo_elem->is_ddic_type( ) <> abap_true.
return.
endif.
data(ls_dfies) = lo_elem->get_ddic_field( sy-langu ).
"If DDIC structure has no conversion exit, exit.
if ls_dfies-convexit is initial.
return.
endif.
"If alpha just convert right away and return
if ls_dfies-convexit = gc_alpha.
ev_output = |{ iv_input alpha = in }|.
return.
endif.
move-corresponding ls_dfies to ls_fieldinfo.
try.
cl_rsan_ut_conversion_exit=>try_conv_int_ext_int(
exporting
i_fieldinfo = ls_fieldinfo
i_value = iv_input
i_conversion_errors_type = '*'
importing
e_value = ev_output ).
catch cx_root into data(lv_exc).
clear ev_output.
return.
endtry.
IT_OUT TYPE TABLE
data: lt_table type ref to cl_abap_tabledescr,
lt_data type ref to data.
get reference of it_out into lt_data.
lt_table ?= cl_abap_structdescr=>describe_by_data_ref( lt_data ).
loop at it_out assigning field-symbol(<fs_out>).
loop at lt_table->key assigning field-symbol(<fs_fields>).
assign component <fs_fields> of structure <fs_out> to field-symbol(<fs_value>).
if <fs_value> is assigned.
"Call the previous method here
endif.
endloop.
endloop.
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 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |