on 02-15-2024 12:31 AM
Hi experts, I'm trying to use an API/oData to list the incidents similar to what we see in the app UI for incident management in SAP S/4HANA Cloud Public. However, I'm having trouble finding the right API. In the SAP Hub API, I found one called an oData(API_EHS_REPORT_INCIDENT_SRV) which I thought might be the correct one, but I didn't find anything significant from it.
{
"d": {
"results": [
{
"__metadata": {
"id": "https://XXXXXX-api.s4hana.cloud.sap/sap/opu/odata/sap/API_EHS_REPORT_INCIDENT_SRV/C_CurEHSLocationInclRootHier(guid'00000000-0000-0000-0000-000000000000')",
"uri": "https://XXXXXX-api.s4hana.cloud.sap/sap/opu/odata/sap/API_EHS_REPORT_INCIDENT_SRV/C_CurEHSLocationInclRootHier(guid'00000000-0000-0000-0000-000000000000')",
"type": "API_EHS_REPORT_INCIDENT_SRV.C_CurEHSLocationInclRootHierType"
},
"EHSLocationUUID": "00000000-0000-0000-0000-000000000000",
"EHSLocationName": "Locations",
"EHSLocationIDAndName": "",
"EHSLocationID": "",
"EHSLocationTypeText": "",
"EHSLocationStatus": "-1",
"Plant": "",
"MyEHSLocationUUID": "00000000-0000-0000-0000-000000000000",
"EHSParentLocationUUID": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"EHSLocationDrillStateString": "expanded",
"EHSLocationType": "root",
"EHSLocationAuthorizationGroup": "",
"CostCenter": "",
"CompanyCode": "",
"BusinessArea": "",
"EHSLocClassifiersText": "",
"EHSLocHierarchyNodeUUID": "00000000-0000-0000-0000-000000000000",
"EHSLocHierarchyParentNodeUUID": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"HierarchyLevel": 1
}
]
}
}
Later, I noticed that the app actually uses a different API: EHHSS_MANAGE_INCIDENT_SRV/C_ManageIncident
Does this mean I should use the same API, or could there be another one that's more appropriate?
Hi Tulio,
I guess you are looking at the Incident (Get A_Incident) operation?
The try it out on API hub seems to provide a little more info (title, etc). Maybe double check
Beyond that, have you looked at the release CDS Views? Perhaps one is there that works better for you?
If so, you can expose it (or a combination of them) as a custom CDS View exposed as an Odata API. (lots of blogs how to do this)
I hope it helps
Thank you
Jerry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.