<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic List Boxes on a Selection Screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124926#M109984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a list box on the selection screen. In the At Selection Screen Output, I filled the List box with 12 Values.&lt;/P&gt;&lt;P&gt;Now, I want to default the List box value with one of those values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, after the CALL FM 'VRM_SET_VALUES', I say p_field = 'Value'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this Value is being shown in the Drop down list twice.&lt;/P&gt;&lt;P&gt;I could not understand the mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Suryakiran D.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Feb 2006 12:35:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-07T12:35:55Z</dc:date>
    <item>
      <title>List Boxes on a Selection Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124926#M109984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a list box on the selection screen. In the At Selection Screen Output, I filled the List box with 12 Values.&lt;/P&gt;&lt;P&gt;Now, I want to default the List box value with one of those values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, after the CALL FM 'VRM_SET_VALUES', I say p_field = 'Value'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this Value is being shown in the Drop down list twice.&lt;/P&gt;&lt;P&gt;I could not understand the mistake.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Suryakiran D.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2006 12:35:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124926#M109984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-07T12:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: List Boxes on a Selection Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124927#M109985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi suryakiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Its happening bcos&lt;/P&gt;&lt;P&gt;   u must be giving NAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. give p_field  = Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ie. 1 for Jan&lt;/P&gt;&lt;P&gt;        2 for Feb etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;in the FM VRM_SET_VALUES&lt;/P&gt;&lt;P&gt;we are filling the parameter VALUES&lt;/P&gt;&lt;P&gt;VALUES-key&lt;/P&gt;&lt;P&gt;VALUES-TEXT&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;so, give KEY, (and not text)&lt;/P&gt;&lt;P&gt;after calling this FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. &lt;/P&gt;&lt;P&gt;REPORT abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS : vrm.&lt;/P&gt;&lt;P&gt;DATA : v TYPE vrm_values.&lt;/P&gt;&lt;P&gt;DATA : vw LIKE LINE OF v.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS : a(10) TYPE c AS LISTBOX VISIBLE LENGTH 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vw-key = '1'.&lt;/P&gt;&lt;P&gt;vw-text = 'Jan'.&lt;/P&gt;&lt;P&gt;APPEND vw TO v.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'VRM_SET_VALUES'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      id              = 'A'&lt;/P&gt;&lt;P&gt;      values          = v&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      id_illegal_name = 1&lt;/P&gt;&lt;P&gt;      OTHERS          = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      a = '1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; Problem&lt;/P&gt;&lt;P&gt;      a = 'Jan'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Amit Mittal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2006 12:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124927#M109985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-07T12:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: List Boxes on a Selection Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124928#M109986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in the initialization event just pass the value to be defaulted to the parameter .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters: p_obj(2) as listbox visible length 50 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;initialization .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_obj = 'G' . " the key of the entry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2006 12:43:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124928#M109986</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-02-07T12:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: List Boxes on a Selection Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124929#M109987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is you have added the values in the list box using the VRM_set_values so the list box contains all the values even the value which your assign currently. that's why it is displaying twice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2006 12:46:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124929#M109987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-07T12:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: List Boxes on a Selection Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124930#M109988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Surya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; checkout the example code..,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   PROGRAM zcmtest01. &lt;/P&gt;&lt;P&gt; TYPE-POOLS: vrm. &lt;/P&gt;&lt;P&gt; DATA: name TYPE vrm_id, &lt;/P&gt;&lt;P&gt;       list TYPE vrm_values, &lt;/P&gt;&lt;P&gt;       value LIKE LINE OF list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: ps_parm(10) AS LISTBOX VISIBLE LENGTH 10.&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN OUTPUT. &lt;/P&gt;&lt;P&gt;  name = 'PS_PARM'. &lt;/P&gt;&lt;P&gt;  value-key = '1'.&lt;/P&gt;&lt;P&gt;  value-text = 'Line 1'.&lt;/P&gt;&lt;P&gt;  APPEND value TO list.&lt;/P&gt;&lt;P&gt;  value-key = '2'. &lt;/P&gt;&lt;P&gt;  value-text = 'Line 2'.&lt;/P&gt;&lt;P&gt;  APPEND value TO list. &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'VRM_SET_VALUES' &lt;/P&gt;&lt;P&gt;    EXPORTING id     = name &lt;/P&gt;&lt;P&gt;              values = list. &lt;/P&gt;&lt;P&gt;              &lt;/P&gt;&lt;P&gt;START-OF-SELECTION. &lt;/P&gt;&lt;P&gt;  WRITE: / 'Parameter:', ps_parm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Vinoth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2006 12:47:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124930#M109988</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-07T12:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: List Boxes on a Selection Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124931#M109989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this code..&lt;/P&gt;&lt;P&gt;copy paste it and see...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ZTEST_CODE_VRM.

TYPE-POOLS: VRM.

TYPES: NAME TYPE VRM_VALUE-TEXT.
DATA: V_VBELN LIKE VBAK-VBELN.
DATA: IT_VALUES TYPE STANDARD TABLE OF VRM_VALUE.
DATA: WA TYPE VRM_VALUE.
TABLES: KNA1.

SELECT-OPTIONS: S_VBELN FOR V_VBELN.
PARAMETERS: P_KUNNR AS CHECKBOX USER-COMMAND ABC.
PARAMETERS: P_CHK1 AS CHECKBOX USER-COMMAND ABC.
PARAMETERS: P_KUNNR1 TYPE NAME AS LISTBOX VISIBLE LENGTH 30.

INITIALIZATION.
  S_VBELN-LOW = '123'.
  APPEND S_VBELN.

  WA-KEY = '1'.
  WA-TEXT = 'One'.
  APPEND WA TO IT_VALUES.
  CLEAR WA.

  WA-KEY = '2'.
  WA-TEXT = 'Two'.
  APPEND WA TO IT_VALUES.
  CLEAR WA.
  READ TABLE IT_VALUES INTO WA INDEX 1.
  P_KUNNR1 = WA-KEY.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      ID              = 'P_KUNNR1'
      VALUES          = IT_VALUES
    EXCEPTIONS
      ID_ILLEGAL_NAME = 1
      OTHERS          = 2.
  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.



AT SELECTION-SCREEN.
  CLEAR S_VBELN.
  REFRESH S_VBELN.
  S_VBELN-LOW = '456'.
  APPEND S_VBELN.


AT SELECTION-SCREEN ON P_KUNNR.
* This event should fire only only for parameters not for select options
  P_KUNNR = 'X'.

*
AT SELECTION-SCREEN OUTPUT.

  IF P_KUNNR = 'X'.
    P_KUNNR = ' '.
  ENDIF.
  IF P_CHK1 = ' '.
    P_CHK1 = 'X'.
  ELSE.
    P_CHK1 = ' '.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2006 12:52:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124931#M109989</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-07T12:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: List Boxes on a Selection Screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124932#M109990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;At the time of populating the values, populate all the values except the one you want to set as default.&lt;/P&gt;&lt;P&gt;Then Call the FM with p_field = 'value', where 'value' is your default string that is displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sunil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2006 05:09:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/list-boxes-on-a-selection-screen/m-p/1124932#M109990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-08T05:09:51Z</dc:date>
    </item>
  </channel>
</rss>

