Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Unable to set new values in Entity

Hi Experts,

I am trying to change an entity from readonly to changeable and set property of an attribute. But, i am not successful. In the below "If ME->IS_CHAN......" condition, the second condition is not successful and it doesnot let the entity to change. I am not sure, from where the data is getting filled for "ME->CONTAINER_PROXY->DATA_REF->ATTRIBUTE_REF". Can someone please point me the solution ?

Thanks in advance.

method IF_BOL_BO_PROPERTY_ACCESS~SET_PROPERTY .
  data: LV_IDX       type CRMT_IDX,
        LV_PROPS_OBJ type ref to IF_GENIL_OBJ_ATTR_PROPERTIES.
  field-symbols: <DATA>  type any,
                 <VALUE> type any.

  MAKE_VALID_STATE( ).

  assign ME->CONTAINER_PROXY->DATA_REF->ATTRIBUTE_REF->* to <DATA>.
  assign component IV_ATTR_NAME of structure <DATA> to <VALUE>.
  if SY-SUBRC = 0.
*   check changeability of property
    LV_PROPS_OBJ = ME->CONTAINER_PROXY->GET_ATTR_PROPS_OBJ( ).
    try.
        LV_IDX = OBJECT_MODEL->GET_ATTR_IDX_BY_NAME(
                             IV_OBJECT_NAME = ME->MY_INSTANCE_KEY->OBJECT_NAME
                             IV_ATTR_NAME   = IV_ATTR_NAME ).


        if ME->IS_CHANGEABLE( ) = ABAP_TRUE and
           LV_PROPS_OBJ->GET_PROPERTY_BY_IDX( LV_IDX ) ne IF_GENIL_OBJ_ATTR_PROPERTIES=>READ_ONLY.

          if <VALUE> ne IV_VALUE.
            if ME->MY_MANAGER_ENTRY->DELTA_FLAG is initial.
*             first 'change' -> proof that entity is locked
              if ME->MY_MANAGER_ENTRY->LOCKED = FALSE.
                if ME->LOCK( ) = FALSE.
                  return.
                endif.
              endif.

Edited by: Gaurav Subramaniam on Jun 2, 2011 5:30 PM

Edited by: Gaurav Subramaniam on Jun 2, 2011 5:31 PM

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question