05-12-2013 9:42 PM
I'm trying to do a generic code but I'm having trouble with deep structure,
I have different class with different deep structure exporting parameters,
It is possible to do a "CASTING" with deep structure? Or have another way to solve my problem?
Here is the problem:
FIELD-SYMBOLS: <fs_output> TYPE ANY.
DATA: obj_class TYPE REF TO object.
CREATE OBJECT obj_class TYPE (str_proxy).
<fs_output> = wl_output1-mt_confirma_proc_palete_transf-num_id .
CALL METHOD obj_class->(str_method)
EXPORTING
output = <fs_output>. "--> CX_SY_DYN_CALL_ILLEGAL_TYPE
05-13-2013 6:24 AM
Hi Bruno,
I think you have different parameters in the method that you calling and the type of field symbol. Make sure that the type of output is ANY.
05-12-2013 11:36 PM
Hi,
I think the parameters passing can't be generic in nature in OO ABAP.
Cheers,
Arindam
05-13-2013 6:24 AM
Hi Bruno,
I think you have different parameters in the method that you calling and the type of field symbol. Make sure that the type of output is ANY.
05-13-2013 12:17 PM
Yes, I have differente parameters, I need do a CAST for deep structure, something like that:
<fs_output> = wl_output1-mt_confirma_proc_palete_transf-num_id CASTING TYPE (str_ty_deep_structure).
But this code return a Illegal casting...
05-14-2013 2:20 AM
Hi Bruno,
When dynamically calling methods you must use parameter table instead of exporting/importing. Refer to online help for call method (<f1>) and this doco: http://help.sap.com/abapdocu_70/en/ABAPCALL_METHOD_SHORTREF.htm
Cheers,
Custodio
05-14-2013 9:29 AM
Hi Bruno,
I have given a link on field symbol casting refer to that, you may get some ideas of casting and where you going wrong.