Skip to Content
author's profile photo Former Member
Former Member

Error with $expand and navigation: Resource not found for the segment 'NavAtp'

Hi,

I have created associations between entities in order to get the following structure:

The first level is the material level. Then I have the SKU in second level which acts as a table because one material can have several SKUs.

Then, for each SKU, I have a table for stocks (ATP: immediate stock, stock in x days…) and prices: retail price and Wholesales price.

Here is a screenshot of what I have:

Concerning the navigations, I have:

  • NavMatnr to relate the material level and the SKU level
  • NavAtp to relate the ATP level to the SKU level
  • NavPricing to relate the pricing level and the SKU level

I am calling the service using the following URL:

/sap/opu/odata/sap/zezb_get_materials_srv/Materials?$filter=SalesOrg eq 'GI10' and DistribChannel eq '01' and Division eq '30'&$expand=NavMatnr,NavAtp,NavPricing

The error triggered is the following: “Resource not found for the segment 'NavAtp'.”

I declare my deep structures as follow:

DATA:  BEGIN OF ls_material_sku.
           INCLUDE       TYPE zcl_ezb_get_materials_mpc=>ts_sku.
           DATA: navatp TYPE STANDARD TABLE OF zcl_ezb_get_materials_mpc=>ts_atp WITH DEFAULT KEY.
           DATA: navpricing TYPE STANDARD TABLE OF zcl_ezb_get_materials_mpc=>ts_price WITH DEFAULT KEY,
          END OF ls_material_sku.


   DATA:  BEGIN OF ls_output_material.
           INCLUDE       TYPE zcl_ezb_get_materials_mpc=>ts_material.
           DATA: lt_material_output_sku LIKE STANDARD TABLE OF ls_material_sku.
           DATA: navmatnr TYPE STANDARD TABLE OF zcl_ezb_get_materials_mpc=>ts_sku WITH DEFAULT KEY,
          END OF ls_output_material.

I can understand that navatp is not part of the ls_output_material. But I need to get the navatp in the material sku structure, and not in the top parent structure. What should I do to resolve this issue ?

Thanks in advance for your help.

Thibault

1.png (26.3 kB)
2.png (7.4 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Sep 17, 2014 at 05:56 AM

    Hi,

    In SKU Entity type, you provided navigation propeties name as NAVATP and NAVPRICING. Instead of that you can provide navigation propety name as Entity Types like ATP and PRICE.

    I also have the same issue, when i changed the navigation property names with the Entity type names. it worked for me along with the header, able to get their line items as well.

    Regards,

    Venu

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 16, 2014 at 01:11 PM

    Hi,

    as the NavAtp and NavPricing are child of NavMatnr, you need to try as below,

    &$expand=NavMatnr/NavAtp,NavMatnr/NavPricing


    Regards,

    Chandra

    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.