Skip to Content

Split input string to chunk of characters and assign it to target idoc line item

Hello Experts,

My requirement is like this.

Input field is having values more than 135 characters and we want to split this value to multiple segments of IDOC SEGMENT. This is like First 13 characters to segment one ,secon d 13 to segment 2 and so on.

I tried with solit by value(each value but it did not work. Can someone please help me on this?

Really appreciate help.

Thanks in advance,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

14 Answers

  • Mar 06 at 06:02 PM

    Hello Experts,

    Any help on this please?

    Thanks in advance

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 06 at 06:29 PM

    Hello Experts,

    Any help on this please ?

    Thanks in advance

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07 at 07:50 AM

    Hi,

    I do not have PI at the moment, but you can replace System.out.println with result.AddValue;

    Hope this helps,

    Mark

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 05 at 03:00 PM

    Hello Experts,

    Any help on this please?

    Thanks in advance

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 05 at 06:09 PM

    I tried the code in this discussion but its giving the error.

    Can you please help me correct the code in this discussion?

    https://archive.sap.com/discussions/thread/3160240

    Thanks in advance

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 05 at 06:29 PM

    I corrected the UDF like this but it did not work

    int size = 13; for (int i = 0; i < input.length(); i += size){ int end = i + size > input.length(); input.length() = i + size; result.addValue(input.substring(i, end)); }

    Can someone please help on this?

    Thanks in advance

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07 at 01:54 PM

    Hi BRM Fresher!

    It looks like you use single value UDF to produce result list.

    As far as I remember, if you want to return a list of values, you should switch to all values of context or all values of queue and process input array instead of single value.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07 at 06:25 PM

    Hello Mark,

    Do I select it as Argument or parameter? Also should it have any Result/Output parameter ?

    Thanks in advance

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07 at 06:51 PM

    Hi Mark,

    I created it this way but it did not work. Did I use the code correctly or there is any error in using it? Can you please advise where it went wrong?

    Thanks in advance

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 08 at 04:45 AM

    Tried with this code

    Getting this error

    Can you please tell me where it went wrong?

    Thanks in advance

    Add comment
    10|10000 characters needed characters exceeded