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.