I have seen this question raised a couple of times in the Web Dynpro ABAP community,
How can a developer prevent the user from manually typing a value into an InputField, and instead force the user to use the field's search help to enter a value?
It is possible to achieve this scenario with a little slight-of-hand on the view.
In the component controller, create a 1..1 context node named FLIGHT with a single attribute CARRID of type SFLIGHT-CARRID, then map context node FLIGHT to the view's context.
Here comes the slight-of-hand. Instead of using one InputFIeld, we use two, one which is read-only and echoes the user's search help selection and another which is invisible to the user but contributes its search help functionality to the view.
Because we have given INPUT_FIELD a width of zero pixels, the field itself is invisible to the user, and the user is prevented from manually typing a value into the field. However, INPUT_FIELD's search help is still visible to the user, and the user may use the search help to select a value. Because READ_ONLY_FIELD is bound to the same context attribute as INPUT_FIELD, it will display the value selected from the search help.
It will appear to the user that there is only a single field on the view. Because that field is read-only, the user is forced to use the search help to enter a value into the field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |