Skip to Content
0
Nov 30, 2011 at 10:42 AM

set_property is not working

785 Views

Hi,

I am trying to over write the values of the attributes in my entity. But the set_property is not working. Following is the piece of my code.Can anyone suggest how to achieve this.I have written this code in my event while closing a pop up window.

It does not change the values in lr_entity.Please help.

lr_current1 ?= me->typed_context->relationship->collection_wrapper->get_current( ).

lr_entity1 ?= lr_current1.

TRY.

lr_entity ?= lr_entity1->get_related_entity( iv_relation_name = 'BuilContactPersonStandardAddressRel' ).

CATCH cx_root .

ENDTRY.

IF lr_entity IS BOUND.

  • lr_entity->switch_to_change_mode( ).

me->view_group_context->set_view_editable( me ).

lr_entity->set_property_as_string(

iv_attr_name = 'BP_NUMBER' "#EC NOTEXT

iv_value = lv_account ).

lv_contact = lv_contp.

lr_entity->set_property_as_string(

iv_attr_name = 'CONP_NUMBER' "#EC NOTEXT

iv_value = lv_contact ).

lr_entity->set_property_as_string(

iv_attr_name = 'ADDRESS_GUID' "#EC NOTEXT

iv_value = lv_guid )."gv_string )

lr_entity->set_property_as_string(

iv_attr_name = 'ADDR_SHORT' "#EC NOTEXT

iv_value = gv_string ).

ELSE.

TRY .

lr_entity = lr_entity1->create_related_entity( iv_relation_name = 'BuilContactPersonStandardAddressRel' ).

CATCH cx_root.

ENDTRY.

IF lr_entity IS BOUND.

lr_entity->set_property(

iv_attr_name = 'ADDRESS_GUID' "#EC NOTEXT

iv_value = gv_addressguid ).

lr_entity->set_property(

iv_attr_name = 'ADDR_SHORT' "#EC NOTEXT

iv_value = gv_string )

lr_entity->set_property(

iv_attr_name = 'BP_NUMBER' "#EC NOTEXT

iv_value = gv_account ).

lr_entity->set_property(

iv_attr_name = 'CONP_NUMBER' "#EC NOTEXT

iv_value = lv_contp ).

ENDIF.

ENDIF.