cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Fail

Former Member
0 Kudos

Hi All

I have to do a validation inside my mapping and if the validation fails I have to fail the mapping and throw an error.

How can I fail a mpping in SAP PI (7.1)

Thnaks

Sourabh

Accepted Solutions (1)

Accepted Solutions (1)

sbuttler77
Active Participant
0 Kudos

You can throw an exception in your mapping, that will fail the message

throw new RuntimeException("Reason");

Answers (4)

Answers (4)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi,

take a look to this blog, but dont pay attension to abap code just mmaping part

/people/ravi.gupta4/blog/2010/02/04/automating-cancellation-of-a-failed-message-in-xi

former_member187587
Contributor
0 Kudos

If the validation is "Rule based" then your should handle the failure inside PI Mapping as part of the mapping rules in XI. (UDF is an option). for example if a value in the source XML message is not equal to X then raise exception and fail mapping.

If this is a structure change then the practice is to perform structure validation in the adapter itself (XML validation,Fie adapter sender validation,ItemField,Etc. the Serviceinterfacestructure will assist you in the process (Can try and use Enumeration inside the DT itself)

Former Member
0 Kudos

Hi,

Plz have a look:

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

Thanks

Amit

samiullah_qureshi
Active Contributor
0 Kudos

U can do ur validation inside mapping UDF. If validation fails then u can raise an exception through ur java code and this exception will subsequently fail the mapping.