cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping doubt

Former Member
0 Kudos

hi all,

I have a small doubt in mapping which i have shown below

<i>then</i>----->ZOILID

item--><i>exists</i>--><i>if </i> -


>ZOILID

<i>else</i>(5constants)

item is the node which has ZOILID as a subnode.If item exists then ZOILID will have a value which we enter(as shown in mapping).But if item does not exist i need to have 5constant values assigned to ZOILID....which i dont have any idea how to proceed with.

We can give one constant using the constant function but how to assign 5constant values.Do i need to write a UDF....as i dnt know java coding

Help will be greatly appreciated

thanks,

Nisheeta

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nisheeta,

you could use 5 constants from ther constant functions and concat them. But with 5 constants you should use a UDF. Here a simple example.


String concatString = new String() ;
concatString = val1+ " " + val2+ " " +val3+ " " +val4+ " " +val5;
return concatString;

Hope this helps you.

Dominic

Answers (3)

Answers (3)

STALANKI
Active Contributor
0 Kudos

Also Nisheeta read the article which enhances your mapping skills.

/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

Former Member
0 Kudos

Hi,

Is it that you need to create 5 different ZOILID nodes or assign all 5 values to one ZOILID node?

If you need to assign all 5 to one node: Simple. You can assign more that one value in the constant function that is available in the mapping editor.

If you need to create 5 different ZOILID nodes: You would need to write a UDF that will create these nodes.

This link will help you with the udf:

<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/b1/83a09f668320419dbe00a741e0fe6a/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/b1/83a09f668320419dbe00a741e0fe6a/frameset.htm</a>

Regards,

Smitha.

Former Member
0 Kudos

hi smita,

i want to assign all 5 constant values to one node....but i believe with constant standard function you can assign only one value at a time,and can we use it in an if-then-else function....if i am wrong plz let me know

thanks

Nisheeta

Former Member
0 Kudos

nisheeta,

if you want to assign all nodes to the same field on target side, may be u should use concat function to concat them before assigning to target field.

--Archana

Former Member
0 Kudos

archana,

concat will give all the values in a single line....i want the constant values to come in a newline

Former Member
0 Kudos

Hi,

<i>believe with constant standard function you can assign only one value at a time,</i>

Since you want all 5 values in one single node, all you need to do is to enter the values in the constant function with space as a delimiter.

Yes you can use it in the if-then-else function.

Regards,

Smitha.

Former Member
0 Kudos

smita,

with delimiter as space i will get the response as

ZOILID 23 34 45 56

but i require the output as

ZOILID 23

34

45

i have to give EP this as response so that it sees them in a newline....i cannot the concat function either

can u suggest anything

thanks

Nisheeta

Former Member
0 Kudos

Hi,

Suggest you to write a userdefined function, which adds a newline.

String value = "value1""\n""value2"+ "\n""value3""\n""value4""\n"+"value5";

return value;

Regards,

Smitha.

Former Member
0 Kudos

Hi,

U can easily achieve this by graphical mapping, as

1) first check whether that field exists or not (If without else function)

2) if exists then (If function) check, whether that filed is null value

3)if it is null, in the then part take 5 constant functions and three concate functions, delimeter ','

That's it, u can achieve this, i jst tested and its working. I am jst fowardign the screen shot to ur mail id. If you want plz try this.

regards

Former Member
0 Kudos

hi,

plz send ur email id, so that i can forward the screen shot.

regards

Former Member
0 Kudos

hi vijaya,

thanks a lot for the response.Can you please send the screenshot to nisheetanaidu@gmail.com.

i will work out and let you know

thanks again,

Nisheeta

Former Member
0 Kudos

Hi,

Plz check ur mail box.

regards

Former Member
0 Kudos

hi vijaya,

Can u plz send it to nisheeta_naidu@satyam.com.I am not able to aceess gmail.Sorry for the inconvenience.

regards,

Nisheeta

Former Member
0 Kudos

Hi,

Done, plz check

regards