cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP RAP Custom Entity with Parameter not allowed

10-10-2024 5:08 AM
AbhishekSharma Active Contributor
4297 views 6 comments
Subscribe

Hi Gurus,

I have created custom entity and Implemented if_rap_query_provider~select method. Service I created in V4 API.

This custom entity is with NO parameter is working as expected and returning all results.

When I added parameter to this Custom Entity It started giving me below Error ->

Entity 'ZCE_TU_DETAILS': Parameter entity set '$PARAMETER$ZCE_TU_DETAILS' cannot be used for read

CustomEntity.PNG

I do not know how to test or use this Custom Entity with parameter... please help pointing to any documentation or example...

I have followed below documentation:

https://help.sap.com/docs/abap-cloud/abap-rap/using-parameters-in-unmanaged-query?version=sap_btp 

Please help...

@Ramjeekorada @Ramjee_korada 

Thanks-

 

View Entire Topic
Jan-Trcka
Newcomer
0 Likes

Hi,

I'm unsure if this is your situation, but when I created CDS with a parameter and linked it to the Service Binding, it made a new EntitySet.

Example:

I have a CDS named "ZPO_Item" with a parameter for the posting date. In the service binding component, it created a new EntitySet named "ZPO_ItemResults." All my communication needs to go to this EntitySet.

In the metadata there still exists the ZPO_Item EntitySet, but the linked EntityType is with the sap:semantics="parameters" and thus cannot be used for direct requests.

 

DmitriiBalykov
Associate
Associate

Hi there 

I'm sure you have already found the right answer

But in case anyone else gets here after googling the message Entity '&1': Parameter entity set '&2' cannot be used for read

After parametrizing your entity you need to add /Set at the end of the URI

Like, ../SomeName(Par1='value1',Par2='value2') wouldn't work but ../SomeName(Par1='value1',Par2='value2')/Set would

martinc_mb38
Participant
0 Likes
@DmitriiBalykov Thanks, I found this answer too, that you need to add /Set to the end of the URL. What is the rationale behind this? I have two unmanaged queries implemented in exactly the same way, with the exception that one has a parameter, the other does not. The one without parameter works without '/Set', the one with parameter requires '/Set'. It does not make sense.