on 08-03-2006 10:52 PM
How can I split a String field in order to generate registers on a Target SAP table?
Ruben,
Within the mapping you can use the standart Text function such as substring or you can write a UDF. Can you send an example of what you are trying to achieve?
regards,
HM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the java code to split the source string (that I don`t know length before hand) my problem is how to do the mapping in order to generate a register on the target structure for each string generated by the spliting java function?
Help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ruben,
Just go through the given link:
http://www.sapgenie.com/netweaver/xi/mapping1.htm
hopefully it answers your question.
Regards
Neetu
Ruben,
You can have a Global Variable where you can store the string value and then for each target element where you want to split the string use the global variable value which will have your string and you can split it according to the length of the target element.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have the java code to split the source string (that I don`t know length before hand) my problem is how to do the mapping in order to generate a register on the target structure for each string generated by the spliting java function?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don`t know before hand the length of the source String.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey
this is how a substring function work
substring
public String substring(int beginIndex,
int endIndex)Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.
Examples:
"hamburger".substring(4, 😎 returns "urge"
"smiles".substring(1, 5) returns "mile"
so in ur case
wrote a small udf fuunction with the source string as input which will be taken as 'a'.
so write a function with
int len;
String s1;
String s2;
String s3;
len=a.length();
if(length>310)
{
s1="a".substring(0,132);
s2="a".substring(133,264);
s3="a".substring(265,76);
}
return s1;
return s2;
return s3;
cheers
jithesh
In the source message I have a String field (along other fields) with length n but on the target message I have a SAP table with a char field of 132 characters (along other field), I need to split the source string in order to generate registers on the SAP table of 132 characters, example:
Source String: 340 characters
Target Table: 3 registers, 2 of 132 characters and 1 of 76 characters
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ruben,
which requiredment do you have? Which mapping do you want to use? Where/How do you want to split the string?
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ruben,
A standard text function should suffice right? Use Substring, to split your value in graphical mapping
cheers,
Prashanth
P.S Please mark helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.