Show TOC

GET_SIMPLE_HELPVALUESLocate this document in the navigation structure

Use

Method GET_SIMPLE_HELPVALUES of service object (RUNTIME->DDIC_UTILS) determines the value list from a simple input help.

You have to specify the importing parameter as the data object from which the list of values should be determined. This data object must have a direct or indirect reference to an elementary Dictionary type (data element or structure field), to which a simple input help (fixed value, check table, search help) is assigned. For example, a reference to a data object with a reference to an elementary component of a dictionary structure ( DATA: var TYPE strucname-compname) or a data object with direct reference to a data element ( DATA:var TYPE dtelname) can be passed.

The method returns the values that are found in a two-column table. The KEY column contains the values and the VALUE column contains the relevant texts. With parameter SORT_VALUES you can control whether the value list is sorted, and if so, how. For example, if a value list with a day number and week day name is sorted by the VALUE column, the following sort order would result: Monday, Friday, Saturday, Sunday, Thursday, Tuesday, Wednesday. So, in this case the KEY column should be used to sort the days of the week in the correct order. If the input help is defined using fixed values, then these are often already defined in the required order and sorting is not necessary.

Features
Parameters and Exceptions
Importing Parameter:
SORT_VALUES Sorting Value List (NO_SORT, BY_VALUE, BY_KEY)
DATA_OBJECT_REF Reference to a data object
Changing Parameter:
HELPVALUE_TAB Value Lists for Data Object
Exceptions:
CX_BSP_SERVICES_PARAM
CX_BSP_SERVICES_NOTFOUND
CX_BSP_SERVICES_SHLP
Example

Page Attribute

Attribute Auto Type

Reference Type Description
airlinelist TYPE SHSVALTAB Available Airlines

Event OnInitialization

data: flight        type        sflight,
      dataref       type ref to data,
      errortext     type        string,
      l_ex_services type ref to cx_bsp_services.

get reference of flight-carrid into dataref.

* get list of available airlines

try.

call method runtime->ddic_utils->get_simple_helpvalues
            exporting data_object_ref = dataref
            changing  helpvalue_tab   = airlinelist.
catch cx_bsp_services into l_ex_services.
*   catch exception into message object
    errortext = l_ex_services->get_text( ).
    call method messages->add_message
         exporting condition = 'AIRLINES'
                   message = errortext
                   severity = CL_BSP_MESSAGES=>CO_SEVERITY_ERROR.

endtry.

            

Layout

<%@page language="abap"%>
<html>
 <head>
  <link rel="stylesheet" href="../../sap/public/bc/bsp/styles/sapbsp.css">
  <title> einfache Wertehilfe aus DDIC </title>
 </head>
<body class="bspBody1">

<% if messages->num_messages( ) = 0.
data: wa type SHSVALSTR. %>
Mit welcher Fluggesellschaft möchten Sie verreisen?
<p>
<select name="AIRLINE">

 <% loop at airlinelist into wa.%>
<option value=" <%=wa-key%"> <%=wa-value%> </option>
<% endloop. %>

</select>

<% else. %>
Es sind leider keine Fluggesellschaften verfügbar
 <% endif. %>

</body>

</html>