cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue with mapWithDefault

Former Member
0 Kudos

Well i am a liitle confused: i have following mapping for target field:

/MT_NC_ART_edit/ARTRecordSet/ARTDetailsStruct/sAfoBez=replaceString(oneToMany(concat([delimeter=]/ZBC14_ARTIKEL/IDOC/ZBC14_ARTIKEL/ZBC14_ARTIKEL_VORNR/SAFOBEZ=, const([value=:]))), const([value=null]), const([value=]))

Actually i need the case now that when getting no value for sAfoBez there should be a ":" in target field. Therefore i tried with mapWithDefault giving a default-value. But funny thing is XI does not take it!

i tired this:

/MT_NC_ART_edit/ARTRecordSet/ARTDetailsStruct/sAfoBez=replaceString(oneToMany(concat([delimeter=]mapWithDefault([default_value=:]/ZBC14_ARTIKEL/IDOC/ZBC14_ARTIKEL/ZBC14_ARTIKEL_VORNR/SAFOBEZ=), const([value=:]))), const([value=null]), const([value=]))

The UDF inside the mapping is:


String[] store = new String[1];
for(int i=0;i<SAFONR.length;i++)
{
store[0] = store[0]+SAFONR<i>;
}
result.addValue(store[0]);

Can somebody give a hand?!

br

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Fritz,

I couldn't understand your mapping. At what point are you using the 'mapwithdefault' function and whr does the UDF come into picture?

Idealy it should take whatever constant you specify when the desired field is not present. Its a simple mapping.

Can you elaborate it a little it?

Regards,

Akshay

Former Member
0 Kudos

Hi, yes i know how to handle but i could not handle the context change.

Nevermind - it's working now!

thx