cancel
Showing results for 
Search instead for 
Did you mean: 

(Script Engine) Invalid query option: XXXXXXXXXXQuery is not an EntitySet.

07-10-2025 9:09 AM
ManishPant Participant
654 views 1 comments
0 Likes
SAP Managed Tags
Labels
ScriptEngine
Subscribe

Hello Community,

I'm trying to retrieve data from a Semantic View deployed via the HANA Service Layer Script Engine.

The model has been successfully deployed through SAP Business One (SBO), and I can get the expected results when making requests through Postman.

ManishPant_0-1752130941007.png

 

ManishPant_1-1752130951207.png

 

However, when I attempt to access the same data using the Script Engine, it throws an error.

{
    "error": {
        "code": 201,
        "message": {
            "lang": "en-us",
            "value": "Invalid query option: NCRNWMSItemCostQuery is not an EntitySet."
        }
    }
}

Script Engine Code:

    var queryOption = "$filter=contains(BASE_REF, '" + GIDocNum + "')&$select=CalcPrice";
    var costResult = slContext.query("NCRNWMSItemCostQuery", queryOption, false);
 // Check result
    if (!costResult || costResult.toArray().length === 0) {
        return http.response.send(http.HttpStatus.HTTP_BAD_REQUEST, { "error": "No CalcPrice found for base ref " + GIDocNum });
    }
    

I'm wondering if this issue is due to a limitation within SAP or if there's something wrong with my code.

Has anyone encountered a similar problem or found a workaround?

Thank you.

 

0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi @ManishPant ,

The last time we checked, the Service Layer Script Engine (JavaScript Extension) did not support Semantic Layer views.

I don’t believe this has changed since then.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support