cancel
Showing results for 
Search instead for 
Did you mean: 

Create Deep Entity for Multiple Entity Sets

tharaka_fernando
Contributor
0 Kudos

Dear All Gurus,

I need your expert advice on solving below matter since I was unable to find an exact solution yet.

I have created an oData Service for fully cusomized app in fiori.

Requirement  : Purchase order Creation

Entity Typres :

Header (PK : PONumber)

LineItems (PK : PONumber)

PricingConditions (PK : PONumber)

Relationship

Header---------(1....n)-------LineItems (navigation name : PO_Navigation)

LineItems--------(1....n)-------PricingConditions (navigation name : POCOND_NAVI)

need help on coding section in Create Deep Entity.

My Coding is below in that section and I am able to get header and LineItems details but not  PricingConditions.


TYPES: tt_items TYPE TABLE OF ZCL_ZPO_MPC_EXT=>TS_PO_ITEM WITH DEFAULT KEY.

TYPES: BEGIN OF ts_purchaseorder_items..

INCLUDE TYPE ZCL_ZPO_MPC_EXT=> TS_PO_HEADER.          " This is in the MPC EXT cleass

TYPES: PO_Navigation TYPE tt_items,     "

END OF ts_conditions.

Can you please help on this......

Accepted Solutions (0)

Answers (3)

Answers (3)

tharaka_fernando
Contributor
0 Kudos

Dear All,

Thank you for the reply..

Actually I am able too get detail from Header and Line Items as per your examples.

TYPES: tt_items TYPE TABLE OF ZCL_ZPO_MPC_EXT=>TS_PO_ITEM WITH DEFAULT KEY.

TYPES: BEGIN OF ts_purchaseorder_items.. 

     INCLUDE TYPE ZCL_ZPO_MPC_EXT=> TS_PO_HEADER.          " This is in the MPC EXT cleass  

     TYPES: PO_Navigation TYPE  tt_items,     " 

END OF ts_purchaseorder_items 

But I have 03 Entity sets in my model.

Header / LineItems / PricingConditions => (Primary Key Purchase order Number)

Header---------(1....n)-------LineItems (navigation name : PO_Navigation)

LineItems--------(1....n)-------PricingConditions (navigation name : POCOND_NAVI)

Can you please tell me how to create deep entity set for these 03 entities.

Get Entityset is working fine with below URI

/sap/opu/odata/sap/ZPO_SRV/PO_HEADER('2100002475')?$expand=PO_Navigation/POCOND_NAVI

AshwinDutt
Active Contributor
0 Kudos

Hello Tharu,

Please refer to the below :

It will give idea.

Regards,

Ashwin

AshwinDutt
Active Contributor
0 Kudos

Hello Tharu,

Navigation property defined in ur model shud be same as the name used while declaring deep structure while coding.

Please refer the below screen shot.

Model ->

Code Snippet ->

So keep above as reference and declare deep structure appropriately for ur scenario.

Regards,

Ashwin

kammaje_cis
Active Contributor
0 Kudos

I think your declaration pasted here is not complete.

I see " END OF ts_conditions" but not the begin.

In summary the logic is same. To have navigation property name as the deep property.