Skip to Content
avatar image
Former Member

How to hide key values in list box while using 'VRM_SET_VALUES'?

I want to know if there any option not to show key values in the drop down box while using VRM_SET_VALUES

even also the option to show keys in drop down is made on in the GUI.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • Oct 21, 2014 at 07:07 AM

    hi,

    option "Listbox" or "Listbox with key" in screen painter i/o field dropdown attributes has no effect = listbox key will always be displayed, if you have selected "show keys within dropdown lists" in your sapgui visualization settings.


    sap_listbox.jpg (105.1 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Oct 21, 2014 at 08:59 AM

    Whether you see the keys or not is something that is decided by the customizing of your SAPgui.

    I tested it on the example code from Sabyasachi. Switch this flag on and off to test it. This setting affects all dropdowns in the system...


    pastedImage_0.png (11.0 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 06, 2013 at 01:51 PM

    hello,

    dont pass key value into internal table......pass this internal table into VRM_SET_VALUES FM....

    Thanks

    Sabyasachi

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      HELLO SOURAV,

      jst follow my code:

      TYPE-POOLS: VRM.
      PARAMETERS: P_MAT TYPE MATNR VISIBLE LENGTH 10 AS LISTBOX.

      DATA: IT_VRM TYPE VRM_VALUES,
      WA_VRM TYPE VRM_VALUE.


      AT SELECTION-SCREEN OUTPUT.

      WA_VRM-KEY = 'M'.
      WA_VRM-TEXT = 'MALE'.

      APPEND WA_VRM TO IT_VRM.

      WA_VRM-KEY = 'F'.
      WA_VRM-TEXT = 'FEMALE'.

      APPEND WA_VRM TO IT_VRM.


      CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
      ID = 'P_MAT'
      VALUES = IT_VRM
      * EXCEPTIONS
      * ID_ILLEGAL_NAME = 1
      * OTHERS = 2
      .
      IF SY-SUBRC EQ 0.
      * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      CLEAR IT_VRM.
      ENDIF.


      when i execute this in my system, then key value is not displayed......

      Thanks

      Sabyasachi

  • avatar image
    Former Member
    Mar 07, 2013 at 07:39 AM

    Hi Sourav,

    U can do this after set the LISTBOX in Screen Layout.

    Please try it and let me know.

    Thanks

    Tarak


    S1.png (24.0 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 21, 2014 at 07:44 AM

    You can hide key value as per following image:


    Add comment
    10|10000 characters needed characters exceeded