on 10-08-2007 10:04 AM
Dear all,i haf the following codes
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
input1.setIv_Pdatu(formatter.format (new java.sql.Date(System.currentTimeMillis())));
but it seems the system return error,it said tat my setlv_Pdatu required DATE input but not STRING..how should i solve this? pls advice,thank you
Hi
<b>import java.util.GregorianCalendar;</b>
java.sql.Date formatter = new java.sql.Date(gregorianCalendar.getTimeInMillis());
wdContext.input1().setIv_Pdatu(formatter);
Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joan,
Try this:
Calendar cal = Calendar.getInstance();
input1.setIv_Pdatu(cal.getTime());
Regards,
Omri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
try to use this
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
java.sql.Date dt=(java.sql.Date)new java.util.Date();
input1.setIv_Pdatu(formatter.format (dt));
Regards
Abhijith YS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
By Default every Node Attribute which you create will be of <b>STRING</b> type. so you need Change the <i>setlv_Pdatu</i> to <b>date</b> . is this the problem
Regards
Chaitanya.A
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joan,
Check this code to convert string to date.
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
String str_date = "20071009";
java.util.Date util_date= formatter.parse(str_date);
java.sql.Date dt = new java.sql.Date(util_date.getTime());
input1.setIv_Pdatu(dt);
/message/1212686#1212686 [original link is broken]
Regards,
Mithu
Hi Joan,
input1.setIv_Pdatu(Date.valueOf(formatter.format (new java.sql.Date(System.currentTimeMillis()))));
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joan,
Try giving the same date that you provided directly in R/3 and test your Function Module. If its not returning any value over there then there might be no records corresponding to the date being provided by you. Also, verify the format of Date that you provide from WD and in R/3 is same.
Regards,
Murtuza
Hi Joan,
Try this.
import java.sql.Date;
try {
Date current_Date = new Date(System.currentTimeMillis());
input1.setIv_Pdatu(new Date(formatter.parse(current_Date.toString()).getTime()));
} catch (ParseException e1) {
// TODO Auto-generated catch block
wdComponentAPI.getMessageManager().reportSuccess("Error : "+e1.getMessage());
}
Regards,
Mithu
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.