on 07-17-2006 5:33 PM
Hi all,
I have a table which is populated with the values from BAPI. The data for three fields like "Printdate", "Issue date" and "dateid" should be in the format dd/mm/yyyy.
I have not directly binded the table to the BAPI response parameters. Instead I have created a local value node and have binded the value attributes .
That means i have to write a logic to do so and then set the local value attribute accordingly.
Kindly help me to resolve the issue.
Regards
DK
Hi DK,
Try this
String oldFormatData = "2006/07/17";
String newFormatData;
SimpleDateFormat old = new SimpleDateFormat("yyyy/MM/dd");
SimpleDateFormat new = new SimpleDateFormat("dd/MM/yyyy");
Date old = old.parse(oldFormatData);
newFormatData = new.format(old);
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This below Date Convert function may help full you.
If you pass any String - Date to it, it will change the String to Desirable Date format. You can mention your date format as -> new SimpleDateFormat("yyyy/MM/dd");
public java.sql.Date stringToDate( java.lang.String dateAsString )
{
java.util.Date dateFrom = null;
java.sql.Date validFromDate = null;
try {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd");
if (formatter != null && dateAsString != null) {
dateFrom = formatter.parse(dateAsString);
}
long dateFromAsLong = 0;
if (dateFrom != null) {
dateFromAsLong = dateFrom.getTime();
}
if (dateFromAsLong != 0) {
validFromDate = new java.sql.Date(dateFromAsLong);
}
return validFromDate;
}catch (Exception ex) {
manager.reportException(ex.getMessage(), true);
return validFromDate;
}
}
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try using the WRITE statement.
WRITE date_var editmask dd/mm/yyyy to new_var.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
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.