cancel
Showing results for 
Search instead for 
Did you mean: 

Errors in Mapping

Former Member
0 Kudos

Hi Friends,

I have a File to File Scenario. In source side i have a field EmpCode. It should be only numeric. After the execution if the EmpCode value given is not numeric means i should get any notification or error message. Like this for all fields it should be done under different constraints.

So could any one please tell how to notify the error at target after execution . Waiting for your valuable responses.

Note: NIce reward points will be awarded.

Accepted Solutions (1)

Accepted Solutions (1)

GabrielSagaya
Active Contributor
0 Kudos

function myudf(String a,Container container)

{

int i=0;

try

{

i=Integer.parseInt(a);

catch(NumberFormatException e)

{

throw new NumberFormatException("Not a Number");

}

return i;

}

You can write the UDF which throws NumberFormatException that triggers the Alert message in your alert inbox.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Use the Java mapping program and validate and send the mail using Java code.

This customization will be simple using Java.

Java mapping:

http://help.sap.com/saphelp_nw04s/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm

Thanks,

Jogula Ramesh

Former Member
0 Kudos

Hi,

For these kind of activity you could raise the Smart Exceptions in XI

refer

/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

/people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping

Thanks

Swarup

Former Member
0 Kudos

Hi,

If at all there are any deviations than you need to throw an exception and stop the message mapping stating that this particular constraint is not satisfied right?Correct me if im wrong.

Than u can follow the below approach using a udf to throw exception:

/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

In your case please check for the constraints in the if condition given in the udf.You we will able to achieve your scenario than.

Thanks,

Bhargav.

Note:Award points if found useful

Former Member
0 Kudos

Hi,

I would suggest to use java mapping. Use this to validate your XML.

Use the next Mapping can be Graphical also to do to the rest of the mapping.

use them in sequence in the interface mapping.

Are you on PI 7.1, in this case a tool for automatic Schema validation is available along with the receiver agreement.

Hope this helps,

Reward points if useful

Regards,

Abhishek