cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop an XI message if value mapping is not available

Former Member
0 Kudos

Is it possible to throw an error when a value mapping is not available in XI3.0?

In my current mapping the input value is returned if the value mapping is not available in the Value Mapping table.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I had the same issue and opened an OSS for it. The asnwer from SAP was:

<i>The ValueMapping function used to throw an exception in cases when

mapping is not found in early development versions of XI2.0, but then

somebody complained that maybe it's not a reason to abort the mapping

and it was decided to write a log message and continue processing.

Now, customers have again complained that they want to decide themselves if the transformation should

proceed or abort and we're going to make

it exactly as you suggested: give a choice to throw exception or return

some kind default value. This is planned for XI 7.1.</i>

(XI 7.0. will the next release after 3.0 - so it will take quite a while until this is available)

regards,

Peter

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for the replies.

But actually I was looking for a more standard solution.

Apparently this is not available.

I think it is an important design choice for value mappings:

What to do when a value mapping entry is not available?

Stop the process / Go on with the process.

I think this should be a standard choice which the developer should make, without having to write some own (dirty or not) javacode around the value mapping.

Maybe SAP can add a radiobutton to the value mappings in the next XI release with the choice "Stop message" / "Do not stop message" when value is not available in the mapping table??!!

Regards,

Mark

udo_martens
Active Contributor
0 Kudos

Hi Mark,

you can define a default value "error". If you want to have an exception, ask for that (if / compare to constant) and call a self written java function where devide with 0.

Regards,

Udo

Andrzej_Filusz
Contributor
0 Kudos

Hi!!!

I think that divide by 0 is not the best solution.

I would prefer to throw a runtime exception in user-define funtion, for example:

throw new RuntimeException("value not found in value mapping for key :" + source_value);

In this way you would also get a nice description about a problem in the monitor.

Regards,

Andrzej

udo_martens
Active Contributor
0 Kudos

Hi!!!!!!!!!!!!!!!!!!!!

yes, that sounds quite better.

Regards,

Udo

Former Member
0 Kudos

I am comparing result from value mapping.

If it equals source field I am adding ERROR_CODE = 1. I check this code in swith block .

I have one dataType and 2 interfaces For example: BusinessObject and ValidatedBusinessObject

Message was edited by: Sergey A