on 05-11-2013 7:52 AM
Hi,
In one of the tasks I have been required to output the data, which comes both from Product BOL-entity (model node) and from regular function (value node). In order to do that I defined a context node (CN) in component controller and in desired view and binded them. This CN is a mixed node, since it's based on model and value nodes at the same time.
I succeeded to fill-in this CN with the data, but I faced out with the problem at the step of data retrieving from the context node. After some debug I found out, that I get an casting exception in GET_attr_name( ) method (default wizard's implementation), when I'm trying to cast variable of CL_BSP_WD_MIXED_NODE to CL_CRM_BOL_ENTITY, in order to execute get_related_entity( ).
My question is how can I solve/avoid this problem and achieve the access to related entity of mixed node?
Thanks.
Hi Mike,
The context node that you are using is a mixed node, so from this node you need to get model node so that you can cast the entity into CL_CRM_BOL_ENTITY.
Here's the sample code:
DATA:
lr_mixed TYPE REF TO cl_bsp_wd_mixed_node,
lr_entity TYPE REF TO cl_crm_bol_entity,
lr_child TYPE REF TO cl_crm_bol_entity.
lr_mixed = me->typed_context->node_name->collection_wrapper->get_current( ).
lr_entity ?= lr_mixed->if_bsp_wd_ext_property_access~get_model_node( ).
lr_child ?= lr_entity->get_related_entities( ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The question was resolved.
Hope, soon I'll can publish a detailed post about this task.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello mike,
As mixed node and model node are of different classes so you can not type cast between those two. As praveen suggested first get the model node from mixed node by using IF_BSP_WD_EXT_PROPERTY_ACCESS~GET_MODEL_NODE of cl_bsp_wd_mixed_node class and assign it to cl_crm_bol_entity . Then execute the get_related_entity/enties according to your requirement. Hope this will solve your problem.
Regards,
Santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use IF_BSP_WD_EXT_PROPERTY_ACCESS~GET_MODEL_NODE method of mixed node class and take that entity into cl_crm_bol_entity and execute get related entity method.
i hope i understand this in correct way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.