Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

7 REPLIES 7

Former Member
0 Kudos

hello,

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

Thanks

Sabyasachi

0 Kudos

Not working.

Can you please give a sample code which ran correctly??

0 Kudos

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

Former Member
0 Kudos

Hi Sourav,

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

Please try it and let me know.

Thanks

Tarak

Zmok
Participant
0 Kudos

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.

Former Member
0 Kudos

You can hide key value as per following image:

Phillip_Morgan
Contributor
0 Kudos

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...