Skip to Content
avatar image
Former Member

date format

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 02, 2009 at 10:38 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 02, 2009 at 11:22 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 02, 2009 at 01:45 PM

    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

    Add comment
    10|10000 characters needed characters exceeded