DATA: lr_core TYPE REF TO cl_crm_bol_core.
lr_core = cl_crm_bol_core=>get_instance( ).
lr_core->start_up( 'BT' ).
*Get the BOL Core instance
lr_core = cl_crm_bol_core=>get_instance( ).
DATA:lv_query TYPE REF TO cl_crm_bol_query_service.
lv_query = cl_crm_bol_query_service=>get_ instance( 'BTQuery1O' ).
** Set a search criterion
lv_query->set_property( iv_attr_name = 'OBJECT_ID' iv_value = '8000002731' ).
*Get Search Criteria
DATA:lv_objid TYPE REF TO data.
lv_objid = lv_query->get_property( iv_attr_name = 'OBJECT_ID' ).
*Get Corresponding Text for a given value.
*Text will be fetched from Domain If available or else,
*fetch from GENIL Component
DATA:lv_sex TYPE string.
lv_sex = lv_query->get_property_text( 'SEX' ).
* Execute the query and receive result
DATA:lv_result TYPE REF TO if_bol_entity_col.
lv_result = lv_query->get_query_result( ).
IF lv_result IS NOT INITIAL.
DATA:lr_orderheader TYPE REF TO cl_crm_bol_entity,
lr_order TYPE REF TO cl_crm_bol_entity.
lr_order ?= lv_result->get_current( ).
TRY.
CALL METHOD lr_order->get_related_entity
EXPORTING
iv_relation_name = 'BTOrderHeader'
RECEIVING
rv_result = lr_orderheader.
CATCH cx_crm_genil_model_error .
ENDTRY.
lr_orderheader->switch_to_ change_mode( ).
IF lr_orderheader->lock( ) = 'X'.
IF lr_orderheader->is_changeable( ) = 'X'.
* lr_orderheader->set_property( iv_attr_name = 'DESCRIPTION'
* iv_value = 'Description Changed' ). or
lr_orderheader->if_bol_bo_ property_access~set_property( iv_attr_name = 'DESCRIPTION'
iv_value = 'Description Changed' ).
*Send All Changes to BO Layer
lr_core->modify( ).
*6. Save and Commit the Changes Using Global Tranaction Context
DATA:lv_transaction TYPE REF TO if_bol_transaction_context .
lv_transaction = lr_core->get_transaction( ).
lv_transaction->save( ).
lv_transaction->commit( ).
ENDIF.
ENDIF.
ENDIF.