Show TOC

 Input Help Values (Method FILL_HELP_VALUES)

Definition

Method FILL_HELP_VALUES is delivered to provide input help values for user interface fields – both for customary input help, which is displayed by selecting F4 , and for drop-down list boxes. In technical terms, comparable functionality is employed to provide both input help options. An overview of drop-down list box functionality is summarized below, along with a contrasting overview of input help functionality.

  • Drop-down list boxes require a data table that contains two columns. In the first column, which is usually invisible on the user interface, all possible key values are stored. The second column, whose entries remain visible in the list box, contains the corresponding descriptive text for each key value located in the first column. As soon as the user selects the appropriate field entry (from the second column) the corresponding key value (from the first column) is stored.

  • Customary input help also requires a data table. However, unlike drop-down list boxes, the corresponding table may contain more than two columns. Thus, one column contains all possible key values for that field, with one (or more) additional column(s) being used to store information that is linked to those key values – including, ideally, at least one column to store descriptive texts for the key values. On the user interface, input help is customarily displayed as a list that consists of two or more columns. By extension, input help not only displays the key values and their descriptive texts, but all other related columns as well. To distinguish the columns (and their respective entries) from one another, column headers are required.

Use

The FILL_HELP_VALUES method enables input help and drop-down list boxes, which ultimately rely on the same data structures, to become interchangeable on the user interface. By extension, a drop-down list box can be represented as input help, provided that column headers are available. Conversely, input help can be represented as a drop-down list box, assuming that two of the columns in the input help are designated to contain the key value and descriptive text, respectively, and provided that no problems arise when information from the remaining columns is omitted from the user interface.

Note Note

Method FILL_HELP_VALUES should always be implemented in a manner that supports both user interface representations. Nonetheless, the technology of the user interface in question, along with the application itself, ultimately determine which of these user interface representations will truly be supported.

Because the de-coupled framework offers generic functionality to provide input help values by evaluating Data Dictionary information, method FILL_HELP_VALUES only requires implementation in fields where the generic functionality is either unsuitable or impossible to apply.

End of the note.

Where method FILL_HELP_VALUES is implemented, the system passes all field names for which input help has been requested through table HELP_VALUES . If the required values can be retrieved by the generic functionality, then all of the following information is provided:

  • DATA , which reflects the table with the input help data.

  • KEYCOLUMNAME , which indicates the name of the column within that table that holds the key values.

  • VALUECOLUMNNAME , which states the name of the column that holds the descriptive texts.

Additional information, summarized below, is passed in parameter FIELD_CATALOGS .

  • The nested table F4HELP_COLUMNS , which contains the names of all columns within the data table, along with corresponding header titles.

The link between entries in HELP_VALUES and FIELD_CATALOGS is established by the corresponding field names; to wit, HELP_VALUES-FIELDNAME equals FIELD_CATALOGS-F4FIELDNAME .

For those fields where the generic functionality is neither suitable nor possible, HELP_VALUES solely contains the field name; all other information remains absent. For this reason, all of the missing information must be provided within the implementation of method FILL_HELP_VALUES . To this end, one must provide a data table, specify the names of the columns that contain key values and descriptive texts in that table, then create a new entry in FIELD_CATALOGS to apprise the data table of the technical names and headers for all columns. As a rule, one should always provide all of the requisite information, as one cannot foresee how the input help will be presented on the user interface.

Furthermore, one must remember always to insert exactly one initial line in the data table; this line is required to permit the user to initialize the field within the user interface. Moreover, the current field value – that is, the value of the field as stored in parameter SCREEN_STRUCTURE – also must be specified in the data table. For this reason, the list of possible field values within the data table must always include the present value of the field.

Caution Caution

If the current value is not included, undesirable effects might result on the user interface; the system might either modify the field value, at random, to an arbitrary value, or issue an error message to report the presence of an invalid field value. Naturally, the technology of the user interface in question would ultimately determine the unexpected system response that would result. Therefore, as recommended above, always be certain to include an initial line in the data table, along with the current field value.

End of the caution.

