on 04-10-2008 11:10 AM
Hi,
My scenario is: "message -> XI -> IDoc", with the idoc TXTRAW.TXTRAW02.
I have a unique source field that I need to cut into several occurences of segment <E1TXTRW> of this IDoc.
My Source:
<text> (which appears only once in my source)
My very long text (1.000 characters)
</text>
My Target: what I want is:
<E1TXTRW> (occurrence is 1..3600)
<TLINE> the 72th first characters of my source</TLINE> (occurrence is 0..1)
<E1TXTRW>
<TLINE>the next 72th characters of my source</TLINE>
(...)
and so on until the last characters...
(..)
<E1TXTRW> (last occurrence)
<TLINE>the last characters of my source</TLINE>
For that, I use a UDF to cut my source into several target lines plus a "UseOneAsAny", but the problem is that the segment <E1TXTRW> is not automatically duplicated !!, I have it only once when I test my mapping.
Uselly with "UseOneAsAny" a XML tag is automatically create. Is there a limitation when target is an IDoc ?
Note: I cannot duplicate manually myself this IDoc segment in the graph mapping (with the right option), because I don't know how many times the segment <E1TXTRW> has to be repeated, coz it depend of the length of my source
Any help, any suggestion are welcome !
Thanks
Mickael
Hi,
What u need to do is:
U need to first check the length of the input string. once u got the length then divide the length by 72. u will get the value that many time s ur target segment will repeate.
for example.
144 lenth of the input string divide by 72 hence u will get 2 now 2 times ur <E1TXTRW> segment repeates. for repeating the node u need to write the UDF.
now how to split the string u can use substring fuction and select the required string.
this will work only whne u have the input string length in the multiples of 72. if the length of input string is 140 then above logic will not work.
chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
also.. can u give us a screenshot of ur mapping
regards
krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Krishna,
1. My mapping is here:
[url] <A HREF='http://uploadmb.com/dw.php?id=1207783570'>MHU - Mapping - Queue.jpg</A>[url]
Note that I do some test, and I'm not that that UseOneASMany is necessary, as the outbound of my UDF is nice.
261 = length of my source text
Madame, Mo = The 1st part of my cut
nsieurVo = The 2nd part of my cut
2. The result:
[url] <A HREF='http://w1.uploadmb.com/dw.php?id=1207867294'>MHU - Mapping - Result.jpg</A>[url]
we see that only the first line with "261" is generated !!
:-(((
Mickael
Hi krishna,
For instance I use the same mapping :
1. at the node level "E1TXTRW", in order to generate this node as many time it's necessary (remind occurs 1..3600). I agree with you that the value (261, Madame...) will not be used for this level, but XI will only use its contexts and queues to kow the occurence.
2. at the field level "TLINE" in order to give my text (remind occurs 0..1)
End normally with the management of Queue and Context the duplication of "E1TXTRW" should be done automatically, should not it ?
But maybe I'm wrong....
Mickael
Hi
+1. at the node level "E1TXTRW", in order to generate this node as many time it's necessary (remind occurs 1..3600). I agree with you that the value (261, Madame...) will not be used for this level, but XI will only use its contexts and queues to kow the occurence.
only for getting the no of occurences you dont have to do that mapping ...simple drag and drop from "target -> source> and raise the context of the source to a level above. and then do a split value...
regards
krishna
Hi Krishna,
I totally agree with you, but I tried to find a solution with UseAsOneMany, because with only the SplitByValue the result is bad : only one segment E1TXTRW.
Note: that the change of source context has no effect, because this source field appear only once : occurs 0..1 for all above levels.
<A HREF='http://w1.uploadmb.com/dw.php?id=1207873498'>MHU - Mapping - Queue simplified.jpg</A>
<A HREF='http://uploadmb.com/dw.php?id=1207790334'>MHU - Mapping - Result simplified.jpg</A>
To be continued
I continue to search...
Mickael
Hi Michael,
Did you get the solution? I ma having the same problem. I want to repeat the segment . SAP Help(http://help.sap.com/saphelp_nw04/helpdata/en/1f/ea0fb12403844bbb6c4cbc8a00cda9/frameset.htm) says that the splitbyvalue will generate number of segments based upon the minOccurs. So if you need four you need to have minOccurs as 4. This is wierd.
Hi Michael,
Did you get the solution? I am having the same problem. I want to repeat the segment . I have four context changes in the resultlist but only first one is getting mapped. SAP Help(http://help.sap.com/saphelp_nw04/helpdata/en/1f/ea0fb12403844bbb6c4cbc8a00cda9/frameset.htm) says that the splitbyvalue will generate number of segments based upon the minOccurs. So if you need four you need to have minOccurs as 4. This is wierd. How are you planning to resolve it?
thanks,
rakesh
I am having a similar problem. I have to create one additional segment than the input and hardcode some values into the field of those segment. any idea how to go about it. I have a segment EIEDKA1 and in the input the occurence is 2. So after mapping my output should have 3 occurences of EIEDKA1. Can someone post the UDF for the same. I am very new to SAP XI and finding it hard to get this cracked.Appreciate your help
Hi,
give the occurences of E1TXTRW to "o...many)
regards
krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.