Skip to Content
0
Jun 26, 2019 at 01:23 PM

AIF Email alert for CONF21 inbound Idoc

446 Views

Hi

I am trying to create an AIF email alert for CONF21 inbound Idoc , I am using a custom process code , which is a copy of the standard FM 'KK2A_GET_DATA_FROM_IDOC'.

I have made Mail on Every single error in /AIF/IFMON .

I tried calling a Custom FM inside "Assign Actions", But the mails are not triggering.

Please help

***** Custom FM added in Assign Action*****

*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(TESTRUN) TYPE C
*" REFERENCE(SENDING_SYSTEM) TYPE /AIF/AIF_BUSINESS_SYSTEM_KEY
*" OPTIONAL
*" TABLES
*" RETURN_TAB STRUCTURE BAPIRET2
*" CHANGING
*" REFERENCE(DATA)
*" REFERENCE(CURR_LINE)
*" REFERENCE(SUCCESS) TYPE /AIF/SUCCESSFLAG
*" REFERENCE(OLD_MESSAGES) TYPE /AIF/BAL_T_MSG
*"----------------------------------------------------------------------
DATA:ls_return TYPE bapiret2,
lv_message TYPE char100.


DATA:

lt_idoc_contrl TYPE TABLE OF edidc,

ls_idoc_contrl TYPE edidc,

lt_idoc_data TYPE TABLE OF edidd,

lt_idoc_status TYPE TABLE OF bdidocstat,

lt_return_variables TYPE TABLE OF bdwfretvar,

lt_serialization_info TYPE TABLE OF bdi_ser,

lr_ref TYPE REF TO data.
* *****new addition******
DATA :
lt_workflow_result LIKE bdwf_param-result,
lt_application_variable LIKE bdwf_param-appl_var,
lt_in_update_task LIKE bdwfap_par-updatetask,
lt_call_transaction_done LIKE bdwfap_par-calltrans.

GET REFERENCE OF data INTO lr_ref.

*convert the RAW IDOC data to IDOC data again

CALL FUNCTION '/AIF/IDOC_CONVERT_SAP_STRUCT'
EXPORTING
sap_struct = lr_ref
iv_typename = 'ZSCI2146_CONF21'
IMPORTING
es_edidc = ls_idoc_contrl
et_edidd = lt_idoc_data.


APPEND ls_idoc_contrl TO lt_idoc_contrl.
*call the standard function module for your IDOC
CALL FUNCTION 'KK2A_GET_DATA_FROM_IDOC'
EXPORTING
input_method = abap_false
mass_processing = abap_false
IMPORTING
workflow_result = lt_workflow_result
application_variable = lt_application_variable
in_update_task = lt_in_update_task
call_transaction_done = lt_call_transaction_done
TABLES
idoc_contrl = lt_idoc_contrl
idoc_data = lt_idoc_data
idoc_status = lt_idoc_status
return_variables = lt_return_variables
serialization_info = lt_serialization_info.


CALL FUNCTION '/AIF/IDOC_CONVERT_STATREC'
TABLES
return_tab = return_tab
idoc_status = lt_idoc_status.

ENDFUNCTION.