cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to use string fields in cds value help

saahil1
Associate
Associate
0 Kudos
145

I have a CDS entity as value help:

define view entity ZI_CREATEDBY_VH as select from ZI_ORDER
{
key CreatedBy
}

which is used as value help in a projection entity:

define root view entity ZC_ORDER
provider contract transactional_query
as projection on ZI_ORDER
{
key OrderGuid,
@Consumption.valueHelpDefinition: [ {
entity: {
name: 'ZI_ORDER_NAME_VH',
element : 'Name'
}
} ]
@search.fuzzinessThreshold: 0.7
@search.defaultSearchElement: true
OrderName,
...
@Consumption.valueHelpDefinition: [ {
entity: {
name: 'ZC_CREATEDBY_VH',
element : 'CreatedBy'
}
} ]
CreatedBy,
}


CreatedBy type is a data element whose type is string:
Component Type           Data Type
zcreated_by     string


Problem Description:

1. I cannot see Search and Select Tab under the Created By. Only see Define Conditions Tab.Screenshot 2025-03-18 at 11.00.03.png
2. If I attempt to cast String to abap.char(len), I get the following error:
Function CAST: Type STRING of Parameter 1 not supported ( ACCP CHAR CLNT CUKY LANG RAW UNIT NUMC DEC INT1 IN )
Since casting of string to char is not allowed.

Does this mean there is no way to have a value help for string fields?


View Entire Topic
junwu
SAP Champion
SAP Champion
0 Kudos

check if you have exposed the vh cds in your service definition

saahil1
Associate
Associate
0 Kudos
I have another value help, which is also not exposed in the service definition which works. I followed this tutorial for creating VH: https://learning.sap.com/courses/developing-and-extending-sap-fiori-elements-apps/creating-an-object...
junwu
SAP Champion
SAP Champion
0 Kudos
there is no magic, when you check metadata, are sure that valuehelp(you said not exposed) is not presented?