cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Sriprasadsbhat
Active Contributor
0 Kudos

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

Sriprasadsbhat
Active Contributor
0 Kudos

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