Quantcast
Channel: SCN : All Content - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 4552

OCA button is not deleting the record from list

$
0
0

Hi,

I am working on issue which is when i am clicking on OCA button in Contact History, item is not deleting, below code i have written, can you please help me on this.

 

CALL METHOD cl_thtmlb_util=>get_event_info
     EXPORTING
       iv_event = htmlb_event_ex
     IMPORTING
       ev_index = lv_index.
   CHECK lv_index ISNOTINITIAL.

   me->typed_context->builinteracthist->collection_wrapper->find( iv_index = lv_index ).
   lr_current ?= typed_context->builinteracthist->collection_wrapper->get_current( ).
   lr_entity ?= lr_current.


SPLIT htmlb_event_ex->event_defined AT'.'INTO lv_event lv_indx.
   CASE lv_event.
     WHEN'DELETE' .
       DATA: ls_inthist TYPE CRMT_BUPA_IL_INT_HISTORY ,
             lr_inthist TYPEREFTO cl_crm_bol_entity.
       lr_core = cl_crm_bol_core=>get_instance( ).

       lr_current->get_properties( IMPORTING es_attributes = ls_inthist ).
       lr_inthist = lr_core->get_root_entity( iv_object_name = 'BTOrder'
                                               iv_object_guid = ls_inthist-guid ).

*     Lock the activity. if locking fails nothing happens
       TRY.
           IF lr_inthist->is_locked( ) = abap_false.
             CALLMETHOD lock_dependent_entity
               EXPORTING
                 ir_entity      = lr_inthist
               RECEIVING
                 rv_success     = lv_success
               EXCEPTIONS
                 entity_deleted = 1
                 OTHERS         = 2.

             IF sy-subrc NE0OR lv_success = abap_false.
               EXIT.
             ENDIF.
           ENDIF.
         CATCH cx_bol_exception cx_sy_ref_is_initial cx_sy_no_handler.
       ENDTRY.


**     Lock the entity if locking fails nothing happens
       IF lr_entity->is_locked( ) = abap_false.
         CALLMETHOD lock_dependent_entity
           EXPORTING
             ir_entity      = lr_entity
           RECEIVING
             rv_success     = lv_success
           EXCEPTIONS
             entity_deleted = 1
             OTHERS         = 2.

         IF sy-subrc NE0OR lv_success = abap_false.
           EXIT.
         ENDIF.
       ENDIF.

       if lr_entity->lock( ) = abap_true.
         lr_customer_h_coll ?= lr_inthist->get_related_entities_by_bpath( iv_bpath_statement = './BTOrderHeader/BTHeaderCustExt/*' ).
         lr_customer_h_ent ?= lr_customer_h_coll->get_current( ).
         if lr_customer_h_ent isbound.

 

 

lr_core = cl_crm_bol_core=>get_instance( ).

           if lr_core isbound.
             lr_tx = lr_inthist->get_transaction( ).
             lr_core->modify( ).
             if lr_tx->save( ) = abap_true.
               lr_tx->commit( ).
             else.
               lr_tx->rollback( ).
             endif.
           endif.

*          lr_entity->reread( ). "exvneela change on 17-7-2013
           me->typed_context->builinteracthist->collection_wrapper->remove( lr_current ).  "exvneela change on 17-7-2013
           me->typed_context->builinteracthist->collection_wrapper->publish_current( ).

 

endif.

 

Regards,

Neelam


Viewing all articles
Browse latest Browse all 4552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>