cancel
Showing results for 
Search instead for 
Did you mean: 

passing system date while calling an RFC

birojpatro
Contributor
0 Kudos

Hi Gurus,

I am facing problem calling an RFC. The RFC expects the system date as an import param.

I am not able to pass the param (setDate() method expects an sql date).

I know, the webdynpro will take care of the formatting internally.

Can somebody help me ????

Thanks in advance

Biroj..

Accepted Solutions (1)

Accepted Solutions (1)

PradeepBondla
Active Contributor
0 Kudos

Hi,

Get the system date, convert it to milliseconds yourdate.toxxxx(). then convert it to sql date. then assign to your RFC.

I think you understood this with nikil's code.

PradeeP

Answers (5)

Answers (5)

birojpatro
Contributor
0 Kudos

very helpful answers...

thanks everybody....

Former Member
0 Kudos

Hi,

Use the following code


java.sql.Date date = new java.sql.Date(Calendar.getInstance().getTimeInMillis());
//Change the following to suite your context structure.
	  wdContext.currentContextElement().setDate(date);

//For Formatting use the following code
DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
	  dateFormat.format(date);

Regards

Ayyapparaj

namrata_d
Active Participant
0 Kudos

Hi Biroj,

you can pass the current date as :-

(new java.sql.Date(new java.util.Date().getTime()))

Thanks

Namrata

Former Member
0 Kudos

Hi,

with this setDate(new java.sql.Date(Calendar.getInstance().getTimeInMillis()));

you can pass the current date to rfc.

Regards,

ramesh

nikhil_bose
Active Contributor
0 Kudos

java.sql.Date today = new java.sql.Date(System.currentTimeInMilliseconds());

and you can pretty well go for setDate( today);

nikhil