on 12-09-2015 5:13 AM
Hi,
I have two entity product and supplier. product(0:n)-->supplier(1)
I have created association and navigation property(ToSupplier) in product. the association has no referential constraints.
now I am trying to get the supplier via navigation.
odata request url /ProductCollection('AD-1000')/ToSupplier
SUPPLIERCOLLECTI_GET_ENTITY get called.
the value of input parameter iv_entity_set_name of that method is "SupplierCollection". why? it should be "ProductCollection".
I am following the example from this book, the code in book is also expecting that paramter to be "ProductCollection"
OData and SAP NetWeaver Gateway. von Carsten Bönnen, - by SAP PRESS
did I miss anything?
my gateway is sp12 on nw 7.4
Best regards,
Jun
surprisingly no solid answer for this small doubt....
all exerts went for holiday??
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you created an assocation and navigation between Product Collecctions ans supplier collections.
/ProductCollection('AD-1000')/ToSupplier
When you execute this url , you are actually fetching the list of suppliers(or one supplier based on the cardinality) and you are not querying the product collection here.. It will show what collection or entity you are trying to retrieve ..
Sreehari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the explanation,
understand that.
but from that book, it is expecting that collection name to be "ProductCollection"
Can you let me know what you will do for the following case
/ProductCollection('AD-1000')/ToSupplier
/SupplierCollection(10000)
for both url, the SupplierCollection-get_entity will get called
how you can differentiate it in the method?
for the first url, you have to get the product based on the product id first then get the supplier.
for the second url, you can get the supplier directly from the supplier id.
how your code will determine which path to go?
Hi Ashwin,
I am doing that. that's why I have question about the input parameter iv_entity_set_name.
I am expecting it to be ProductCollection. but it is not.
so it will be great if someone can explain me how that parameter is determined by the gateway framework.
as of now, for both case the entity set name is the same, which is SupplierCollection, so we have to use navigation path to differentiate the case?
Best regards.
Jun
When modelling in SEGW i see that there is no chance of having same Navigation Property for the whole project. Service builder will not allow duplicate properties to be defined inside a project for the service.
Even if accidentally same Navigation Property is defined in other project its still fine because that would be specific to Project and service created in SEGW.
However did you check the filled inside IT_NAVIGATION_PATH when you fired the below URL's
/ProductCollection('AD-1000')/ToSupplier
/SupplierCollection(10000)
/ProductCollection('AD-1000')/ToSupplier
/SupplierCollection('0100000015')/ToSupplier
IT_NAVIGATION_PATH will have same value for those url.
As far as i know above is expected behavior where IT_NAVIGATION_PATH would have same values because you are passing navigation property and your navigation path will always have the same property for both URI's.
If you have this kind of cases, you need to pass Navigation Property based on Referential Keys. So that based on the Navigation Property and its Keys we can call the logic accordingly and send back the response.
When you have multiple scenarios to be acted upon on a particular entity defining navigation and the referential constraint would help. Using this keys to pass along with Navigation would help to differentiate the calls and send back the appropriate response.
I am not sure why you would have to use URL as /SupplierCollection('0100000015')/ToSupplier
just passing /SupplierCollection('0100000015') would serve the purpose.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.