cancel
Showing results for 
Search instead for 
Did you mean: 

Sending date value from SAPUI5 to SAP Netweaver Gateway

yoppie_ariesthio
Participant
0 Kudos

Dear All,

I have front end using SAPUI5 and want to send date value to sap netweaver gateway.


var uri = "/sap/opu/odata/SAP/ZCREATE_PO_SRV/";

var oModel = new sap.ui.model.odata.ODataModel(uri, true);

var oEntry = {  };

oEntry.CreatDate = "2016-02-24";

oModel.create("/CreateSet", oEntry, null);

Seems i got error that tells i have wrong date format value,  :

2016-02-24 11:02:17.803995 The following problem occurred: HTTP request failed400,Bad Request,{"error":{"code":"CX_SY_CONVERSION_NO_DATE_TIME/67AA6842BAA80B7DE10000000A15523C","message":{"lang":"en","value":"Value 2016-02-24 does not represent a valid date/time"},"innererror":{"transactionid":"56CC0E24832120FCE1000000AC1032C4","timestamp":"20160224040119.1492760","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP NW Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"},"errordetails":[]}}}

i try another format value like :

24.12.2016

2016-12-24

24/12/2016

2016/12/24

24/12/2014

But it doesn't work..

Do you guys ever face this kind of problem? Need your help...

Thank you,

Best Regards

Yoppie A.

Accepted Solutions (1)

Accepted Solutions (1)

yoppie_ariesthio
Participant

Hi Antonette,

I solved it, the right format date is 2015-12-31T00:00:00

and don't forget to change maxlength to 16 dan type DATES on sap gateway netweaver

My friend Sandy helped me. Here's my friend linkedin : Aprilie Sandy | LinkedIn

Big Thanks for you

Yoppie

Answers (1)

Answers (1)

antonette_oberholster
Active Contributor
0 Kudos

Hallo Yoppie

If your backend is ECC, try this: You have to go to SU01d in ECC and check the date format that is set up for your user:

i.e.

Or try this in your code:

var mydate = sap.ui.getCore().getControl("dateControl").getValue() + "T00:00:00";

Hope this helps

Regards

Antonette

yoppie_ariesthio
Participant
0 Kudos

Hi Antonette,

Thank you for your answer,

Here's the my ECC Date Format,

It's set to DD.MM.YYYY

In SAPUI5 i have change the format so it's look like 24.12.2015T00:00:00. Still got same error

Best Regards,

Yoppie A.

antonette_oberholster
Active Contributor
0 Kudos

Hey Yoppie

Maybe you can try passing it very simple (like 24122015 in the form of text), and then formatting the date in your OData service before it gets sent to ECC?

Regards

Antonette

antonette_oberholster
Active Contributor
0 Kudos

You can also try passing this format from ui5:

"DD.MM.CCYY HH:MM:SS"

(without the T)

Regards

Antonette