cancel
Showing results for 
Search instead for 
Did you mean: 

AIF Email alert for CONF21 inbound Idoc

nairharsha
Participant
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

nairharsha
Participant
0 Kudos

Hi Britta,

The Idocs' are in error Status 51

I simply followed the steps suggested in

https://blogs.sap.com/2012/10/20/michals-pi-tips-application-interface-framework-aif-idoc-processing...

I am not sure how Action works

The issue got solved once I removed the entry maintained for my namespace and Interface from "Define Interface Determination for IDOC Interfaces"

Looks like Inbound idoc doesn't require entry to be maintained.

Thanks

Harsha

Answers (2)

Answers (2)

brittamangei
Advisor
Advisor
0 Kudos

Hi Harsha,

you only require the Interface Determination if you have more than one AIF interface using the same IDoc basic type. As long as you only have one interface for the basic type you do not require an interface determination.

Best Regards

Britta

nairharsha
Participant
0 Kudos

Thanks a lot

brittamangei
Advisor
Advisor
0 Kudos

Hello,

what is the end status of your IDoc? Do you change the final status in your IDoc manually in the action? Is the status information changed in the action returned to AIF?

Best Regards

Britta