Ansicht
Dokumentation

VRM_SET_VALUES - Value request manager: Set a value set for a field

VRM_SET_VALUES - Value request manager: Set a value set for a field

Fill RESBD Structure from EBP Component Structure   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

A call of the function module VRM_SET_VALUES saves the value set VALUES under the name ID.

If the value set is used as the content of a dropdown list box or dropdown combobox (see Screen Painter, field attribute Combobox), the name of the input field must be specified as the name of the value set.

Example

TYPE-POOLS: VRM.
*     The type-pool "VRM" contains the types for the valuesets
DATA: Entryfield(4).
*     The field "Entryfield" will be displayed on the screen
DATA: Possible_Values TYPE VRM_VALUES WITH HEADER LINE.
*     The table "Possible_Values" contains the list of possible values
DATA: Possible_Values_Id TYPE VRM_ID.
*     The field "Possible_Values_Id" contains the name of the valueset
*...
MODULE PBO OUTPUT.
  Possible_Values_Id = 'ENTRYFIELD'.
* Check if valueset already exists
  CALL FUNCTION 'VRM_GET_VALUES'
    EXPORTING  ID = Possible_Values_Id
    EXCEPTIONS ID_NOT_FOUND = 4.

  If sy-subrc = 4.
    Possible_Values-key = 'KEY1'. Possible_Values-Text = '1st item'.
    APPEND Possible_Values.
    Possible_Values-key = 'KEY2'. Possible_Values-Text = '2nd item'.
    APPEND Possible_Values.
    Possible_Values-key = 'KEY3'. Possible_Values-Text = '3rd item'.
    APPEND Possible_Values.
*   ...
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING  ID     = Possible_Values_Id
                 VALUES = Possible_Values[]
      EXCEPTIONS ID_ILLEGAL_NAME = 1.
*   ...
    Entryfield = 'KEY2'.
*   The entry for KEY2 (2nd item) appears as the selected item in the
*   dropdown-list.
  ENDIF.
ENDMODULE.

Notes

It is not usually necessary to call the function module for filling the content of a dropdown list; since the value set is usually derived from the data dictionary (check table, fixed domain values) or is created by calling the module for formatting the special value set (Process on Value Request. Field ... Module ...).

Further information





Parameters

ID
VALUES

Exceptions

ID_ILLEGAL_NAME

Function Group

SVSM

rdisp/max_wprun_time - Maximum work process run time   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 2928 Date: 20240605 Time: 153031     sap01-206 ( 39 ms )