Skip to Content

Error fetching sales order header and line items via $expand statement

Hello sap techies,

          having implemented sales order get_entity and get_entityset (based on mapped data source i.e respective bapi's)...now facing error 😔while trying to fetch header and line data using $expand statement..

and I just read about framework $expand with which (without hand coding ) we can expected output..😭

Following are some few snaps:

thanks,

Pavan Golesar

rrr.JPG (149.0 kB)
loc.JPG (43.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 06, 2015 at 09:39 AM

    You mentioned $expand=SalesOrderItems

    But seems like SalesOrderItems is not the name of navigation property. You need to mention Navigation Property name here.

    Add comment
    10|10000 characters needed characters exceeded

    • Umm, can you put some light on the below uri...?


      /sap/opu/odata/sap/ZTEST_DP_EXPAND_SRV/SalesOrderSet('500000001')/OrderToItems(SoId='500000001',SoItemPos='0000000010')/ItemToProduct..



      and how can we get a single line item record (for using it as 'use as request' ) for create operation...

      Eg: If we have a sales order with 5 line items... If I need just one line item in response.... can you please share how to achieve this..


      Thanks,

      Pavan G

  • avatar image
    Former Member
    Jul 06, 2015 at 10:47 AM

    Hello Pavan,

    I would suggest the below for detailed information on Data Provider Expand and Frame Work Expand which will help to decide which one to use frame work or data provider expand.

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

    Multi-Level Expansion with GET_EXPANDED_ENTITYSET

    Implementing Expand Entity/Entity Set

    Regards,

    Ashwin

    Add comment
    10|10000 characters needed characters exceeded