cancel
Showing results for 
Search instead for 
Did you mean: 

multiple occurences

Former Member
0 Kudos

hai iam using MATMAS for file to idoc

in this file iam getting multiple storage locations

in the field LGORT.

LGORT field value is like this

aa,bb,cc,.........like that i will get n number of storage locations

i need to split this in to separate and create multiple segments based on storage locations.

how can i do this

my in put is like this

<seg>

<name>xyz</name>

<LGORT>aa,bb,cc</LGORT>

</seg>

required output is :

<<seg>

<name>xyz</name>

<LGORT>aa</LGORT>

<LGORT>bb</LGORT>

<LGORT>cc</LGORT>

</seg>

can any body help me pls

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello,

you have to write a user defined function that separates your source value

in the wanted target values.

http://help.sap.com/saphelp_nw04/helpdata/en/f8/2857cbc374da48993c8eb7d3c8c87a/frameset.htm

Regards

Patrick

Former Member
0 Kudos

Hi,

Export u r MATMAS xsd to u r sys and change the occurance in LGORT as unbounded or 3 and re import this into xi and use this in external definetions while mapping...and map the objects.

If posibel plz award points.

Former Member
0 Kudos

I can suggest one -

You need to create the element <LGORT> as many times in the target as there are values in the source which are separated by a ','.

What you need to do is get the count of 'commas' coming in the input string and create the target node <LGORT> as (No of commas +1). You also need to separate out the string sequences so that they are output to the target nodes as needed.

Probably this could suffice -

public void processStrings(String[] s,ResultList result,Container container){

String[] temp;

int c =0;

for(int i=0;i<s.length;i++)

{

temp = s.split(",");

}

c = temp.length;

for(int i=0;i<c1;i+)

result.addValue(temp<i>);

}

Edited by: Priyanka Balagangadharan on Feb 11, 2008 4:16 PM