Hi,
A mixed node would contain both value node & model node. Sometimes we need to have a node which can contain some fields which we don't need to persist. For e.g. if you have provided your date of birth , then persisting age is of no use. We can calculate it from your DOB , hence we can have DOB as model field of a model node & show age as value field of a value attribute. Yes I have taken a simple example but there could be a scenario which drives this.
How to access Mix node
DATA: lr_mixed_node TYPE REF TO cl_bsp_wd_mixed_node,
lr_model_node TYPE REF TO if_bol_bo_property_access,
lr_value_node TYPE REF TO if_bol_bo_property_access.
IF iterator IS BOUND.
current = iterator->get_current( ).
ELSE.
current = collection_wrapper->get_current( ).
ENDIF.
lr_mixed_node ?= current.
lr_model_node ?= lr_mixed_node->if_bsp_wd_ext_property_access~get_model_node( ).
ANd from lr_model_node entity you can read the attributes you want from model node.
Similarly get value node using get_value_node method .
More 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( ).
Regards,
Sumeet