Skip to content
Advertisement

SAP UI OData Create does not initialize IT_KEY_TAB parameter

I’m testing oData functinality with SAPUI5.

So far I’ve implemented GET & DELETE which is working fine.

No when I want to add a new Entry I get some problems.

enter image description here

Im sending the Create-Request like this:

JavaScript

This is my Request:

JavaScript

Also the data I want to post is mentioned in the request:

JavaScript

When I add an external Breakpoint to my SAP GUI I can see that Z_ETT_ODATASET_CREATE_ENTITY is invoked, but sadly IT_KEY_TAB has no entries.

What is wrong here – where am I losing my data ?

Advertisement

Answer

IT_KEY_TAB is going to give you the keys that are entered in the REST service (for example the key for the entity that you were using for GET or DELETE).

For POST and PUT requests, you want the object that is being sent, which can be retrieved using the io_data_provider->read_entry_data( ) method.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement