on 03-05-2018 12:12 PM
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,
solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello ,
I wrote UDF which is splitting the string into 13 string each, but I want the idoc segment to be created for every next 13 fields but the other values of the other fields in the idoc segment should be as it is. I tired with this logic in mapping but its not working
Source--UDF---SpilitByValue(Each Value)---target.
Can you please suggest any corrections in it?
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First add ","delimiter after every 13 characters using a simple udf and write the below code in the same udf. This will give the output as the attached screenshot. Then you can use splitbyvalue function to assign it to the field in consecutive segments.
for (String a: value[0].split(","))
{
result.addValue(a);
Looks like you have an extra closing bracket that you do not need. Try this:
result.addvalue(a,pos+13);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any help on this please?
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mark,
Do I select it as Argument or parameter? Also should it have any Result/Output parameter ?
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Experts,
Any help on this please ?
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Experts,
Any help on this please?
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Experts,
Any help on this please?
Thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.