on 03-14-2014 12:36 PM
HI Experts,
I have the requirement where DATAB and DATBI field values comes in the below format.
<DATAB>12-feb-2014 00:00:00</DATAB>
<DATBI>28-feb-2015 14:00:00</DATBI>
But the SAP system is expecting in the format yyyy.mm.dd
Please advice how to achieve this.
Thanks,
Prathap.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prathap,
Try this UDF:
import following in the import tab of udf:
java.text.SimpleDateFormat;
java.util.Date;
Sample code:
public String TransDate(String sDate, Container container) throws StreamTransformationException{
Date date;
SimpleDateFormat sdfSource = new SimpleDateFormat("dd-MMM-yyyy");
SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy.MM.dd");
try{
date = sdfSource.parse(sDate);
String TDate= sdfDestination.format(date);
}catch(Exception e){
}
return TDate;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prathap,
Use DateTrans function, you have a lot of examples in SCN.
Regards.
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 | |
9 | |
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.