2007 Jun 19 12:34 PM
Hi Guys,
Is it possible to use such bolded statement in ABAP OO?
data: some_object type ref to dummy.
create object some_object.
<b>some_object->get_another()->method_of_another_object().</b>
Best regards,
Wojciech
Hi Guys,
Is it possible to use such bolded statement in ABAP OO?
data: some_object type ref to dummy.
create object some_object.
<b>some_object->get_another()->method_of_another_object().</b>
Best regards,
Wojciech
2007 Jun 19 2:16 PM
Hello Wojciech
I use frequently the interface IF_RECA_MESSAGE_LIST as message handler for my classes. The interface is defines as instance attribute (e.g. MO_MSGLIST).
At the beginning of the CONSTRUCTOR method I instantiate this interface:
me->mo_msglist = cf_reca_message_list=>create( ).In order to collect SYST messages I use the following method:
me->mo_msglist->add_symsg( id_detlevel = '1' ).However, if your bolded statement implies that instance <i>some_object</i> instantiates another object instance and <b>simultaneously</b> calls one of its methods I do not think this is (yet) possible.
Regards
Uwe
2007 Jun 19 4:02 PM
Hi,
I'm getting an reference in get_another to another object. This object already exists.
Regards,
Wojciech
2007 Jun 19 9:24 PM
Hello Wojciech
If I adjust my example to your logic then the coding would look like this:
" some_object->get_another() ==> cf_reca_message_list=>create( ) " returns instance
" method_of_another_object() ==> -add_symsg (of returned instance)
cf_reca_message_list=>create( )->add_symsg( id_detlevel = '1' ).Well, in this case I am convinced that is <b>not possible</b>.
Regards
Uwe
2007 Jun 19 10:05 PM
I've checked it on two systems 6.4 and 7.0. On both application servers it's not possible to use more than one method in one statement. Access to internal reference is only available via public reference fields. Thank you for your involvement.
Best regards,
Wojciech
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |