Skip to Content
0

Structural Conversions in SAP PI

Jul 12, 2017 at 12:16 PM

49

avatar image

Hi,

I need quick help on converting source node CONTACT_DETAILS to target

CONTACT_DETAILS.When ever CONTACT_EMAIL element exists in the node with multiple email Id separated by ; then I need to create 3 target CONTACT_DETAILS with same other element values.My udf is not working as expected.

Appreciate for any help in this regard.

Thanks

capture.jpg (171.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Manoj K Jul 12, 2017 at 02:23 PM
2

Pavan ,

Try this UDF: You may need to apply split by value after this as per your requirement.

Exec Type:All value of context
String inp[] = var1[0].split(";"); 
for(int i=0;i<inp.length;i++) 
result.addValue(inp[i]);

Br,

Manoj


split.png (12.3 kB)
Share
10 |10000 characters needed characters left characters exceeded
Pavan kumar Jul 17, 2017 at 12:46 PM
0

Hi Manoj,

Thanks for the reply.I suppose my query was not so clear.Let me explain.I have two CONTACT_DETAILS nodes in the source message in which 1 occurence does not have CONTACT_EMAIL element where as 2nd occurnece is having CONTACT_EMAIL with multiple emails Ids with ; as a delimiter.First CONTACT_DETAILS should be passed AS IS to target since my target strucuture is also AS IS.However 2nd CONTACT_DETAILS has to be repeated 3 times at target side based on CONTACT_EMAIL value with corresponding other field values.My UDF is splitting emails and using USEONEASMANY i can only able to repeat but not obtaining desired output.Hope this explains better to help me out with a solution :)

Cheers

Pavan


capture.jpg (88.3 kB)
Share
10 |10000 characters needed characters left characters exceeded