Skip to Content
0

HCI: Cannot convert 20170523 000000.000 to java.util.Calendar

May 25, 2017 at 06:42 AM

138

avatar image

Dear experts,

we have a requirement where we need to integrate the multiple logins and logouts with success factors . here we have created the mdf object to insert the data using hana cloud integration. As a part of that i have created the iflow and created the script to convert the date format. but i am getting the following error

com.sap.gateway.core.ip.component.odata.exception.OsciException: Request Payload: Either the OData metadata content available in the server is outdated or the request payload seems to be incorrect = https://api8preview.sapsf.com/odata/v2_defaultTenant_shrivilepaT with error => Cannot convert 20170523 000000.000 to java.util.Calendar.

The script i have used is as follows

import com.sap.it.api.mapping.*; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; //Add MappingContext as an additional argument to read or set Headers and properties. def Date customFunc(Date arg1){ Date inputDate_parsed=new SimpleDateFormat("dd/MM/yyyy").parse(arg1); DateFormat dateFormat_required = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS"); def converted_datetime=dateFormat_required.format(inputDate_parsed); return converted_datetime; }attandance.jpgqueried-output.jpg

Please suggest me on this.

Regards

Giridhar Vegi.

attandance.jpg (59.5 kB)
queried-output.jpg (82.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sriprasad Shivaram Bhat May 25, 2017 at 07:19 AM
0

Hello Giridhar,

First you have to do a Metadata Refresh in SuccessFactors( Looks like metadata which you have in SAP HCI and which is present in SF are not in sync ) and model the operation again.

As I have asked earlier are you using the Script which I have given in the earlier thread as Script Step or using it as Custom Function inside Message Mapping?

Regards,

Sriprasad Shivaram Bhat

Share
10 |10000 characters needed characters left characters exceeded
Santosh Giridhar vegi May 25, 2017 at 10:59 AM
0

Dear prasad ,

i have done the metadata refresh in successfactors . and model the operation again.

and i am using the code as custom function in message mapping.

Please suggest me on this if i am doing wrong thing

Regards

Giridhar Vegi

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello Giridhar,

Please go to OData Data Dictionary in SF and findout the datatype associated with that field.

Is it just date or datetime.If that custom MDF alaredy have some data then try to query one record and you will be able to get the format of datetime you need to pass and then accordingly we can change the Custom Function code.

Regards,

Sriprasad Shivaram Bhat

0