on 07-30-2008 6:51 AM
Hello,
Have a way in graphical mapping to change only the first letter to uppercase?
Elad
Hi,
Swarup was right.
But when value is used as cache parameter arrays shud nt be used.
This works perfectly.
public String uppercase(String a,Container container)
{
return((a.substring(0,1)).toUpperCase()+ a.substring(1,a.length()));
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Creation of simple UDF is the option.
By Mapping you can take the first char, also make it in upperCase. but how you will concatinate the rest of the filed?
example "sap PI"
By standard function: u can make s as upper "S". but how you will take rest date "ap PI". SO better to go for UDF with exceptional handling.
Thanks
Farooq
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do it with standard dunctions.
Here is the solution:
https://weblogs.sdn.sap.com/weblogs/images/251803663/UDF.JPG
But also try to take care of Exception handling. If string is empty or has only 1 char. then it will fail.
thanks,
farooq.
Edited by: Farooq Farooqui on Jul 30, 2008 12:36 PM
hi,
Please do the following mapping. hope this will help you.
input-->SUBSTRING1>uppercase-->Firstinput to concate function
CONCATE----
>output
input-->SUBSTRING2--->second input to concatefunction
Set Substring1: starting position=0 and numberof chareters =1
set Substring2 :starting position=1 and numberof chareters =0
regards
Kasturika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
pass your string as input that you want to change your first char to uppercase.
assuming your input is String var;
int len = var.length();
String str1="",str2="";
str1 = var.substring(0,1);
str2 = var.substring(1,len);
str1 = str1.toUppercase();
str2 = str1 + str2;
return str2;
hope this helps
Thanks
Saiyog
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You need to create UDF with cache parameter as Value and just single line statement
return((a[0].substring(0,1)).toUpperCase()+ a[0].substring(1,a[0].length()));
Thanks
Swarup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If your source field is always having fixed length then u can use the combination of subString, toUpperCase and concat text functions. If not you have to use the UDF.
Thanks
SaNv...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
U can use the functions subString, toUpperCase and concat of Text category in ur case.
Get the first character of the string with substring function, covert it to uppercase with toUpperCase an d concat it with remaining string.
regards ,
Chandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to use UDF
In UDF, take out first character in original string
use firstCharString.toUpperCase()
then concatenate it with rest of the string and
return newString
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.