cancel
Showing results for 
Search instead for 
Did you mean: 

Exception text in error segment of SXMB_MONI

Former Member
0 Kudos

Hi,

Can anyone help me in providing the UDF code to raise exceptions and fail the mapping, placing error message in Error Segment of SXMB_MONI?

I used this one:

throw new RuntimeException("Mapping fail");

But I can see it only in trace:

<Trace level="1" type="T">RuntimeException during appliction Java mapping com/sap/xi/tf/_MM_GetSAPRoles_Request_ Thrown: com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping /ns1:MT_GetSAPRoles_Request; root message: Exception:[com.sap.aii.mapping.api.StreamTransformationException: Mapping fail] in class Amdocs_Authorization_GetSAPRoles.FL_Roles method RaiseException

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi  Iñaki!

I cheked  Michal's blog, but I am looking for a way to do that without ABAP or JAVA mapping.

iaki_vila
Active Contributor
0 Kudos

Hi Dan,

The first point in the blog deals about how throws an exception in a UDF:

1. At first we will use any mapping and in case we'd like to throw an exception we will fill dynamic configuration value

(we can do it from any type of mapping). In my example I do it from Message Mapping User Defined Function.

With that code and with the standard function IFWithoutElse you can configure your logic neccesary in order to throw the UDF with the exception handling when the logic will be right.

Do you want a different kind of monitoring exception that the Michal's blog?, correct me if i'm wrong

Regards.

Former Member
0 Kudos

I tried his UDF, but received error:

Method not found RaiseException(com.sap.aii.mappingtool.tf7.rt.Container)

This is my code:

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey keyHeader1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/ERROR", "ERROR");

conf.put(keyHeader1, a);

return "";

iaki_vila
Active Contributor
0 Kudos

Hi Dan,

I'm sorry, you are right, with only UDF this solution doesnt work.

Regards.