
A token can can be used to assign a value to an attribute. The value entered is validated by the application, and if necessary, a validation text is added. The value is displayed as the token together with the text. The advantage of this is that the key can be validated by the user immediately.
You can find an implementation example in CL_WDR_TEST_SEL_OPT_AUTO_20. The associated application is WDR_TEST_SEL_OPT_AUTO_20. Choose the link "Test Case: Tokenizer".
For some selection scenarios the user must select a value that is not normally shown to the user (for example, a GUID). The user only knows this key under a different number or descriptive text. However, these are not suitable for selections in the database. These attributes can be mapped as tokens with external keys.
In this case, an attribute evaluation consists of three fields:
| Field | Description |
|---|---|
| INTERNAL_KEY | In the data exchange with the application, the internal key is used with methods GET_INPUT_COMPLETE, RESET, and so on. |
| EXTERNAL_KEY | If this is specified, this is the user input for language-dependent keys or GUIDs. In this case, INTERNAL_KEY is never seen by the user. F4 help must return this value. The external key must be unique. |
| DESCRIPTION | Contains the description displayed by the token. |
The internal key is used within the data exchange with the application in structure WDR_SO_S_VALUES. The external key is used only within interface methods IF_WD_SELOPT_20_TOKEN-> VALIDATE_VIA_INT_KEY and IF_WD_SELOPT_20_TOKEN-> VALIDATE_VIA_EXT_KEY. A type description for the external key must be specified in WDR_SO_S_ATTRIBUTE-TOKEN- EXTERNAL_KEY.
String parts cannot be input because the internal key cannot be identified for an incomplete external key. Therefore, operators ( starts_with, contains ) cannot be used.