cancel
Showing results for 
Search instead for 
Did you mean: 

AIF inbound scenarion exception: CX_AI_APPLICATION_FAULT while passing 'N' to success

Former Member
0 Kudos

Hello,

This is an inbound interface scenario.

I have a function module defined for an AIF action. This function module is based on the template /AIF/FILE_TEMPL_PROCESS

The function module has a changing parameter "Success" of type /AIF/SUCCESSFLAG

If everything is OK I pass a "Y" to this parameter.

If not, I pass an "N"

The issue that I face when I pass an "N" is:

1. If I run this interface via SPROXY, the error raised in the /aif/err transaction is an "application error" (which is good)

but if I run this via placing the CSV in PI the error raised in the /aif/err transaction is an "system error".

It should always be an application error

2. No matter where I run it from (sproxy or pi), the response message seen in sxmb_moni is an exception (shown below). I guess it should not be an exception. I am passing "N" to success so that it is flagged as an error in AIF

<SAP:Stack>Error during proxy processing An exception with the type CX_AI_APPLICATION_FAULT occurred, but was neither handled locally, nor declared in a RAISING clause Application Error An exception with the type CX_SY_CREATE_DATA_ERROR occurred, but was neither handled locally, nor declared in a RAISING clause The data object could not be created: The type does not exist.</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

Thanks !

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Prem,

how do you call AIF in your proxy class? Do you call /AIF/CL_ENABLER_PROXY=>PROCESS_MESSAGE? There is a parameter for the exception class. Did you check if you pass the correct exception class name? You have to pass the name of the exception that the proxy raises. Maybe there is a typo or something.

Best regards,

Verena

Former Member
0 Kudos

Hi Verena,

Thanks for the reply. I was missing the exception class. I then passed the exception class CX_AI_APPLICATION_FAULT only to face the same issue again. I debugged my way through. I found that the cancel exception is raised here:

Is it anything to do with alerts ?

Best regards,

Prem

Former Member
0 Kudos

Hi Prem,

that CANCEL is raised here is fine. But I think that you pass CX_AI_APPLICATION_FAULT is not correct. The proxy method should raise an exception. You have to pass this exception classname to AIF like in the example below:

Best regards,

Verena

Former Member
0 Kudos

Thanks Verena. That solved the problem.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Prem,

when did you defined in your proxy method the code for the method /aif/cl_enabler_proxy, before or after you defined your interface in aif/cust?

Best regards,

Ionut

Former Member
0 Kudos

Hi Ionut,

Does this sequence matter ? Did you face any issues with the sequence ?

Former Member
0 Kudos

Hi Prem,

I try to use always messages in RETURN_TAB to control success or failed.

Perhaps this information could help you and use the SUCCESS flag only for an overwrite.

had you have the chance to look in to Verena Wörner's document "Template Function Modules of the SAP Application Interface Framework". For the FM /AIF/FILE_TEMPL_PROCESS she gave following extra hint:

"Note that you should not raise an error. Instead, you should fill return table RETURN_TAB with your messages. If there is a message of type E or A in the return table, the SAP Application Interface Framework implies that the function call was not successful. However, you may overwrite this behavior. You can set the SUCCESS indicator to “Y” explicitly to indicate success even though the RETURN_TAB contains error messages. You can set the SUCCESS indicator to N explicitly to indicate failure even though RETURN_TAB does not contain error messages."

Perhaps this information could help you.

Kind regards

Christoph

Former Member
0 Kudos

Hi Christoph,

Thanks for replying. Yes, a few minutes after I posted my question I happened to read the article you mentioned . I stopped explicity setting the success flag and let the AIF framework read my RETURN_TAB for 'E' or 'A' messages. It still throws an exception though.

Best regards,

Prem