cancel
Showing results for 
Search instead for 
Did you mean: 

Odata Services with Parent and Child relation ship ( Complex type )

0 Kudos

Hi Team,

We have a requirement to create an OData Services with complex type . Structure of this type is as follows

Parent structure

Header name- TESTFR

-------- Table of Child Structure

-------- Vehicle Num : 876787

---------LIC Plate : YUII

Header name - TESTSM

-----TABLE of child structure

End of parent structure.

Please let me know if any one has done this type of requirement.

I tried this with GET_EXPAND_ENTITYSET but I am not getting data in desired format.

Accepted Solutions (0)

Answers (7)

Answers (7)

0 Kudos

Hi,

Do we have any other way to display the structure exactly like this below.

Parent structure

Header name- TESTFR

-------- Table of Child Structure

-------- Vehicle Num : 876787

---------LIC Plate : YUII

Header name - TESTSM

-----TABLE of child structure

End of parent structure.

Regards

Shaik

karanshaheri
Participant
0 Kudos

Hi,

This is the expected output of Gateway Client when you use expanded entityset. It will always display Child entries first and Parent entity details will be displayed at the end.

Regards,

Karan Shaheri.

0 Kudos

Hi Karan,

Please find the screen shot of the output display.

Regards

Shaik.screenshot3.png

karanshaheri
Participant
0 Kudos

Hi,

Where are you checking the data display? Can you provide the screenshot?

Regards,

Karan Shaheri.

0 Kudos

Hi Karan,

I already done that in the same manner, but the data is getting displayed in the reverse way.

Child data is coming above , once child data is completed Parent data is getting displayed.

I need the data to be displayed in parent and child relation ship manner correctly. I don't know what I am missing.

former_member218528
Participant
0 Kudos

Hi Shaik,

Try to display the data in Json format.So the Parent data will be displayed first followed by the child data.

Best Regards,

Rohan

karanshaheri
Participant
0 Kudos

Hi,

You can create one entity for Parent structure and another entity with child structure. Create Association and Navigation from Parent entity to Child entity.

Once association and navigation are done, implement GET_EXPAND_ENTITYSET method to fetch the data.

Regards,

Karan Shaheri.

AshwinDutt
Active Contributor
0 Kudos

Hello,

You can model this type with correct navigation and cardinality between the entities.

But if you want to pass inputs as table then Complex Types cannot be used and is only intended for defining the structures.

Can you share the current model and details on how entities are defined and associated ?

Regards,

Ashwin

0 Kudos

Hi Ashwin,

Please find the Navigation details and the cardinality between the entities and the output I am getting for the get expanded entityset.

screenshot1.png

screenshot2.png

screenshot3.png

Please let me know where I am doing wrong.

Thanks

Shaik