cancel
Showing results for 
Search instead for 
Did you mean: 

date format

Former Member
0 Kudos

Dear All,

My requirement is to pass a dummy date ie 01-01-1970 when i create a dealer. Now this date has to be set to a r/3 date field. Is it possible to set a particular date via hard coding and set it to date field in r/3 which wud be of type sql date.

Thankyou.

Regards,

Jaspreet Kaur

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Use the Calendar class.

Calendar cal = Calendar.getInstance();

cal.set(Calendar.YEAR, 1970);

cal.set(Calendar.MONTH, 0);

cal.set(Calendar.DAY_OF_MONTH, 1);

java.sql.Date d=new Date(cal.getTimeInMillis());

pass the d to RFC which will take 01-01-1970 as the date.

Regards,

Naga

Former Member
0 Kudos

You can use the current date for passing the sql date to R/3 input parameter using following code

java.sql.Date date = new java.sql.Date(System.currentTimeInMilliSeconds());

For user defined date use :

DateFormat dateFormat = new SimpleDateFormat("dd-MMM-yy");

java.util.Date enteredDate = dateFormat.parse("15-Nov-09");

java.sql.Date sDt = new java.sql.Date(enteredDate.getTime());

And then pass this sDt to R/3.

Regards,

Tushar Sinha

Former Member
0 Kudos

When you pass a date to r/3 you pass a date object which means that the date format is irrelevant.

The date object sent to r/3 is based on java.sql.Date.

If you need a represantion on the screen you can use a custom data dictionary date.