ZBSP_BOL162

Embed Size (px)

DESCRIPTION

report

Citation preview

*&---------------------------------------------------------------------**& Report ZTEST_1*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORT ZBSP_BOL162.*Data declarationsdata: lr_core type ref to cl_crm_bol_core, lr_query type ref to CL_CRM_BOL_DQUERY_SERVICE, LR_RESULT TYPE REF TO IF_BOL_ENTITY_COL, LR_ENTITY TYPE REF TO cl_crm_bol_entity.Data lv_transaction TYPE REF TO if_bol_transaction_context.*Get the BOL Core instancelr_core = cl_Crm_bol_core=>get_instance( ).*Load the component setLR_CORE->LOAD_COMPONENT_SET( 'BP_APPL' ).*Create the query instance by passing the search object namelr_query = CL_CRM_BOL_DQUERY_SERVICE=>get_instance( iv_query_name = 'BuilEmployeeAdvancedSearch' ).*Add the selection parametersCALL METHOD LR_QUERY->ADD_SELECTION_PARAM EXPORTING IV_ATTR_NAME = 'PARTNER' IV_SIGN = 'I' IV_OPTION = 'EQ' IV_LOW = '408697'* IV_HIGH = .*Get the result listLR_RESULT = LR_QUERY->GET_QUERY_RESULT( ).*Get the first object(entity) in the result listLR_ENTITY ?= LR_RESULT->GET_FIRST( ).*-------------------------------------------------------*Lock and modify the propertyif LR_ENTITY->lock( ) = if_genil_Boolean=>true.*------------------------------------------------------*Change the fieldsLR_ENTITY->set_property( iv_attr_name = 'BP_NUMBER' iv_value = '408697' ).LR_ENTITY->set_property( iv_attr_name = 'BIRTH_PLACE' iv_value = 'Secunderabad' ).LR_ENTITY->set_property( iv_attr_name = 'SEARCHTERM2' iv_value = 'Emp 408697' ).LR_ENTITY->set_property( iv_attr_name = 'EMPLOYER' iv_value = 'Oasis' ).*CoreLR_CORE->modify( ).lv_transaction = lr_core->get_transaction( ).lv_transaction->save( ).lv_transaction->commit( ).*If the entity is bound*WHILE LR_ENTITY IS BOUND.***Go to the next entity*LR_ENTITY ?= LR_RESULT->GET_NEXT( ).*ENDWHILE.*------------------------------------------------------endif.