cancel
Showing results for 
Search instead for 
Did you mean: 

FixValues - if value not in mapping table - fail mapping

Former Member
0 Kudos

I am running PI7.0 - sp10.

I have been given a requirement at the eleventh hour to fail the mapping in an interface if a Fix Value mapping is not found during IDOC mapping from sending to receving system. Two SAP systems with totally different versions/configuration.

I can understand the Clients requirement (just not the timing as we are suppsoed to be signing off integration testing this week!) as otherwise, a blank value is created.

Some of these Fix value mapping tables have over 140 mappings. I can pass a default value, or a blank value, but the client doesn't want that.

I have looked at an IF /exists, but this will not fail the maping.

Is this possible or do I have to write some special?

The client wants to work on prevention rather than cure!

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

you can use this blog to create an exception from your mapping:

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

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Thanks Michal.

I found an OSS Note that has fixed the problem, but I want this error!

https://service.sap.com/sap/support/notes/652882

I will work through the Blog!

MichalKrawczyk
Active Contributor
0 Kudos

one more thing:

you can check value mapping table like this:

/people/sukumar.natarajan/blog/2006/10/23/accessing-value-mapping-defined-in-directory-using-java-functions

and call the exception from my previous response in from it

in case it will not find any entries

this way you will have all in one UDF

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Thanks.

I guess this is going to be a huge piece of work then as I have mapping on 40fields and fixvalues (100 values) are different in each. Potentially I have to create this for every fixvalue mapping?

Who wants a social life, anyway!

I don't suppose there is a UDF I can create to put in between fixvalue mapping and target field to say if blank - fail! That'd be too easy!

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>I don't suppose there is a UDF I can create to put in between fixvalue mapping and target field to say if blank - fail! That'd be too easy!

I guess you can create it as one UDF and reuse it:)

logic:

if source value and target is the same then exception

(remember to apply the note that you mentioned )

Regards,

michal

manish_bhalla2
Contributor
0 Kudos

Hi Barry,

<i>I don't suppose there is a UDF I can create to put in between fixvalue mapping and target field to say if blank - fail!</i>

That should be possible by using a custom Exception UDF. Refer this weblog...

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

Regards

Manish

Former Member
0 Kudos

Thanks Manish!

Hopefully this won't affect my performance review.....

Just waiting for the jar files to be deployed!

manish_bhalla2
Contributor
0 Kudos

grin

Just ensure that you have documented this and added it to the Tech Spec for the interface... so that there is a record of all this from a support perspective after go-live.

Cheers

Manish

Former Member
0 Kudos

This has been successfully tested.

Of the three options available, I went for /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping option.

Points awarded accordingly.

Thanks to everyone for their input.

bhavesh_kantilal
Active Contributor
0 Kudos

Barry,

Can you also update on how you decide if the value if not available in the Fix mapping before you throw the Exception?

Regards

Bhavesh

Former Member
0 Kudos

Bhavesh

I have Sending Field > FixValues > UDF > Target Field

In the UDF I have:

imports com.guarneri.xi.mapping.udf.*;

public void ThrowException(String[] theValue,String[] theMessage,ResultList result,Container container){

 if ((theValue[0].trim().length()==0))         // empty string passed
  ExceptionThrower.fire(theMessage[0]);
else result.addValue(theValue[0]);
}

This accepts a 0 value but not a blank value.

bhavesh_kantilal
Active Contributor
0 Kudos

Hey Barry,

Thanks for that update. I thought it was something of this sort that would make sense and you just proved that.

Regards

Bhavesh

Answers (0)