cancel
Showing results for 
Search instead for 
Did you mean: 

$expand Query not working

Former Member
0 Kudos

Hello Experts,

I am facing issue with $expand.

I have followed below steps,

1. Create Data Mode - SalesOrder and OrderItems

2. Association - SalesOrderItems between above two DataModels,

3.Implemented method - /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY

When I am executing URI i am getting error "Method 'ORDERITEMS_GET_ENTITYSET' not implemented in data provider class."

As per my understanding /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY method alone should work.



My URI - /sap/opu/odata/sap/ZSL_EMP_DEMO1212_SRV/SalesOrder('500000000')?$expand=SalesOrderItems


Can anyone please help me if I am missing anything here.

Regards,

Sid

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Sid,

This is because Association which is referred by navigation 'SalesOrderItems' has cardinality of 1:N or 1:M. Because of this method GET_EXPANDED_ENTITYSET will be called instead of GET_EXPANDED_ENTITY. So you have to redefine/implement GET_EXPANDED_ENTITYSET.

regards

Krishna

Former Member
0 Kudos

Hi Krishna,

I have redefined GET_EXPANDED_ENTITYSET and revert GET_EXPANDED_ENTITY. I am getting error RFC Error: The read XML document had an invalid format.

Regards,

Sid

Former Member
0 Kudos

I redefined GET_EXPANDED_ENTITYSET method and corrected structure to hold data with deep structure. I also populated "et_expanded_tech_clauses" with navigation property name and now it is working fine.


Thanks,

Sid

Answers (0)