cancel
Showing results for 
Search instead for 
Did you mean: 

Capture Mapping Errors

Former Member
0 Kudos

Hi all,

I am working on a scenario where I have 2 mappings within the operational mapping. When mapping 1 fails I need to capture the mapping error from mapping 1 and based on that error, update some table information on the ABAP stack.

During testing I noticed when mapping 1 fails, the second mapping is not executed and now I am wondering if this is possible at all? Does someone has any good idea's?

Hope someone can help.

Best regards,

Guido Koopmann

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

if you catch the error from the first mapping you can pass it to the next one in dynamic config for example

as shown in my blog :

but if you cannot catch it then you need to work with java mapping to be able to catch the error first

Regards,

Michal Krawczyk

Former Member
0 Kudos

Hi Michal,

I have tried to implement your blog, because it's definetly something which I need. But now I always get mapping error. What did I do wrong?

The ABAP class is created and in the EXECUTE method, I have implemented the logic.

Best regards,

Guido Koopmann

Former Member
0 Kudos

Hi,

If you are working with message mapping and the exception is not thrown on purpose by you then you can not catch it. This means that you can not use Michal's blog.

What Michal suggests, and I think he is right, is that in this case you should write your own Java mapping with the same logic which on top throws the exception you want. And then Michal's blog would become helpful again.

Regards,

Horia

Former Member
0 Kudos

HI,

Based on Michal blog, I tweaked it a bit. What I do now is that I pass the message ID to ABAP class. In the ABAP class I do a look up on sxmspmast. Based on that, I can determine on the status, if the message is in error or not!

So it's possible to determine when it's in error. I will test it and if all ok I will blog about this

Thanks for the help.

Best regards,

Guido Koopmann

Former Member
0 Kudos

>>Based on Michal blog, I tweaked it a bit. What I do now is that I pass the message ID to ABAP class. In the ABAP class I do a look up on sxmspmast. Based on that, I can determine on the status, if the message is in error or not!

Sorry. But both the steps you are trying to achieve are logically incorrect. Msg id u can get it directly from the transformation input header parameter.

If your msg is in error the mapping itself will never be triggered assuming the error occurs before your mast lookup.

Safe and effective way to achieve this is by a java mapping with try catch block.

Jai