Skip to Content
avatar image
Former Member

Graphical Mapping : Repeat Idoc nodes automatically

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Apr 10, 2008 at 10:13 AM

    Hi,

    give the occurences of E1TXTRW to "o...many)

    regards

    krishna

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi Krishna,

      in standard, occurrence is already 1..3600. so for me it's enough. I'm not sure that to change to "MaxOccurs=Unbounded" will be a solution.

      Have you already done that ?

      Mickael

      Edited by: Mickael Huchet on Apr 10, 2008 10:22 AM

  • avatar image
    Former Member
    Apr 10, 2008 at 10:14 AM

    also.. can u give us a screenshot of ur mapping

    regards

    krishna

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • avatar image
    Former Member
    Apr 10, 2008 at 10:17 AM

    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

    Add comment
    10|10000 characters needed characters exceeded