09-13-2008 6:40 AM
What is different between exporting and returning value in method of a class. if created an object inside the method and exporting it, it means I have a reference to that object inside program. If I use returning value, it means I have a copy of object created inside the method, but the object inside method is destroyed after it ends. Do I understand correctly? if so what do u prefer exporting or returning value? thanks!
09-13-2008 11:26 AM
09-14-2008 10:30 AM
Hello Anthony
The major difference is that you can have multiple EXPORTING parameters yet only a single RETURNING parameter. In addition, if you have a RETURNING parameter you cannot have EXPORTING parameters simultaneously.
Defining methods with a single RETURNING parameter is more Java-like than having multiple EXPORTING parameters.
Whenever possible and sensible I prefer RETURNING parameters over EXPORTING parameters because they allow to use the function method call, e.g.:
go_msglist = cf_reca_messagelist_create( ).
Regards
Uwe
09-15-2008 8:25 PM