cancel
Showing results for 
Search instead for 
Did you mean: 

On End Call delete the transaction and navigate to the previous unsaved transaction in IC

Former Member
0 Kudos

Hi Experts,

I am trying to achieve disable the autosave of all the active unsaved interactions in the endcall button.

For that I have a requirement of a popup with YES and CANCEL. When CANCEL is clicked in the PopUp, then the transaction is not saved and another transaction opens up for which again the POPUP can be called for cancelling.

I have created a popup in the CRMCMP_IC_FRAME/HiddenView . On cancel of popup I am reading the current BTOrder entry from GDC and deleting the same. after deleting I am trying to navigate to the last unsaved transaction by OP_DEFAULT_BACK method of the BSP_WD_VIEW_CONTROLLER class.

So if I have one service request open, 1 repair open then I am able to cancel the repair first from the endcall popup and navigates to service request.

Again in the SR endcall popupcan delete the entry and navigates to the default screen.

Now the problem is when I have duplicate transactions(suppose 2 service request) then the second of a type cannot be read from the GDC.

Is there any other way by which I can retrieve all the active transactions.

  TRY.

*     Get GDC

       l_r_gdc ?= cl_crm_ui_data_context_srv=>get_instance( iv_controller = me ).

     CATCH cx_root.

   ENDTRY.

   TRY.

     IF l_r_gdc IS BOUND.

*       Get current interaction

       CALL METHOD l_r_gdc->get_entity

         EXPORTING

           name  = if_iccmp_global_data_cont_con=>gdc_currentirec

         RECEIVING

           value = l_r_gdcirec.

       l_r_gdcirecentity ?= l_r_gdcirec .

       IF l_r_gdcirec IS NOT BOUND.

         CALL METHOD l_r_gdc->get_entity

           EXPORTING

             name  = if_iccmp_global_data_cont_con=>GDC_CURRENTPROBLEM

           RECEIVING

             value = l_r_gdcirec.

         l_r_gdcirecentity ?= l_r_gdcirec .

       ENDIF.

       IF l_r_gdcirec IS NOT BOUND.

         CALL METHOD l_r_gdc->get_entity

           EXPORTING

             name  = if_iccmp_global_data_cont_con=>gdc_currentserviceticket

           RECEIVING

             value = l_r_gdcirec.

         l_r_gdcirecentity ?= l_r_gdcirec .

       ENDIF.

       IF l_r_gdcirec IS NOT BOUND.

         CALL METHOD l_r_gdc->get_entity

           EXPORTING

             name  = if_iccmp_global_data_cont_con=>gdc_currentservicerequest

           RECEIVING

             value = l_r_gdcirec.

         l_r_gdcirecentity ?= l_r_gdcirec .

       ENDIF.

     ENDIF.

   ENDTRY.

IF cl_crm_uiu_bt_tools=>is_order_persistent( l_r_gdcirecentity ) EQ abap_true.

     lv_order_persistent = abap_true.

   ENDIF.

   IF l_r_gdcirecentity->alive( ) EQ abap_true.

     lr_tx = l_r_gdcirecentity->get_transaction( ).

     IF lr_tx IS BOUND.

       lr_tx->revert( iv_suppress_buffer_sync = abap_true ).

     ENDIF.

   ENDIF.

   IF lv_order_persistent EQ abap_false.

     op_default_back( ).

   ENDIF.

Accepted Solutions (0)

Answers (1)

Answers (1)

Sigrid
Product and Topic Expert
Product and Topic Expert
0 Kudos

HI;

it might be less complex to use ORDER_SAVE BADI for that purpose, if it is your IC role and if the transaction has not be saved on the database then do not save and tell user what to save.

Agent can then use activity clipboard feature in the navbar for navigation (Tracking Customer Interactions, a New Feature and  “End is your friend”")

Best Regards,

Sigrid