cancel
Showing results for 
Search instead for 
Did you mean: 

How to set value for a node binded to the BOL

Former Member
0 Kudos

Hi,

I have added a new search help in component BT116QH_SRVQ for node 'ZCAMPID' attribute - 'CAMPAIGN_ID'.

I facing values setting the value in this attribute after fetching the value from the search help screen.

This node has the attribute base_entity_name as 'BTOrder'.

if i use

me->typed_context->zcampid->collection_wrapper->get_current( ).

It says that zcampid does not exist.

This node is not available in the comp. controller and hence not able to access throught the comp,controller.

I think i will have to get the current from the BASE_ENTITY_NAME, but i don't know how?

Can you please help me set value to the node 'zcampid'.

Thanks in advance.

Regards

Shanthi.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shanthi,

Seems like you are trying to access context zcampid in some other view or in context class where it does not exist/ is not available.

If you have base entity access, you can reach to your intended entity by following the relationships those we can see in genil_model_browser.

TRY.

lr_entity ?= focus_bo.

lr_collection = lr_entity->get_related_entities(

iv_relation_name = 'entity_relation'

iv_mode = iv_mode ).

CATCH cx_crm_genil_model_error.

  • should never happen

RETURN.

CATCH: cx_sy_ref_is_initial,

cx_sy_move_cast_error. " parent is still value node

RETURN.

ENDTRY.

Please let me know in which method you are trying to set the value and also code that you are using.

Please let me know if this helps.

Thanks,

Bhushan

Former Member
0 Kudos

You have to use z context node class.

me->ztyped_context->zcampid->collection_wrapper->get_current( ).

Answers (1)

Answers (1)

nisha_vinod
Advisor
Advisor
0 Kudos

Hello Shanti,

Where exactly are you trying to access you Zcontext node? If you want to access the node via component controller, the code snippet would look something like this:

data : lr_comp TYPE REF TO <<CompControllerImplClass>>,   "If Z class, then <<ZCompControllerImplClass>
         lr_entity     TYPE REF TO cl_crm_bol_entity.


 lr_comp ?= me->comp_controller.

 check lr_comp is BOUND.
 lr_entity ?= lr_comp->ztyped_context-><<ZContextNodeName>>->collection_wrapper->get_current( ).

"Now use lr_entity's set_property_as_string to set the value of you reqd property
 lr__entity->set_property_as_string(  iv_attr_name = <<Attrname>>  iv_value =<<Attrval>> ).

Hope this helps.

Regards

Nisha