BDEx can be tightly integrated with the standard EMMACL and EMMACLS BPEM inboxes with very little effort required, allowing BDEx to be called directly from a BPEM case in the worklist. To enable this functionality, perform the following:
Implement the BAdI BADI_EMMA_CASE in enhancement spot EMMA_CASE.
This BAdI is called when a user views or changes a BPEM case from EMMACL and EMMACLS, and can be used to launch BDEx instead. It includes a check to a flag held in memory, so that BDEx is only called under circumstances defined in the next section.
The following code should be used to implement the BAdI logic:
class zbdex_cl_emma_case definition
public
final
create public .
public section.
interfaces if_badi_emma_case .
interfaces if_badi_interface .
constants co_bdex_mem_id type char20 value '/BTI/MDE_CASELIST' ##NO_TEXT.
protected section.
private section.
ENDCLASS.
CLASS ZBDEX_CL_EMMA_CASE IMPLEMENTATION.
* <SIGNATURE>---------------------------------------------------------------------------+
* | Static Public Method ZBDEX_CL_EMMA_CASE=>IF_BADI_EMMA_CASE~TRANSACTION_START
* +-----------------------------------------------------------------------------------------+
* | [--->] IV_CASENR TYPE EMMA_CNR(optional)
* | [--->] IV_CCAT TYPE EMMA_CCAT(optional)
* | [--->] IV_TEMPLATE_CASE TYPE EMMA_CNR(optional)
* | [--->] IV_WMODE TYPE EMMA_CTXN_WMODE
* | [--->] IV_ALLOW_TOGGLE_DISPCHAN TYPE FLAG (default =' ')
* | [--->] IV_NEXT_PREV_CASE TYPE NUM1 (default ='0')
* | [<---] EV_CASENR TYPE EMMA_CNR
* | [<---] EV_OKCODE TYPE SYUCOMM
* | [EXC!] CASE_NOT_FOUND
* | [EXC!] INCORRECT_WORKMODE
* | [EXC!] INCORRECT_PARAMETERS
* +--------------------------------------------------------------------------------</SIGNATURE>
method if_badi_emma_case~transaction_start.
data:
lv_bdex type flag,
lv_called type flag,
lo_bpem type ref to /bti/mde_cl_wr_isu_bpem,
lo_md type ref to /bti/mde_cl_md_object_base,
lo_action type ref to /bti/mde_cl_action.
* Check whether this call is from an emma caselist hotspot click
import lv_bdex = lv_bdex from memory id co_bdex_mem_id.
if lv_bdex is not initial.
free memory id co_bdex_mem_id.
call method /bti/mde_cl_wr_isu_bpem=>get_object
exporting
x_key = iv_casenr
x_ignore_existence_check = space
receiving
r_object = lo_bpem
exceptions
ex_object_not_found = 1
others = 2.
if sy-subrc <> 0.
raise case_not_found.
endif.
lo_md = lo_bpem->get_primary_md_object( ).
if lo_md is not initial.
call method /bti/mde_cl_action=>factory
exporting
actionid = /bti/mde_cl_application_main=>pc_actionid_bdex_wr
processor = lo_bpem
receiving
action = lo_action.
if lo_action is not initial.
lo_action->execute( exporting x_no_log = 'X' ).
lv_called = 'X'.
endif.
endif.
endif.
* If BDEx wasn't called successfully; either becase the flag wasn't set, or
* it was set, but BDEx couldn't determine the customer, just call the regular transaction.
if lv_called is initial.
call function 'EMMA_CASE_TRANSACTION_START'
exporting
iv_casenr = iv_casenr
iv_ccat = iv_ccat
iv_template_case = iv_template_case
iv_wmode = iv_wmode
iv_allow_toggle_dispchan = iv_allow_toggle_dispchan
iv_next_prev_case = iv_next_prev_case
importing
ev_casenr = ev_casenr
ev_okcode = ev_okcode
exceptions
case_not_found = 1
incorrect_workmode = 2
incorrect_parameters = 3.
case sy-subrc.
when 1. raise case_not_found.
when 2. raise incorrect_workmode.
when 3. raise incorrect_parameters.
endcase.
endif.
endmethod.
ENDCLASS.
Note that if BDEx is not called successfully using this method, it will fall back gracefully to the standard BPEM case transaction.
Enhance program REMMACASELIST
Add a code enhancement at the start of form ALV_USER_COMMAND (found around line 386), setting the BDEx memory flag if the action was a hotspot or double-click and add the following code:
if iv_ucomm eq '&IC1'.
* Export flag to indicate hotspot click or double-click.
* This can then be checked in the BPEM transaction BAdI, in order to call BDEx if necessary
export lv_bdex = abap_true to memory id zbdex_cl_emma_case=>co_bdex_mem_id.
endif.
The enhanced form will look like this:
*&---------------------------------------------------------------------*
*& Form alv_user_command
*& DRILL DOWN WORK
*----------------------------------------------------------------------*
FORM alv_user_command USING iv_ucomm LIKE sy-ucomm
cs_selfield TYPE slis_selfield. "#EC CALLED
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
*$*$-Start: (1)----------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZBDEX_ENH_EMMACASELIST. "active version
if iv_ucomm eq '&IC1'.
* Export flag to indicate hotspot click or double-click.
* This can then be checked in the BPEM transaction BAdI, in order to call BDEx if necessary
export lv_bdex = abap_true to memory id zbdex_cl_emma_case=>co_bdex_mem_id.
endif.
ENDENHANCEMENT.
*$*$-End: (1)----------------------------------------------------------------------------$*$*
DATA: lt_rows TYPE lvc_t_row,
...
Enhance program REMMACASELIST_SHL
Add a code enhancement at the start of method HANDLE_HOTSPOT of class LC_CLALV_EVENT_RECEIVER (found near line 163) with the following logic:
if e_column_id eq 'CASENR'. "#EC NO_TEXT
* Export flag to indicate hotspot click or double-click.
* This can then be checked in the BPEM transaction BAdI, in order to call BDEx if necessary
export lv_bdex = abap_true to memory id zbdex_cl_emma_case=>co_bdex_mem_id.
endif.
The enhanced method will look like this:
CLASS lc_clalv_event_receiver IMPLEMENTATION.
METHOD handle_hotspot.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
*$*$-Start: (1)-------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZBDEX_ENH_EMMACLS. "active version
if e_column_id eq 'CASENR'. "#EC NO_TEXT
* Export flag to indicate hotspot click or double-click.
* This can then be checked in the BPEM transaction BAdI, in order to call BDEx if necessary
export lv_bdex = abap_true to memory id zbdex_cl_emma_case=>co_bdex_mem_id.
endif.
ENDENHANCEMENT.
*$*$-End: (1)-------------------------------------------------------------------------$*$*
DATA: ls_outtab LIKE LINE OF gt_outtab.
...
Add a code enhancement at the start of method HANDLE_DOUBLE_CLICK of class LC_CLALV_EVENT_RECEIVER (found near line 263) with the following logic:
* Export flag to indicate hotspot click or double-click.
* This can then be checked in the BPEM transaction BAdI, in order to call BDEx if necessary
export lv_bdex = abap_true to memory id zbdex_cl_emma_case=>co_bdex_mem_id.
The enhanced method should look like this:
*&---------------------------------------------------------------------*
*& Class lc_dcalv_event_receiver implementation
*& Handles double click on case list alv grid
*&---------------------------------------------------------------------*
CLASS lc_dcalv_event_receiver IMPLEMENTATION.
METHOD handle_double_click.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
*$*$-Start: (2)-------------------------------------------------------------------------$*$*
ENHANCEMENT 2 ZBDEX_ENH_EMMACLS. "active version
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" A
* Export flag to indicate hotspot click or double-click.
* This can then be checked in the BPEM transaction BAdI, in order to call BDEx if necessary
export lv_bdex = abap_true to memory id zbdex_cl_emma_case=>co_bdex_mem_id.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ENDENHANCEMENT.
*$*$-End: (2)-------------------------------------------------------------------------$*$*
DATA: ls_outtab LIKE LINE OF gt_outtab.
With these enhancements in place, clicking a hotspot or double-clicking a line item in EMMACL and EMMACLS will attempt to call BDEx directly.
Post your comment on this topic.