Skip to Content
avatar image
Former Member

Function module VRM_SET_VALUES?

Hello,

Can anybody give me the details about Function module VRM_SET_VALUES?

What is the use of this FM?

Thanks in Advance,

Regards,

LIJO

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 25, 2007 at 12:17 PM

    HI,

    NAME1 is the name of the field.

    data: NAME1 type VRM_ID,

    LIST1 type VRM_VALUES,

    VALUE1 like line of LIST1.

    select * from ZES_RFQ_REJECT into table IT_RFQREJ.

    NAME1 = 'ZES_RFQ_ITEM-REJ_CODE'.

    loop at IT_RFQREJ into IS_RFQREJ.

    VALUE1-KEY = IS_RFQREJ-REJ_CODE.

    append VALUE1 to LIST1.

    clear IS_RFQREJ.

    endloop.

    call function 'VRM_SET_VALUES'

    exporting

    ID = NAME1

    VALUES = LIST1.

    clear LIST1.

    RSDEMO_DROPDOWN_LISTBOX

    <b><REMOVED BY MODERATOR>

    Manish</b>

    Message was edited by:

    Alvaro Tejada Galindo

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2007 at 12:21 PM

    Hi,

    This is to make available some default values to be appearing in the selection screen field as a drop down menu.

    using this FM, the feature can be acctivated for a single field in a selection screen or multiple fields.

    below sample code for reference:

    DATA: lt_list TYPE vrm_values,

    ls_value LIKE LINE OF lt_list.

    REFRESH: lt_list.

    CLEAR: ls_value,

    lt_list.

    ls_value-key = 'Y'.

    ls_value-text = '- All Parts'.

    APPEND ls_value TO lt_list.

    ls_value-key = 'N'.

    ls_value-text = '- Common Parts'.

    APPEND ls_value TO lt_list.

    ls_value-key = 'B'.

    ls_value-text = '- All and Common Parts'.

    APPEND ls_value TO lt_list.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    id = 'P_PART'

    values = lt_list.

    Regards,

    JLN

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2007 at 12:18 PM

    Hi John,

    Basically this FM is used for creating the LIst Box in the i/O field.

    Try this code:

    value-key = 'M'.

    value-text = text-001.

    append value to list.

    value-key = 'F'.

    value-text = text-002.

    append value to list.

    name = 'T_RECORD-PASSSEX'.

    call function 'VRM_SET_VALUES'

    exporting

    id = name

    values = list

    • EXCEPTIONS

    • ID_ILLEGAL_NAME = 1

    • OTHERS = 2

    .

    <b><REMOVED BY MODERATOR></b>

    thanks

    Message was edited by:

    Alvaro Tejada Galindo

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2007 at 12:19 PM

    hi,

    this is the fm for the set the listbox values....

    thanks,

    <b><REMOVED BY MODERATOR></b>

    Message was edited by:

    Alvaro Tejada Galindo

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2007 at 12:22 PM

    Hi lijo,

    Consider that u have placed a dropdown listbox in a screen.

    U have to use this fn mod <b>VRM_SET_VALUES</b> populate the records to the listbox.

    Perfomance wise this fn mod is better.

    <b><REMOVED BY MODERATOR></b>

    Message was edited by:

    Alvaro Tejada Galindo

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 26, 2007 at 05:06 AM

    Hi Lijo,

    Check the below code.

    TYPE-POOLS : vrm. "Value Request Manager

    PARAMETERS: p_test AS LISTBOX VISIBLE LENGTH 12 OBLIGATORY.

    INITIALIZATION.

    PERFORM f4_value_request.

    START-OF-SELECTION.

    WRITE P_TEST.

    &----


    *& Form f4_value_request

    &----


    • text

    ----


    FORM f4_value_request.

    DATA: l_name TYPE vrm_id,

    li_list TYPE vrm_values,

    l_value LIKE LINE OF li_list.

    l_value-key = '1'.

    l_value-text = 'January'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '2'.

    l_value-text = 'February'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '3'.

    l_value-text = 'March'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '4'.

    l_value-text = 'April'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '5'.

    l_value-text = 'May'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '6'.

    l_value-text = 'June'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '7'.

    l_value-text = 'July'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '8'.

    l_value-text = 'August'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '9'.

    l_value-text = 'September'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '10'.

    l_value-text = 'October'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '11'.

    l_value-text = 'November'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_value-key = '12'.

    l_value-text = 'December'.

    APPEND l_value TO li_list.

    CLEAR l_value.

    l_name = 'P_TEST'.

    p_test = '1'. "this is to set the default value of the list box.

    CALL FUNCTION 'VRM_SET_VALUES'

    EXPORTING

    id = l_name

    values = li_list

    EXCEPTIONS

    id_illegal_name = 1

    OTHERS = 2.

    IF sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

    ENDIF.

    ENDFORM. " f4_value_request

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Dear Lijo,

      DATA : lv_name1 TYPE  vrm_id,
              lt_list1 TYPE vrm_values,
              ls_value1 LIKE LINE OF lt_list1 .

      PARAMETERS : field AS LISTBOX VISIBLE LENGTH 100.

      AT SELECTION-SCREEN OUTPUT.
         lv_name1 = 'FIELD'.
         ls_value1-key = 1.
         ls_value1-text = 'List box1'.
         APPEND ls_value1 TO lt_list1.
         ls_value1-text = 'List box2'.
         ls_value1-key = 2.
         APPEND ls_value1 TO lt_list1.


         CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
             id              = lv_name1
             values          = lt_list1
           EXCEPTIONS
             id_illegal_name = 1
             OTHERS          = 2.
         IF sy-subrc <> 0.
      * Implement suitable error handling here
         ENDIF.

      Thanks & Regards,

      buz_sap