cancel
Showing results for 
Search instead for 
Did you mean: 

Find the API to list Incidents List

tuliovargas
Participant
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Jerry_Lowery
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

Jerry_Lowery_0-1708357703752.png

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)

Jerry_Lowery_1-1708357793801.png

I hope it helps

Thank you

Jerry

Answers (0)