on 07-01-2008 4:04 PM
Hi,
For Javamen...
I'm facing to a stupid pb: easy in abap, but in Java is another story...
Here's what I want to do in Java (with a UdF):
Source = abcdefgh.
Target = 1234567
Target+10(6) = Source(6).
Thus result should be: Target = "1234567___abcdef" with three spaces "_" (for this example), coz the first part is on 10 characters.
My pb is not to get the 6 char of Source (cf. fct substring), but it's the managment of the offset "+10".
Regards
Mickael
Hi,
source and target are two input values -> is this right?
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
if I understand you right you want to bring the target value to a length of 10.
In this case you could write a udf with one parameter (here a) like this:
if (a.length() < 10) {
while (a.length() < 10) {
a = a + " ";
}
}
return a;
Then you can use the standard concat-function with the output of the udf and the source value.
(Works only if your target could not be longer than 10 otherwise you have to check this also)
Regards
Patrick
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.