cancel
Showing results for 
Search instead for 
Did you mean: 

how to send the selected date to backend r/3

Former Member
0 Kudos

Hi All,

When i select a date in font end the selected date i have to send to back-end in mm-dd-yy format

please help me in this ....

Regards,

Shilpa

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi,

For sample RFC implementation please go through the below thread.

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10c2c440-7f8c-2b10-7db0-dce34360...

for formatting the date, use the below code

SimpleDateFormat format= new SimpleDateFormat("mm-dd-yy");

String formattedDate=df.format("your input date);

mm-dd-yy is the format you want and in place of your input date give the date from your input screen.

Now, formatted date contains the result.

Hope it helps.

Thanks,

Prasanthi.

Former Member
0 Kudos

Make sure that your formatted date in webdynpro and the date format that is in backend are same and also the seperators for date month and year...

Thanks,

Prasanthi.

Former Member
0 Kudos

hi,

the backed date is different from front end date format please tell me how to change it to required format and how to send the date to backend....

Regards,

Shilpa

Former Member
0 Kudos

Hi Shi

In the view rightclick on the container where u want to place the date field,and select apply template

From template select the form . Then from the Model node select the date attribute to which u want to update the value.

So in the out put u will be getting a filed with help to select the date There select the date and execute bapi.It is automatically converted to the back end format

Check with this

Thanks

Madhu

Former Member
0 Kudos

hi all

i have the date MM/DD/YYYY

ineed to send it to backend input field as DD.MM.YYYY

Former Member
0 Kudos

Hi,

Following is the code


Date todaysDate = new Date(Calendar.getInstance().getTimeInMillis());
		SimpleDateFormat formatter = new SimpleDateFormat("dd.MM.yyyy");
		String formattedDate = formatter.format(todaysDate);
		System.out.print(formattedDate);

Regards

Ayyapparaj

Former Member
0 Kudos

HI shilpa,

Date str_date = new Date(Calendar.getInstance().getTimeInMillis());

DateFormat formatter=null ;

Date date=null ;

formatter = new SimpleDateFormat("dd.MM.yyyy");

date = (Date)formatter.parse(str_date);

assign this date to the Date attribute of backend

Thanks

madhu

Former Member
0 Kudos

Hi,

When u r passing a date as a RFC parameter then both should be in same format.

Try with this code

Calendar c = Calendar.getInstance();

SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); // specify u r format

String formattedDate=df.format(c.getTime());

John

Former Member
0 Kudos

hi,

can u take example and tell

waiting for your response...

Regards,

Shilpa.

Former Member
0 Kudos

Hi,

Right click on your component controller-> Template -> apply-> select service controller ..

once this is finished you will get the code.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

Create a simple data type of type DATE in the format which you want to send

Then map the type of the context to the type of the simple format which you created.

So once the user selcts the date at the front end it will be converted to the format which you created earlier

Regards

Padma N

Former Member
0 Kudos

do the following coding

SimpleDateFormat format =

new SimpleDateFormat("MM-dd-yy ");

format.parse(give your date format here in a string format);

This will work

Thanks and Regards

shanto aloor

Former Member
0 Kudos

Hi,

To send data to the backend from WD you need to import the Model

Bind the model to the controller and then to the view

Create respective UI elements for Input/output

bind them to the context attributes mapped from the model.

To do the above step You can use the wizards provided by Webdynpro.

Ex: Service Controller, Templates in View.

Finally execute the model.

If you need to change the date format use the Simple Date formatter http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html

Or you can use the dictionary types.

Regards

Ayyapparaj

Former Member
0 Kudos

Thanks ayyaparaj, can u specify the code because i binded the context element to model attribute itself but in my case its not working fine unable to send the date please

what should i write ....

waiting for your response....

Regards,

Shilpa.

Former Member
0 Kudos

Hi,

Format your selected date as mm-dd-yy and bind that to RFC attribute.