
Method GET_SIMPLE_HELPVALUES at the service object (RUNTIME->DDIC_UTILS) determines the value list from a simple input help.
You should 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 in a Dictionary structure ( DATA: var TYPE strucname-compname) or a data object with a direct reference to a data element ( DATA: var TYPE dtelname) can be transferred.
The method returns the values that are found in a two-column table. The KEY column containd the values and the VALUE column contains the relevant texts. Using parameter SORT_VALUES it can be controlled if the value list is to be sorted and, if so, how. For example, according to the VALUE column, a value list with a day number and a week day name would produce the following sequence: Tuesday, Thursday, Friday, Wednesday, Monday, Saturday, Sunday. In this case the KEY column should be used for the sort. If the input help is defined using fixed values, then these are often stored in the required order and is a sort is no longer necessary.
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 |
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>