Check the below code....
- *Get the Entity of BuilHeader Object
- CALL METHOD lr_builheader->get_related_entity
- EXPORTING
- iv_relation_name = 'BuilAddress'
- RECEIVING
- rv_result = lr_builheader.
- CATCH cx_crm_genil_model_error .
- ENDTRY.
- *
- lr_lr_builheader->switch_to_change_mode( ).
- *Locks are always set on root object.
- IF lr_builheader->lock( ) = 'X'.
- IF lr_builheader->is_changeable( ) = 'X'.
- *
- *Set property also locks the object entity if lock has not been set.
- lr_builheader->if_bol_bo_property_access~set_property( iv_attr_name = 'CITY'
- iv_value = 'Melbourne' ).
- *Modify BOL layer
- lr_core->modify( ).
- ENDIF.
- ENDIF.
- *Save and Commit Changes Using Global Transaction Context
- *
- DATA: lr_transaction TYPE REF TO if_bol_transaction_context .
- *
- lr_transaction = lr_core->get_transaction( ).
- lr_transaction->save( ).
- lr_transaction->commit( ).
Regards,
Sumeet