on 12-26-2015 1:21 AM
Hi,
in my entity model, the entity (e.g. MyEntity) consists of two key fields instead of one.
How do I have to call the URI for a entity set with 2 key values in order to receive one entity (MyEntity is the entity and MyEntityCollection is the set of MyEntity) using the service sap/opu/odata/sap/Ztest_srv/MyEntityCollection but without using an additional filter?
E.g. something like sap/opu/odata/sap/Ztest_srv/MyEntityCollection('..<key1>..', '..<key2>..')?
The idea is to get the corresponding internal array it_key_tab filled automatically.
Yours
Stephan
Hello,
I have found the issue. I'm currently using NW 7.02 Trial version with SAP Gateway. There is an internal errror in the generation of model classes which will be created automatically.
In my case, ZCL_XXX_MPC->DEFINE_<my entity> has not defined correctly all key properties with the statement lo_property->set_is_key( ). I have fixed this error in SE80 and now I can use several key fields of the entity set like the following:
sap/opu/odata/sap/Ztest_srv/MyEntityCollection(key1='<value of key1>',key2='<value of key2>')
Additionally, I have reset the model caches (/IWFND/CACHE_CLEANUP and /IWBEP/CACHE_CLEANUP) and used the Gateway client (/IWFND/GW_CLIENT) in order to chec the metadata. The metadata is now displaying the <key> properties within <EntityType> segment.
This bug fixing has to be repeated each time the model will be re-generated within SEGW.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.