Hello @Shahtaj Khalid ,
You have to create TypeDefs to achieve that hierarchical view and define relationshipAttributes for the view to populate.
- Create Custom Typedefs to define "views". for example, see below "sap_s4hana_view"
- Create entities and their relationships (which you have already done).
- Update the relationshipAttributes between entities, for example: {
"guid": "f015792f-3ca3-408c-bf1b-97f6f6f60004",
"typeName": "sap_s4hana_view_field",
"entityStatus": "ACTIVE",
"displayText": "PLANNR",
"relationshipType": "sap_s4hana_view_view_fields",
"relationshipGuid": "1c26a7cc-def6-4221-821c-3ed44f422072",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "sap_s4hana_view_view_fields"
}
One example of a hierarchical view : {
"typeName": "sap_s4hana_view",
"attributes": {
"owner": null,
"viewStatement": "Select "/SAPAPO/LVIEW"."MANDT", "/SAPAPO/LVIEW"."LVIEW", "/SAPAPO/LVIEW"."SCOPE", "/SAPAPO/LVIEW"."APPLC", "/SAPAPO/PLAN"."PLANNR" \n from "/SAPAPO/LVIEW", "/SAPAPO/PLAN" where "/SAPAPO/LVIEW"."MANDT" EQ "/SAPAPO/PLAN"."MANDT" AND\n"/SAPAPO/LVIEW"."SCOPE" EQ "/SAPAPO/PLAN"."PLANID" \n",
"replicatedTo": null,
"userDescription": null,
"replicatedFrom": null,
"qualifiedName": "sap_s4hana://vhcals4hci_S4H_00_100//SAPAPO/V_LVIEWP",
"displayName": null,
"name": "/SAPAPO/V_LVIEWP",
"viewType": "DatabaseView",
"description": "PPM help view"
},
"lastModifiedTS": "1",
"guid": "f015792f-3ca3-408c-bf1b-97f6f6f60000",
"isIncomplete": false,
"status": "ACTIVE",
"createdBy": "ServiceAdmin",
"updatedBy": "ServiceAdmin",
"createTime": 1641430469845,
"updateTime": 1641430469845,
"version": 0,
"source": "DataScan",
"sourceDetails": {
"__schemaModifiedBy": "DataScan",
"__schemaModifiedTime": 1641430469845
},
"relationshipAttributes": {
"schema": [],
"package": {
"guid": "2860a4bc-90f4-49ae-a1d0-b2ad42637db6",
"typeName": "sap_s4hana_package",
"entityStatus": "ACTIVE",
"displayText": "/SAPAPO/SCC",
"relationshipType": "sap_s4hana_package_views",
"relationshipGuid": "0b7dc4b2-a768-469a-8a6f-e85682d9e503",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "sap_s4hana_package_views"
}
},
"dependencies_of_programs": [],
"dependencies_of_class": [],
"dependencies_of_function_groups": [],
"view_fields": [
{
"guid": "f015792f-3ca3-408c-bf1b-97f6f6f60001",
"typeName": "sap_s4hana_view_field",
"entityStatus": "ACTIVE",
"displayText": "MANDT",
"relationshipType": "sap_s4hana_view_view_fields",
"relationshipGuid": "ec2b2db4-ae03-4e8e-80e9-7412e87fd431",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "sap_s4hana_view_view_fields"
}
},
{
"guid": "f015792f-3ca3-408c-bf1b-97f6f6f60002",
"typeName": "sap_s4hana_view_field",
"entityStatus": "ACTIVE",
"displayText": "LVIEW",
"relationshipType": "sap_s4hana_view_view_fields",
"relationshipGuid": "ba2ada59-c4b4-4b41-ae3d-a161da654e37",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "sap_s4hana_view_view_fields"
}
},
{
"guid": "f015792f-3ca3-408c-bf1b-97f6f6f60005",
"typeName": "sap_s4hana_view_field",
"entityStatus": "ACTIVE",
"displayText": "SCOPE",
"relationshipType": "sap_s4hana_view_view_fields",
"relationshipGuid": "5633562a-40bb-4e8c-9cc3-0769e62424e1",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "sap_s4hana_view_view_fields"
}
},
{
"guid": "f015792f-3ca3-408c-bf1b-97f6f6f60003",
"typeName": "sap_s4hana_view_field",
"entityStatus": "ACTIVE",
"displayText": "APPLC",
"relationshipType": "sap_s4hana_view_view_fields",
"relationshipGuid": "099e7277-1661-4c8b-ad6d-8c9c5fc7071f",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "sap_s4hana_view_view_fields"
}
},
{
"guid": "f015792f-3ca3-408c-bf1b-97f6f6f60004",
"typeName": "sap_s4hana_view_field",
"entityStatus": "ACTIVE",
"displayText": "PLANNR",
"relationshipType": "sap_s4hana_view_view_fields",
"relationshipGuid": "1c26a7cc-def6-4221-821c-3ed44f422072",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "sap_s4hana_view_view_fields"
}
}
],
"attachedSchema": [],
"meanings": [],
"view_query": {
"guid": "b05caf20-369e-4ce5-888e-5dcad757c29c",
"typeName": "sap_s4hana_view_query",
"entityStatus": "ACTIVE",
"displayText": "query",
"relationshipType": "sap_s4hana_view_view_query",
"relationshipGuid": "82adb34a-b16a-416d-8721-b3194a2d9e7c",
"relationshipStatus": "ACTIVE",
"relationshipAttributes": {
"typeName": "sap_s4hana_view_view_query"
}
}
},
"labels": []
}
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on or upvote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators