Skip to Content
avatar image
Former Member

file to idoc scenario (split message)

hello everybody

i have a file (xml) -> XI -> Idoc scenario

sometimes idoc message is so much big and i have problem to process it.

so i would like split message in more idoc but i need decide a cut-point

example in file i have 200 row and i don't want create 200 idocs but example 4.

So i need cut file every 50 rows.

It's possible?

thanks

Alex

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Jun 25, 2009 at 10:52 AM

    Hi Alex,

    use parameter "Recordsets per Message" to split the message in the sender adapter.

    [Converting File Content in a Sender Adapter|http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm]

    Regards,

    Udo

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Udo,

      i cannot use parameter "Recordsets per Message" because i'm not reading flat file.

      I'm using XML file.

  • avatar image
    Former Member
    Jun 25, 2009 at 11:17 AM

    Hi,

    I guess u can use any of the field from xml file to create multiple IDOC.

    Say employess details are there with company name.

    then u can generate multiple IDocs depends on company name.

    but in this case u won't be able to cut file in equal size.

    this is just one suggestion.

    Regards,

    Manisha

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 25, 2009 at 11:18 AM

    Hi,

    I think the problem is due to IDOC segment occurrence. Better to increase segment occurrence, the problem will be sort out easily. In standard PI i think we don't have option to cut file.

    Find below mentioned link help you.

    /people/alessandro.guarneri/blog/2007/02/21/sap-xi-acting-as-a-huge-file-mover

    /people/alessandro.guarneri/blog/2006/03/05/managing-bulky-flat-messages-with-sap-xi-tunneling-once-again--updated

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Alessandro,

      You can use the statistic functions viz., count and index to cut the file after a number of rows. The index can you give a specified record occurence. You can fix this occurence and cut the file to create another idoc.

      Regards,

      Akshay

  • avatar image
    Former Member
    Jun 26, 2009 at 11:41 AM

    Hi,

    Write a UDF, which will use source as Row field value and target as Idoc.

    The below mentioned code can be used to split up the file with 200 row into 4 Idocs. But with this logic, you need to check the child node mapping, if they are getting affected or not.

    // split the value if more than 50 segments are found.

    int i,j;

    for(i= 1;i<=(a.length) ;i++)

    {

    if( (i % 50 ) == 0)

    {

    result.addValue(a[0]);

    result.addContextChange();

    }

    else {

    if((i == (a.length) ))

    {

    result.addValue(a[0]);

    result.addContextChange();

    }

    else {

    result.addValue(a[0]);

    }

    }

    }

    BR,

    Rahul

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 02, 2009 at 12:59 PM

    i solved myself . no solution found

    Add comment
    10|10000 characters needed characters exceeded