cancel
Showing results for 
Search instead for 
Did you mean: 

How to access mixed node

juergenbaur
Active Participant
0 Kudos

Hi all,

I attached one new field 'TDID_SELECT' with GET and SET Methods on BTText Entity in my View.

Question is how can I access the field in my event handler?

The coding below doesn't work.

data: lr_collection type ref to if_bol_bo_col,

lr_context_node type ref to cl_bsp_wd_context_node,

lr_current type ref to if_bol_bo_property_access,

lr_mixed type ref to cl_bsp_wd_mixed_node,

lr_iterator type ref to if_bol_bo_col_iterator.

data: lv_tdid type tdid.

data: lv_sel_tdid type tdid.

lr_iterator = me->typed_context->bttext->collection_wrapper->get_iterator( ).

lr_mixed ?= lr_iterator->get_current( ).

check lr_mixed is bound.

lr_mixed->if_bol_bo_property_access~get_property_as_value(

exporting

iv_attr_name = 'TDID_SELECT' "#EC NOTEXT

importing

ev_result = lv_sel_tdid ).

Edited by: juergen71 on Dec 7, 2011 5:05 PM

Edited by: juergen71 on Dec 7, 2011 5:06 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

what error/exception do you get?

juergenbaur
Active Participant
0 Kudos

catch CX_ROOT into EXC.

LV_WRITER = ME->VIEW_MANAGER->GET_OUT( ).

Acception occured CX_SY_NO_HANDLER.

VishnAndr
Active Contributor
0 Kudos

Hi, Juergen.

The exception you provided is just a general one. Try to debug your peace of code and see which statement rises an exception and which one (it'll be available in message area at the bottom when you get it).

juergenbaur
Active Participant
0 Kudos

Hi,

I've created a Value node and deleted the value attribute form the model node.

Look's better anyway.

br

Jürgen

Former Member
0 Kudos

Hi

Try With this piece of code

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 .