Hi ,
I have added new fields to BTCustomerH and added it a context node to BTAdminH. In the method (do_prepare_output), i try to read the values on the screen using the statements below :
l_btcustomerh ?= ztyped_context->btcustomerh->collection_wrapper->get_current( ).
IF l_btcustomerh IS BOUND.
CALL METHOD l_btcustomerh->get_properties(
IMPORTING
es_attributes = wa_customer ).
ENDIF.
But in wa_customer , i m not getting any values. Can you please help me..how to read the values.
Thank you,
Geetha K
Hi Geetha,
try the below logic.
DATA : l_btcustomerh TYPE REF TO if_bol_bo_property_access,
lr_Entity TYPE REF TO cl_crm_bol_entity.
l_btcustomerh ?= ztyped_context->btcustomerh->collection_wrapper->get_current( ).
IF l_btcustomerh IS BOUND.
lr_Entity ?= l_btcustomerh
CALL METHOD lr_Entity->if_bol_bo_property_access~get_properties(
IMPORTING
es_attributes = wa_customer ).
Hope this helps!!!
Prerna
Hi Prerna,
It is giving a dump ( type cast error )\ at the statement lr_Entity ?= l_btcustomerh
Hi,
l_btcustomerh ?= ztyped_context->btcustomerh->collection_wrapper->get_current( ).
In the above line it fetch model node as well as value node values .try in debug and let u know once . i will give u the code later once u understand.
Hi,
When ever u add value node with a model node then it will the object of type class cl_bsp_wd_mixed_node may be by this ur getting dumb.
am giving some code sample to u to deal with mixed node.
Data:
lr_props TYPE REF TO if_bol_bo_property_access,
lr_mixed TYPE REF TO cl_bsp_wd_mixed_node,
name TYPE string.
Logic:
lr_prop = me->typed_context->item->collection_wrapper->get_current( ).
lr_mixed ?= lr_prop.
CALL METHOD lr_mixed->IF_BOL_BO_PROPERTY_ACCESS~GET_PROPERTY_AS_VALUE
EXPORTING
iv_attr_name = 'NAME' //Attribute name.
IMPORTING
ev_result = name.
hope this will help you..
Hi Ravi,
the dump is gone now..but the actual issue still stays.. it is not returning any values, the structure is blank.. even though there are entries on the UI
Thank you all for the replies. I was making a mistake while sending the data to the screen , so it was reading those values. I was sending the data as a value node , instead i shud have as a model node. I corrected it now and the get_properties is working fine now.
Try to read values form Component controlller not from node.
lr_entity ?= lr_comp->typed_context->node_name->collection_wrapper->get_current( ).
wa_xxxx = lr_entity->get_propeties( use this method ).
try this and check the values in debug.
Hi,
Might be possible,sometimes you can see the fields under the context node but you are not able to read. For this, You first need to read BTADMINH and then use get_related_entity method( relation name would be of CustomerH). You will get the relation name from GENIL_MODEL_BROWSER.
Regards,
Hem