cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in updation of related entities in a BOL

Former Member
0 Kudos

Hi,

I am trying to update a related entities using BOL entity method.

But somehow the data is not updated in entity. It creates an entity but sets the default data.

CREATE_RELATED_ENTITY( IV_RELATION_NAME = 'XXXXX")

LR_PROPERTY->SET_PROPERTIES( LS_PRoperty ).

Is there any method we need to call after setting this property ?.

Regards,

Ch Deepthi.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Deepthi,

The creation of dependent or child objects normally does not trigger the API call. Therefore, it

is necessary to explicitly trigger the API call by using the MODIFY method of the BOL core,

which sends changes to the underlying generic interaction layer. Without this call, the created

child objects will only exist in the BOL buffer and never get saved.

lv_bol_core->modify( ).

DATA: lv_transaction TYPE REF TO if_bol_transaction_context

lv_transaction = lr_entity_parent->get_transaction( ).

lv_transaction->save( ).

lv_transaction->commit( ).

Regards,

Nithish

Former Member
0 Kudos

Hi Nitesh,

The standard save is calling the lv_core->modify. The entity is getting created with default values.

Is there any way , to update the related entity values after the entity is created and commited using GENIL commit work

Once the Partner is created I would like to call related entity to update values.

Regards,

Ch Deepthi.

Former Member
0 Kudos

Hi Deepthi,

You can use the same relation name to retrieve the related entity .

lr_entity2 = lr_entity->get_related_entity(iv_relation_name = '<your relation>').

Regards,

Nithish

Former Member
0 Kudos

Hi Nitesh,

Thank you.

I have called the get_related_entity and could get all attributes and then tried to update the entity and then set the properties and used bol-->modify and

DATA: lv_transaction TYPE REF TO if_bol_transaction_context.

lv_transaction = lv_bol_core->get_transaction( iv_entity = lv_entity ).

lv_transaction->save( ).

lv_transaction->commit( ).

Somehow the data i updated in set properties is not upated.

Former Member
0 Kudos

Hi Deepthi,

Try to check whether entity is locked before it is updated using method lr_entity->lock().

Regards,

Nithish

Edited by: nithish P on Feb 6, 2012 11:58 PM

former_member192854
Active Participant
0 Kudos

By the way; are you sure the right component set is loaded into the Core object?

VishnAndr
Active Contributor
0 Kudos

Hello, Ch Deepthi.

Could you provide pls your complete coding? For instance, what is lr_property?

Former Member
0 Kudos

Hi Andrea,

I created reated entity for a BP. The related entity gets cretaed, Once BP gets created and a related entity is created and commited. Whats the way to update the related entity. Any pseudocode?.

Regards,

Ch deepthi.