cancel
Showing results for 
Search instead for 
Did you mean: 

Date conversion problem.

Rodrigo-Giner
Active Contributor
0 Kudos

I use 2 adaptive RFC function with a r3 backend system:

1- Search

2- Update

The first works fine, I show the data, one of the fields is a date (with r3 Date format) binded and in the web dynpro is showed in inputfield, with a little calendar icon on the right.

I have problem with the second one. Cause I use the same inputfield for both RFC. I bind in design time with the Search RFC and for the update I pass the changed values to the 2nd RFC trought coding.

What I want is just to save in a Variable, the value of the binded UI element, with the string type I have no problem, but when I wanna save my date field in a String It say that the conversion cannot be done.

<u>EXAMPLE:</u>

String value1 = wdContext.currentTable_CelElement().getNumcel();

I wanna accomplish that example but With Date format. So the question would be How can I save in a Variable a Date format field of R3.

<b>"?" </b>value2 = wdContext.currentTable_CelElement().getFecha();

Thx

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

How can we make sure that the date displayed on the View is in the R3 system date format.I am facing the same problem with the date field in my view the date is coming in the format mm/dd/yyyy which is my system format not the R3 system date format dd.mm.yyyy.

Former Member
0 Kudos

Hi!

I think that this problem occurs because of different Date formats in your Web Dynpro Application: The R/3-Date format is mapped to java.sql.Date, and for your variable you probably use java.util.Date.

If so, try to use the sql.Date for your variable, too, or make a conversion like this:

java.util.Date myDate = new java.util.Date(wdContext.currentTable_CelElement().getFecha().getTime());

Regards,

Thomas

Rodrigo-Giner
Active Contributor
0 Kudos

Thx Thomas, your code was very usefull.

Althought didnt work, because when I updated the field to the update RFC was a conversion error, the only thing that I have to do is use java.sql.Date, instead of java.util.Date.

java.sql.Date value8 = new java.sql.Date(wdContext.currentTable_CelElement().getFecha().getTime());