Skip to Content

Implementing an included odata service

Hi experts, I included an OData service into a standard SAP OData service. The association I want to create is from standard SAP entity Contact to custom developped AttributeName and should be addressable by this URI /ContactCollection(contactID='2000000165',accountID='41000104')/Attributes. After importing my Odata service, I created an association, associationset and navigation property (Attributes). My navigation works and I can implement the get_entityset in my included OData service. However at runtime I do not receive the necessary contactID and accountID in my IT_KEY_TAB or any other variable. How can I know the contactID and accountID???

IT_KEY_TAB [0x2(16)]Standard Table IV_ENTITY_NAME AttributeName IV_SOURCE_NAME Contact

Your help is appreciated. Kind regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 29, 2014 at 11:48 AM

    Hi Mario,

    This should work, passing you the keys in the navigation links, but doesn't work as expected in the current releases of Gateway. I've worked around this issue by creating properties in my target entity (called TempWorkAroundId(s) and mapped to these in the relationship. Dodgy but at least lets you identify what the key is from where you've come from (if that make sense).

    I asked at TechEd about this lacking feature, and it's coming, but no real information on when this will actually be resolved. Very frustrating and means you can't do reuse very easily where there is a requirement to know where you've come from in the navigation.

    Cheers,

    Matt

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 29, 2014 at 11:25 AM

    Hello Mario,

    U need to have contactID and accountID as referential constraints when u create association and navigation between the Contact and Attribute entities.

    Read the keys now.

    Please refer the below which will explain all the necessary details u are looking for and to get better understanding :

    Search for the URL /sap/opu/odata/sap/ZTEST_DP_EXPAND_SRV/SalesOrderSet('500000008')/OrderToItems

    in the below mentioned blog and see how its being modeled and ur scenario is same as this.

    This should solve the problem.

    Let's code association/navigation and data provider expand in OData service!

    Regards,

    Ashwin

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 29, 2014 at 12:34 PM

    Hi Matt, Ashwin,

    thank you a lot for your valuable and fast responses. I did create the referential constraints from the start but did not fill in the dependent entity and property (as there was none). The behaviour that I than saw was that I only received 1 parameter in my included odata service in stead of 2. We are on SP07.

    My problem was solved by including the accounttemp and contacttemp properties in the included odataservice entity (although it does not make any sense). I agree with Matt this is a dody fashion to solve this kind of problems but it works 😊.


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.