Specifying Attributes for the Selection

Use

With method ADD_ATTRIBUTES you can specify which attributes you want to display for the Select Options.

You can find a table containing all field types in Attribute Types of Select Options.

The consistency of the attributes are checked with method ADD_ATTRIBUTES. If the checks fails, an exception of class CX_WD_GENERAL is raised.

For more information, see Exceptions and Error Messages.

ADD_ATTRIBUTES has the following parameters:

  • ATTRIBUTES (see table)

  • INITIAL_DATA

  • VAR_DATE_ATTRIBUTES

  • RENDER_ONLY_INITIAL_DATA

  • PROPOSED_ROWS

The constants for the attribute types are defined in IF_WD_SELECT_OPTIONS_20=>E_ATTRIBUTE_TYPES.

Procedure

Add the attributes to method ADD_ATTRIBUTES.

The table below describes structure WDR_SO_S_ATTRIBUTES of parameter ATTRIBUTES of method ADD_ATTRIBUTES:

Attribute Name

Attribute Description

ATTRIBUTE

Unique name

ATTR_TYPE

Constants in IF_WD_SELECT_OPTIONS_20=>E_ATTRIBUTE_TYPES

TEXT

Short description of the attribute displayed in the expansion menu.

If no text is specified, the text is taken from the type definition of the attribute. If this is not possible, an error message appears. For attributes of type 'FT' (free text) this text is used as a label.

MANDATORY

The attribute is displayed without a minus sign at the end of the line. A check must be called explicitly with CHECK_MANDATORY().

DISP_INDEX

Sequence of attributes in the dropdown menu (overlayed by MANDATORY, READ_ONLY, and FREE_TEXT fields)

MAX_1_VALUE

A maximum of one line is rendered for this attribute. If, in addition, the operators are restricted to IS/EQUALS, and SUPPRESS_PATTERN_SEARCH is set to ABAP_TRUE, a single-valued parameter is returned.

READ_ONLY

Sets the attribute to write-protected.

It is displayed without a minus sign at the end of the line. The data must be predefined in INITIAL_DATA.

HIDDEN

The attribute is not displayed. Transferred data is read in method GET_INPUT_COMPLETE.

EXCLUDABLE

This attribute appears as an exclusion criterion too.

VALUE_SUGGEST

Standard ValueSuggest function of the Web Dynpro input field

For more information, see Suggested Values for Input Fields.

WD_FORMAT

Format Properties of Web Dynpro Context Attributes

SUPPRESS_PATTERN_SEARCH

The pattern search with operator IS/EQUALS/IS NOT/DOES NOT EQUAL is suppressed. This is expressed in a warning if the user uses * with these operators and with method CONVERT_DATA_INTO_RANGES, where in this case the option EQ/NE is used instead of CP/NP. Operators CONTAINS and STARTS WITH must be suppressed by the application.

DEFAULT_OPERATOR

Default operator displayed in newly rendered lines. This operator should result in a non-valuated line.

INCLUDE_OPERATORS

Operators for attributes that are included in the selection.

If no values are specified, the standard operators for this attribute type are taken. With method CL_WD_SELOP_UTIL_20=>GET_DEFAULT_OPERATOR the default set of operators for a specific attribute type can be read. Constants for the operators are defined in IF_WD_SELECT_OPTIONS_20=>E_OPERATORS.

EXCLUDE_OPERATORS

Operators for EXCLUDE_OPERATORS. If none are specified, the standard operators for this attribute type are taken.

NO_CHECK_ON_OPERATORS

Suppresses the check determining whether default operators are used. The line is rendered the same for all operators. An interval entry and an IS_EMPTY assignment are not possible. The operators cannot be converted into ABAP ranges. Include and exclude operators (if EXCLUDABLE = abap_true) must be filled.

OPERATOR_READ_ONLY

Sets the operator dropdown to read_only.

MULTI_VALUE

Substructure for definition of multi-value fields.

For more information, see Defining Multi-Value Fields.

DATAELEMENT

Type specification using the data element (either DATALEMENT or RTTI_TYPE or REF_TABLE/REF_FIELD); a specfication is not sufficient.

REF_TABLE/REF_FIELD

Type specification using DDIC structure and field (either DATALEMENT or RTTI_TYPE or REF_TABLE/REF_FIELD)

RTTI_TYPE

Type specification using RRTI type (either DATALEMENT or RTTI_TYPE or REF_TABLE/REF_FIELD)

VALUE_SET

Value list for attributes with dropdown menus.

If no value list is set for a dropdown menu, the system tries to ascertain the value list from the domain.

VALUE_HELP_MODE

Standard Web Dynpro value help mode.

The constants are defined in if_wd_context_node_info=>c_value_help_mode.

DDIC_SHLP_NAME

Dictionary search help.

Required for VALUE_HELP_MODE IF_WD_CONTEXT_NODE_INFO=>C_VALUE_HELP_MODE-DDIC

REF_ATTRIBUTE

Name of the reference attribute containing the UNIT or CUKY reference.

This attribute is used only for attributes of type if_wd_select_options_20=>e_attribute_types-curr_quan.

REF_FIELD_TYPE

Reference type for attributes of type if_wd_select_options_20=>e_attribute_types-curr_quan

Constants are either

  • if_wd_context_node_info=>reffieldtype_curr or

  • if_wd_context_node_info=>reffieldtype_quan

If no reference type is specified, it is determined automatically.

WD_VALUE_HELP

Web Dynpro component for Web Dynpro help defined by the application.

INPUT_PROMPT Text for input prompt of a field for the free text search

If you want to display inital values of attributes, specify this with parameter INITIAL_DATA. The structure of parameter INITIAL_DATA is also used in methods GET_INPUT_COMPLETE and GET_INPUT_PER_ATTRIBUTE. The table below describes the structure of INITIAL_DATA:

Field

Description

ATTRIBUTE

Unique name of the attribute

OPERATOR

Operator

LOW

Value in the Low field. Contains the internal value as a string.

HIGH

Value in the High field. Contains the internal value as a string.

MULTI_VALUE

Value in the multi-value field as a data reference

MULTI_VALUE_STRING_TABLE

String table that is displayed in the multi-value field. If no value is specified, the data reference in field MULTI_VALUE is converted into a string table and displayed.

SIGN

I (including)

E (excluding)

ROW_INDEX

Row number of the rendered row.

UNVALUATED_ROW

ABAP_TRUE: Row is not evaluated.

ABAP_FALSE: Row is evaluated.

CUKY

Currency; used for amount/quantity attribute.

UNIT

Unit; used for amount/quantity attribute.

EXT_PRESENTATION

Used only for attributes with range conversion.

For more information, see Properties and Handling Specific Attribute and Field Types.