cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

I have an analytics datasource which I can fetch with a technical user like this:

https://my12345.sapbydesign.com/sap/byd/odata/analytics/ds/Proprju05.svc/Proprju05?$format=json&$top...

The result looks similar to this example:

{
    "d": {
        "results": [
            {
                "__metadata": {
                    "uri": "https://my12345.sapbydesign.com/sap/byd/odata/analytics/ds/Proprju05.svc/Proprju05('.1~.2~00000000000000000000000000000000')",
                    "type": "Proprju05Svc.Proprju05Type"
                },
                "ID": ".1~.2~00000000000000000000000000000000",
                "C_x1ANxF82c2f26a1d167": "",
                "C_AssiEmpUuid": null,
                "C_BaslSrvspUuid": "00163E04-D815-1ED3-9FA4-E85F332378DC",
                "C_PrResEmpUuid": "00163E02-541F-1EE2-ACFB-16362DD60CEF",
                "C_PrRiskLevel": "",
                "C_PrStatusBlo": false,
                "C_PrStatusLfc": "4",
                "Mdav": "PROBSTB",
                "NodeId": "00163E04D8151ED39FA4E85F333518DC",
                "Count": 1
            }
        ]
    }
}

I would like to query the result list with a filter, like this:

https://my12345.sapbydesign.com/sap/byd/odata/analytics/ds/Proprju05.svc/Proprju05?$format=json&$top... eq 00163E02-541F-1EE2-ACFB-16362DD60CEF

That returns an errors message:

{
    "error": {
        "code": "005056952A631EE0ABDEF9EEC5E1A35A",
        "message": {
            "lang": "en",
            "value": "Property 00163E02-541F-1EE2-ACFB-16362DD60CEF not found in type Proprju05Type"
        }
    }
}

I also tried to put the ID in quotes:

https://my12345.sapbydesign.com/sap/byd/odata/analytics/ds/Proprju05.svc/Proprju05?$format=json&$top... eq '00163E02-541F-1EE2-ACFB-16362DD60CEF'

That returns this error:

{
    "error": {
        "code": "005056952A631ED0B0FE2236FCAB4627",
        "message": {
            "lang": "en",
            "value": "Invalid parametertype used at function 'eq'"
        }
    }
}

What I'm doing wrong?

How can I filter the results by 'C_PrResEmpUuid'?

0 Likes
View Entire Topic
former_member206060
Contributor

Hello Robert,

Please check the report metadata via oData and here is the parameter type for the field you would like to use.

Metadeta oData Query: https://my[your system URL].sapbydesign.com/sap/byd/odata/ana_businessanalytics_analytics.svc/$metadata?entityset=RP[your report ID]QueryResults.
You can also use the Build Odata Queries feature to check the report metadata.

When you check the metadata, please search for the field you used in your link and the parameter type.

  • If it shows Edm.String, the values have to be used in ' '.
  • If it shows Edm.Int64, the values have to be used without the inverted comma in the OData Query.

Please check the below blog which might be helpful for you:-

https://blogs.sap.com/2015/03/10/odata-for-sap-business-bydesign-analytics/

Thanks,

Dhanya

0 Likes

Hi Dhanya,

When I try to query this here:

https://my12345.sapbydesign.com/sap/byd/odata/ana_businessanalytics_analytics.svc/$metadata?entityse...

I'm getting back:

<?xml version="1.0" encoding="utf-8"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <code>00145E5B1CC71EE0ACBD05859C58015A</code>
    <message xml:lang="en">In the context of Data Services an unknown http error occured</message>
</error>
0 Likes

Hi Robert,

can you please check the report ID that you are using in the pattern shared by Dhanya?

There is one data source with ID "Proprju05" (workcenter view Business Analytics -> Design Data Sources), but in my system there are several *reports* (workcenter view Business Analytics -> Design Reports) with different IDs starting with "Proprju05...".

As pointed out by Saurav and Dhanya, the "Build OData Queries" feature is very helpful in both views.

Best regards
Michael