cancel
Showing results for 
Search instead for 
Did you mean: 

idoc to cXMLmapping..user defined function help

Former Member
0 Kudos

hello Everybody,

I am new to XI and I am working on a new mapping. In a nutshell, the requirement is to concat the TDLine of segment E1EDPT2 and map the data to comments of the cXML. The segment E1EDPT2 is segment in E1EDP01( Purchase Order line item segment) This the data that is coming from the vendor text of the SRM system. This needs to repeat for each line item in the Purchase Order. I have created a user defined function which concats the TD lines but I am not able to differenciate the tD line for other line items. Please help. I would appreciate it if anyone could share the User Defined function which suits my needs.

Thanks!

<E1EDP01> (PO lIne Item 1)

<E1EDPT1 SEGMENT="1">

<TDID>F01</TDID>

<TSSPRAS>E</TSSPRAS>

<TSSPRAS_ISO>EN</TSSPRAS_ISO>

<E1EDPT2 SEGMENT="1">

<TDLINE>XI mapping test - Newline1</TDLINE>

<TDFORMAT>*</TDFORMAT>

</E1EDPT2>

<E1EDPT2 SEGMENT="1">

<TDLINE>Line1- text2 end</TDLINE>

<TDFORMAT>*</TDFORMAT>

</E1EDPT2>

<E1EDPT2 SEGMENT="1">

<TDLINE>Line1 - text3</TDLINE>

<TDFORMAT>*</TDFORMAT>

</E1EDPT2>

</E1EDPT1>

</E1EDP01>

<E1EDP01> ( PO lien item 2)

<E1EDPT1 SEGMENT="1">

<TDID>F01</TDID>

<TSSPRAS>E</TSSPRAS>

<TSSPRAS_ISO>EN</TSSPRAS_ISO>

<E1EDPT2 SEGMENT="1">

<TDLINE>XI mapping test - line2</TDLINE>

<TDFORMAT>*</TDFORMAT>

</E1EDPT2>

</E1EDPT1>

</E1EDP01>

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Shilpa,

Create a <b>"Queue"</b> UDF and name it as <b>addvalue</b>. Take one paramater <b>a</b> and put this code:

String value = "";

for(int j=0; j<a.length - 1; j++){

value += a[j] + "";

}

value += a[a.length - 1];

result.addValue(value);

Then map like this:

Source>addvalue>Result (Here for source put the context of the queue to the root node.) Then you should get your desired result.

Regards.

---Satish

Former Member
0 Kudos

Hi

can you please provide some more clarification in detail onyour requirement

Thanks

Rinku