Moreover, it is worthwhile to note that programmers may modify values that are passed by the generic functionality. Remember that all information passed is merely a proposal for the input help. You are at liberty to modify the entries in the data table, or even to specify a completely different data table, with different columns. Nonetheless, the accuracy and consistency of all input help provided must be guaranteed.

Finally, because input help can vary in accordance with the current field values, remember that the current infotype structure and the current screen structure are passed in parameters PNNNN and SCREEN_STRUCTURE , respectively. Also, where repeat fields are present, method FILL_HELP_VALUES is called separately for each screen structure record. Therefore, different input help can be provided for each such record.

Example

The following source code excerpt demonstrates a sample implementation of the FILL_HELP_VALUES method.

Example Example

METHOD IF_HRPA_UI_CONVERT_STANDARD~FILL_HELP_VALUES. TYPES: t_hrpad00anrex_tab TYPE STANDARD TABLE OF hrpad00anrex. FIELD-SYMBOLS <anred_help_values> TYPE t_hrpad00anrex_tab. DATA anred_help_value TYPE hrpad00anrex. FIELD-SYMBOLS <zhcmt_bsp_pa_xx_r9001> TYPE zhcmt_bsp_pa_xx_r9001. DATA field_catalog_wa TYPE hrpad_help_value_field_cat. DATA f4help_columns TYPE hrpad_f4help_table_column_tab. DATA f4help_column TYPE hrpad_f4help_table_column. FIELD-SYMBOLS: <help_value_wa> TYPE hrpad_help_value_data. * ensure that method is called for the correct screen structure IF screen_structure_name <> 'ZHCMT_BSP_PA_XX_R9001'. RAISE EXCEPTION TYPE cx_hrpa_violated_assertion. ENDIF. * assign and type screen structure ASSIGN screen_structure TO <zhcmt_bsp_pa_xx_r9001>. LOOP AT help_values ASSIGNING <help_value_wa>. CASE <help_value_wa>-fieldname. WHEN 'ANRED'. * specify column names <help_value_wa>-keycolumnname = 'ANRED'. <help_value_wa>-valuecolumnname = 'ANREX'. * create table containing F4-help data CREATE DATA <help_value_wa>-data TYPE STANDARD TABLE OF hrpad00anrex. ASSIGN <help_value_wa>-data->* TO <anred_help_values>. * create help value for "Mr . " CLEAR anred_help_value. anred_help_value-anred = 1. anred_help_value-anrex = 'Mr.'. "use text-symbol instead APPEND anred_help_value TO <anred_help_values>. * create help value for " M s . " CLEAR anred_help_value. anred_help_value-anred = 2. anred_help_value-anrex = 'Ms.'. "use text-symbol instead APPEND anred_help_value TO <anred_help_values>. * append the current value (if not yet in the list) IF NOT <zhcmt_bsp_pa_xx_r9001>-anred IS INITIAL. READ TABLE <anred_help_values> TRANSPORTING NO FIELDS WITH KEY anred = <zhcmt_bsp_pa_xx_r9001>-anred. IF sy-subrc <> 0. CLEAR anred_help_value. anred_help_value-anred = <zhcmt_bsp_pa_xx_r9001>-anred. anred_help_value-anrex = '???'. APPEND anred_help_value TO <anred_help_values>. ENDIF. ENDIF. * append the initial value APPEND INITIAL LINE TO <anred_help_values>. * create field catalog entry CLEAR field_catalog_wa. field_catalog_wa-f4fieldname = <help_value_wa>-fieldname. * create info about column ANRED containing the key value CLEAR f4help_column. f4help_column-fieldname = 'ANRED'. f4help_column-headertitle = 'Key'. "use text-symbol instead APPEND f4help_column TO f4help_columns. * create info about column ANREX containing the descriptive text CLEAR f4help_column. f4help_column-fieldname = 'ANREX'. f4help_column-headertitle = 'Form of address'. "use text-symbol instead APPEND f4help_column TO f4help_columns. field_catalog_wa-f4help_columns = f4help_columns. APPEND field_catalog_wa TO field_catalogs. ENDCASE. ENDLOOP. ENDMETHOD.

End of the example.