cancel
Showing results for 
Search instead for 
Did you mean: 

SAP RAP create input value help only

Former Member
0 Kudos

Hi,

For SAPUI5 applications I often use the option valueHelpOnly="true" if an input field can only have the content of a ValueHelp. Is there such a possibility also for SAP RAP applications?

regards,

Tim

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member14709
Contributor
0 Kudos

Hello Tim,

Yes, this is possible in RAP based applications using consumption annotations. You can use below annotation to have an input field only the content from Value Help.

Consumption.valueHelpDefinition.useForValidation

It accepts boolean values

You can read more about this annotation in below documentation:

https://help.sap.com/docs/SAP_S4HANA_CLOUD/e5522a8a7b174979913c99268bc03f1a/0addf879b42e4aa2824f6308...

Hope this helps.

Former Member
0 Kudos

How I use it? I added it but in the input field I can still insert anything I want...

@Consumption.valueHelpDefinition: [ { entity: { name: 'ZI_USER', element: 'bname' }, useForValidation: true } ]

former_member14709
Contributor

Hi Tim,

You are using it correctly. You can enter anything but wont be able to save value which is not part of Value Help. So on save you would get the error.

Thanks,

Aman Garg

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

The data is validated such that the UI sends a read request to the backend using the value you entered as a key. When the value is not available the request fails and the errornous entry will be highlighted as errornous.

Former Member
0 Kudos

Aman and Andre,

I thought so too. But unfortunately it does not work. I can still enter everything and also save.

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Which release are you working on ?

SAP S/4HANA 2022, 2021, ... ?

SAP BTP ABAP Environment ?

Former Member
0 Kudos

SAP S/4HANA 2022 ON PREMISE

Former Member
0 Kudos

The annotation and thus the triggering of an error message if the entered value does not match one in the ValueHelp only works in conjunction with another input field....

In my case, I have a mandatory date field. If I enter the date, I can also enter any text in the other field. If I leave the date empty and enter a text, it will be checked against the ValueHelp.

How does this behavior come about?

Former Member
0 Kudos

Someone an idea?