cancel
Showing results for 
Search instead for 
Did you mean: 

file to idoc user defined function

Former Member
0 Kudos

Dear All,

i have a file to idoc scenario where my input file has the structure

<p1>

material

value1

value2

value3

</p1>

and the target idoc has structure

<E2>

material

<E3>

VALUE

<\E3>

<E2>

i am mapping p1 to E2. and i want for all the value field E3 segment should repeat itself

so i want the result like

<E2>

MATERIAL

<E3>

VALUE1

<\E3>

<E3>

VALUE2

<\E3>

<E3>

VALUE3

<\E3>

<\E2>

is this possible using a user defined fucntion. How can i acheive this target structure with desired values.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey

this can be done through a user defined function

first for every occurance of value,E3 has to occur

So write a userdefined function with a,b and c as arguments with respect to the values value1,value2 and value3 and select the context in the function

write the code as

if(!a[0].equals(null))

{

result.addValue(a[0]);

}

if(!b[0].equals(null))

{

result.addValue(b[0]);

}

if(!c[0].equals(null))

{

result.addValue(c[0]);

}

and map the output from the userdefined function to E3.

similarly for every E3 u need the VAlUE to occur,So repeat the same user defined function with the same inputs and map the output of the user defined function to node function <b>split by value</b> and then map it to the ouptu VALUE.

regards

jithesh

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can do this using

Have a look at this pdf for eg

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/be05e290-0201-0010-e997-b6e...

slide 28

Regards

Vijaya

Former Member
0 Kudos

Hi Sorabh,

Do you really want to use a udf? You can achieve this with the help of node functions. Use the node function "remove context' to achieve this.

Regards,

Sushumna