cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Fixed value mapping

0 Kudos

Dear Experts,

I am stuck in a mapping situation as explained below and need  your help for resolution.

Mapping in contention  is as shown below :

As per this mapping the Substring should throw 3 character word and  in fix value mapping it is getting displayed correctly. The fix value mapping is as shown below:

queue result of Substring function in mapping :

Queue Result for Fix Value mapping :

Till this point every thing looks fine but when I clicked on the Queue of the Target field it throws out the error as:

Here it clearly shows that output of the key in fix value mapping is null, which contradicts the result of  fix value mapping queue.

Please let me know if any one else has faced this  issue before  or if you have any idea for the resolution of this issue.

Thanks and Regards,

Sudhir Kumar

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

You can easilyu find the issue, PR_ not maintained in the Fix value list hence it is thowring an error.

this kind os situation you have 3 options

1)Throwing an exception

2)sending default value.

3)Maintain key and value  for PR_

decision is up to you.

Regards,

Raj

0 Kudos

Dear Experts,

Sorry, I had given only the part of the Fixed value mapping screen shot.

I have attched the complete screenshot now. Please check, It satisfies all the conditions as yu mentioned in your replies :

zameerf
Contributor
0 Kudos

This looks strange.

Did you try implementing the same logic in another message mapping?

Also, how does FixValues function in existing mapping behaves?

Just to confirm if this is a temporary issue.

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Sudhir,

Change your mapping logic like below..

1)Add XXX at last in Fix value list  and you no need any defualt value also bevause map with defualt will take care about it.

insted of first name give your input..field.. it works

Regards,

Raj

0 Kudos

Hi Raja,

Thanks for your help. I tried out this logic but surprisingly  the queue result for Map by default is as shown below :

and consequently it is throwing error in substring fuction as 

"

Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 3] in class com.sap.aii.mappingtool.flib7.TextFunctions method substring[, 0, 3, com.sap.aii.mappingtool.tf7.rt.Context@5368bf52]"

Best Regards,

Sudhir

rajasekhar_reddy14
Active Contributor
0 Kudos

Really strange,

change map with defualt value to XXXXXX and try.same logic working in my system ,

0 Kudos

I tried out with following mapping :

This is working fine, But I still didn't understood the reason behind the errors in Previous two logics. Can any body explain it ?

Regards,

Sudhir Kumar

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>TextFunctions method substring[, 0, 3,

Have you specified start position 0 and character count 3 in substring function?  I see something extra comma in the beginning of your error message.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

in your previous mapping logic you did not take care sending XXX as default value to provide as input to substring function in case of no value available. The function mapwithdefault takes care that part. That's the one difference I see it.

0 Kudos

No Baskar, That is fine ! Please check for the  queue result of Substring function in main post.

Regards,

Sudhir Kumar

0 Kudos

As per the logic in the main post, if else condition just before the substring function was alraedy taking care of it. Nonethless the mapping has failed even for the actual key like PR_.

rajasekhar_reddy14
Active Contributor
0 Kudos

Finally map with defualt trick worked.

It looks the culprit is if then else function, try using if then else boolean function and see the results.

0 Kudos

Yes exactly map with default did worked !  I tried out with if then else boolean fuction also, though the result is indiffrent. It is working only  with the combination of both map with default and if else.

Answers (3)

Answers (3)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Just Few cents...  This is mere data discrepancy issue. I would recommend to sync/update the fix value  records always.  This problem could populate always with different values that comes from sender side... You might get a different string in the future like this. Go with atleast default value to take care this issue.

former_member184681
Active Contributor
0 Kudos

Hi,

When you check the Fix Values settings, what is your setting for Behaviour if Lookup Fails? If you are using Throw Exception, try changing it to one of the other options and see what happens.

Regards,

Greg

santosh_k3
Active Participant
0 Kudos

Hi Sudhir,

Hope i have understand the requirement correctly/

As shown above in the screen shots of Fixed value mapping

there are only three keys

1) SA_

2) FA_

3) IT_

but the output of the sub string function resulting PR_

which is not present in the Fixed value mapping as a key

try to maintain the key value pair in fixed value mapping for

key = PR_

value = Procurement

so when ever the sub string results the output as PR_ then Procurement will be passed to the Target element.

Thanks

Sai