cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to use string fields in cds value help

03-18-2025 11:05 AM
saahil1 Associate
1400 views 4 comments
0 Likes
SAP Managed Tags
Labels
CDSFIORIValueHelp
Subscribe

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?


0 Likes

Accepted Solutions (0)

Answers (2)

Answers (2)

junwu
SAP Champion
SAP Champion
0 Likes

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

saahil1
Associate
Associate
0 Likes
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 Likes
there is no magic, when you check metadata, are sure that valuehelp(you said not exposed) is not presented?
filipn
Product and Topic Expert
Product and Topic Expert
0 Likes

There are approximately thousands of value-helps in CDS views delivered by SAP. Find similar ones and get some inspiration…