cancel
Showing results for 
Search instead for 
Did you mean: 

attribute not updated after SET_PROPERTY

former_member188843
Participant
0 Kudos

Hi All Expert,

I set on context's attribute from another context node after set i checked the entity it was updated. But after display in UI, it displayed the old value again.

What could be the reason?

Accepted Solutions (0)

Answers (5)

Answers (5)

devashish_bhattacharya
Active Participant
0 Kudos

Hi Joshua,

Since you want to SET that attribute somewhere else, please comment out the coding inside the setter method of that attribute which you want to set.

Regards,

Devashish

former_member188843
Participant
0 Kudos

hi,

i need it there because in somewhere else is for batch. when user come to this single record.he should still be able to change it.

kavindra_joshi
Active Contributor
0 Kudos

Check if that particular attribute is editable.


IF lv_entity->is_changeable( ) = abap_true.

lv_entity->set_property_as_string( iv_attr_name =

‘PROPERTY_NAME’

iv_value = ‘New Value’ ).

ENDIF.

If the attribute is not editable you won't be able to change the property.

Regards,

Kavindra

former_member188843
Participant
0 Kudos

it is changable.

devashish_bhattacharya
Active Participant
0 Kudos

HI Joshua,

Could you please elaborate and send your code as well?

Regards,

Devashish

Former Member
0 Kudos

Hi Joshua,

it's hard to say without seeing your code but Deepika could be right. If you forgot the modify call on the BOL core, your changes will stay in the BOL buffer and are not transferred to the GenIL layer.

Have a look at this article for more details.

Regards,

Markus

deepika_chandrasekar
Active Contributor
0 Kudos

Hi,

Where in context node you are setting the field value?

did you put lr_core-modify( ) after change.

Regards,

Deepika.

former_member188843
Participant
0 Kudos

Hi

I did set to an model node in set method of a value node.

I tried to do modify after i set. And modify triggered GenIL and inside it did the update.

But in get method of the model node. it get old value again.

deepika_chandrasekar
Active Contributor
0 Kudos

Hi Joshua.

what is code you have done in set method?

Regards,

Deepika.

Former Member
0 Kudos

Hi Joshua,

maybe the old value is still in the BOL buffer, so you get the old value even if the GenIL has already updated it? You could try method REREAD of class CL_CRM_BOL_ENTITY...

Regards,

Markus

former_member188843
Participant
0 Kudos

Hi My code as following:

if <nval> <> <oval>.

      current->set_property(
                      iv_attr_name = 'Y_STATUS_TYPE' "#EC NOTEXT
                      iv_value     = <nval> ).

    lr_core ?= cl_crm_bol_core=>get_instance( ).


    lr_col ?= direx->collection_wrapper->get_marked( ).

    lr_iterator ?= lr_col->get_iterator( ).
    check lr_iterator is bound.

    lr_direx ?=  lr_iterator->get_first( ).
    while lr_direx is bound.

      lr_direx->set_property( iv_attr_name = 'Y_STATUS_TYPE' iv_value = <nval> ).

     lr_core->modify( ).

      lr_direx ?= lr_iterator->get_next( ).
    endwhile.

former_member188843
Participant
0 Kudos

Hi,

I debugged it. The reason is after i set from value context node attribute . The set of model attribute was called again.Inside because its incoming value is the old value, so finally value was set to old.

May u know why this set was triggered?

deepika_chandrasekar
Active Contributor
0 Kudos

Hi.

Did you check from where this set method is triggered? Press F7 in SET_ method in debugger and find from where method is called

Sometime set method will be called like methods.

Regards,

Deepika.

former_member188843
Participant
0 Kudos

Hi,

Many thks for reply. It was called from CL_BSP_WD_CONTEXT_NODE->SET_S_STRUCT.and this set_s_struct was called from CL_BSP_WD_CONTEXT_NODE_TV->SET_T_TABLE.

former_member188843
Participant
0 Kudos

Hi,

Many thks for reply. It was called from CL_BSP_WD_CONTEXT_NODE->SET_S_STRUCT.and this set_s_struct was called from CL_BSP_WD_CONTEXT_NODE_TV->SET_T_TABLE.

former_member188843
Participant
0 Kudos

hi ,

i debugged more. i found in the model view.do_handle_data input parameter form_xxx, this field is inside but all the other fields is not there. This finally caused it can to set.

May u know how this is controlled? i mean how one field is treated as model fields.