on 10-19-2018 1:03 PM
I add new data to my oData Model by creating a new Entry like this:
_.forEach(insert, data => {
var entry = (modelprefix + "('" + data.COL01 + "')");
oModel.create(modelprefix, data, mParameters);
});
That code is working finde for strings and numbers, but when it comes to a date, it doesn't work.
My target structure contains a 0CALDAY column, in which the values from the "insert" JSON Model should get parsed. I don't get an error or anything, just nothing happens..
I suspect that this is because 0CALDAY expects an object to be inserted, but it gets only a String. But what can I do?
That's one object of my Insert-JSON-Model: COL04 is the date to be inserted. It already has the correct format for my SAP! (dd.mm.yy)
can you see what is getting posted correctly? i do not know why you would get an error while parsing xml stream since your service has json... are you specifying xml anywhere? are you able to see the payload on postman ? or the network tab in your browser?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if your service expects a date object.. you will need to create a date based on the string value such as
new Date('YY.MM.DD')
hops this works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks 9958e4b6df99431a84a41b015b639ac8 . I came to that solution as well and now convert my dates to date objects before updating my data. But that causes an "Error while parsing XML stream".
I now have a date with the correct format that gets pushed to the oData model, but somehow it doesn't accept that either..
Do you know why?
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.