2015 Sep 02 2:48 PM
Hi to everyone,
how do I access to the content of a representation node?
I've created a representation node referencing another existing custom business object (I have followed the instructions found in Thea Hillebrand's document and I can retrieve correctly the data of the representation node when testing it with the BOBT transaction, so I guess I got the configuration right). I'm trying to retrieve the node data using io_read->retrieve_by_association from inside an action defined in the root node of the host business object but I'm getting an unhandled exception.
io_read->retrieve_by_association(
exporting iv_node = is_ctx-node_key
it_key = it_key
iv_association = zhost_bobj=>sc_association-host_root-repr_node
iv_fill_data = abap_true
importing et_data = lt_repr_node_data ).
Where lt_repr_node_data's type is the combined tabletype of the node referenced in the representation node.
I also found Aiko Schmalle's approach (), which it's actually related to delegated nodes and not to representation nodes but anyway I tried it... with no success either.
Sorry if this has been already answered, but I really have searched for it and haven't found anything.
Regards,
A.
2015 Sep 02 2:56 PM
Hello Alvaro,
please use the service manager of the source BO (that has the cross-bo association and the representation node defined). You can receive the instance via the factory:
data lo_sm type ref to /bobf/if_tra_service_manager.
lo_sm = /bobf/if_tra_serv_mgr_factory=>get_service_manager( iv_bo_key = <CONSTANT_INTERFACE_OF_SOURCE_BO>=>sc_bo_key ).
lo_sm->retrieve_by_association( ... ).
Attention: Delegated Nodes and Representation Nodes are different kinds of nodes. A delegated node includes a dependent object, that means it is replaced by reuse logic. A representation node is just a reference to a node of a foreign business object.
Best regards
Tilmann
2015 Sep 02 2:56 PM
Hello Alvaro,
please use the service manager of the source BO (that has the cross-bo association and the representation node defined). You can receive the instance via the factory:
data lo_sm type ref to /bobf/if_tra_service_manager.
lo_sm = /bobf/if_tra_serv_mgr_factory=>get_service_manager( iv_bo_key = <CONSTANT_INTERFACE_OF_SOURCE_BO>=>sc_bo_key ).
lo_sm->retrieve_by_association( ... ).
Attention: Delegated Nodes and Representation Nodes are different kinds of nodes. A delegated node includes a dependent object, that means it is replaced by reuse logic. A representation node is just a reference to a node of a foreign business object.
Best regards
Tilmann
2015 Sep 02 3:37 PM
Thank you so much, Tilmann!
It worked. The need of the usage of the node service manager inside of an action that belongs to that same node (and where reading and modifying interfaces are available) felt a little akward for me... but I can live with it.
Regards,
A.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |