2006 Dec 28 9:19 AM
Hi!
I'm developing some classes that implement an interface. This classes will have a method that differ on the return datatype, even though it always be a table type.
When i'm calling the class methods i'm using the interface .
Data: obj type ref to YCM_INTERFACE.
create object obj type (CLASSNAME).
call method obj->GETENTRIES(
Importing
it_records = <it_records>
).
My problem is that if i define the exporting parameter on the interface method to ANY but when using it on the method implementation i always get an error.The excepiton occurs here:
FIELD-SYMBOLS: <it_records> TYPE ycmx_qualcat.
assign it_records TO <it_records>.
it_records is type any (defined on the interface method definition).
Exception:
The following error text was processed in the system NSP : Type conflict with ASSIGN in program YCM_QUALIFICATIONSCATALOG=====CP .
The termination type was: RABAX_STATE
My question is what type should i use on the method definition to make this work.
Or if there's a better way to do this i'm all ears
Thanks for your help
Pedro Barbosa
I've solved the problem. Having any in the parameter datatype was not the problem, the problem was using it as a table. That was the reason i was trying to use the assing statements.
Anyways the solution was:
Data: it_qualcat type table of ycm_qualcat.
select * from ycm_qualcat into table it_qualcat.
if sy-subrc = 0.
it_records = it_qualcat[].
endif.
Regards
Pedro Barbosa
2006 Dec 28 11:25 AM
I've solved the problem. Having any in the parameter datatype was not the problem, the problem was using it as a table. That was the reason i was trying to use the assing statements.
Anyways the solution was:
Data: it_qualcat type table of ycm_qualcat.
select * from ycm_qualcat into table it_qualcat.
if sy-subrc = 0.
it_records = it_qualcat[].
endif.
Regards
Pedro Barbosa
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |