on 04-15-2009 12:03 PM
1) This is structure
YYYY-MM-DDTHH:MM:SS+HH:MM to DDMMYY
Here T stands for Time Begin
Plz I need UDF for this .
NO need of UDF .
Use standard text functions.
use substring function 3 times to get DD , MM and YY
like this
substring : first parameter is the source string
second parameter is 8 (Starting position if Date)
third parameter is 2 (Length if Date)
substring : first parameter is the source string
second parameter is 5 (Starting position of month)
third parameter is 2 (Length if month)
substring : first parameter is the source string
second parameter is 2 (Starting position if Date)
third parameter is 2 (Length of year)
use concatenate function two times.
First concatenate the output of first two substrings.
Then use concatenate function to club the output of the first concatenate function to the output of third substring function.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what ravi meant is instead of going for a code using UDF you can use the standard functions available in XI like substring and concat to acheive the same logic.
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm - see the Function Category: Text
Hi,
You can do it as simple as follows using standard date transformation.
source pattern: give yyyy-dd-MM ..ignore T and rest of that..though it is coming from source.
Target pattern: give ddMMyy manually ..thats it..no need to use any other functions.
Thanks
Hamja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if i am not wrong praveen is searching for an UDF becoz the format YYYY-MM-DDTHH:MM:SS+HH:MM is not a static and he will be getting varying format....so with standard functions will cause problem..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> 1) This is structure
> YYYY-MM-DDTHH:MM:SS+HH:MM to DDMMYY
> Here T stands for Time Begin
>
> Plz I need UDF for this .
if you input is a
then your UDF will be something like,
return (a.substring(8,9) + a.substring(5,6) + a.substring(2,3));
these are easily handles by the java string class... you can always refer that for your further developments - http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html#substring(int,%20int)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Use substring and concatenate standard function to get the target string.
No need for UDF.
Regards,
Shweta.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Praveen Says..
YYYY-MM-DDTHH:MM:SS+HH:MM to DDMMYY
You do not need any UDF for this.
Use standard function "TransformDate" and create your own pattern in source strcuture and the target structure is a simple one.
Regards,
Madan Agrawal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.