<?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 finding selected value in listbox in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919945#M1484102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im using ''VRM_SET_VALUES'' FM to populate values for listbox in the 'At selection-screen output' event. &lt;/P&gt;&lt;P&gt;I want to know how to find the value which the user selects in the list box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls tell me how to achieve the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Apr 2010 15:25:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-28T15:25:28Z</dc:date>
    <item>
      <title>finding selected value in listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919945#M1484102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im using ''VRM_SET_VALUES'' FM to populate values for listbox in the 'At selection-screen output' event. &lt;/P&gt;&lt;P&gt;I want to know how to find the value which the user selects in the list box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls tell me how to achieve the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 15:25:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919945#M1484102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T15:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: finding selected value in listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919946#M1484103</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;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 CALL FUNCTION 'VRM_SET_VALUES'
  EXPORTING
    id              = 's_list' 
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The value is what is in  variable "s_list" at the moment.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 15:41:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919946#M1484103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T15:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: finding selected value in listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919947#M1484104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Im using ''VRM_SET_VALUES'' FM to populate values for listbox in the 'At selection-screen output' event. &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be using it in the AT SELECTION-SCREEN ON VALUE REQUEST event.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 15:42:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919947#M1484104</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-04-28T15:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: finding selected value in listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919948#M1484105</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;VRM_GET_VALUES will return you the values that is set by the user. The selected value will be in an internal table and you need to read the 1st Index. Have a look at the code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: delimiter type c value '/'.
TYPE-POOLS VRM.
data: VRM_ID TYPE VRM_VALUE-TEXT,
VRM_VALUES TYPE VRM_VALUEs with header line.

vrm_id = 'PO_INFO'.

CALL FUNCTION 'VRM_GET_VALUES'
EXPORTING
ID = vrm_id
IMPORTING
VALUES = vrm_values[]
EXCEPTIONS
ID_NOT_FOUND = 1
OTHERS = 2.

read table vrm_values index 1.

po_info = vrm_values-key. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code will return you all the values for a particular Screen element. You can use the below code snippet to retrieve the value selected by the User.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

  DATA: lc_dyname    LIKE sy-repid.
  DATA: lc_dynumb    LIKE sy-dynnr.
  DATA: ltab_fields  LIKE dynpread OCCURS 0 WITH HEADER LINE.
    ltab_fields-fieldname = 'TB_01'.
  APPEND ltab_fields.

CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname     = lc_dyname
      dynumb     = lc_dynumb
    TABLES
      dynpfields = ltab_fields
    EXCEPTIONS
      OTHERS     = 01.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code snippet will retrieve the particular row information in your PAI event for processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this code snippet will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Samantak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Samantak Chatterjee on Apr 28, 2010 10:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 15:45:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919948#M1484105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T15:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: finding selected value in listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919949#M1484106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi shanthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS:po_list TYPE name1 AS LISTBOX VISIBLE LENGTH 20&lt;/P&gt;&lt;P&gt;                       DEFAULT 'OPTION1' OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN OUTPUT.&lt;/P&gt;&lt;P&gt;  TYPE-POOLS: vrm .&lt;/P&gt;&lt;P&gt;  DATA:&lt;/P&gt;&lt;P&gt;    l_name    TYPE vrm_id,&lt;/P&gt;&lt;P&gt;    li_list   TYPE vrm_values,&lt;/P&gt;&lt;P&gt;    lwa_list  LIKE LINE OF li_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_name = 'PO_LIST'.&lt;/P&gt;&lt;P&gt;  CLEAR lwa_list.&lt;/P&gt;&lt;P&gt;  REFRESH li_list.&lt;/P&gt;&lt;P&gt;  lwa_list-text = lwa_list-key = 'OPTION1'.&lt;/P&gt;&lt;P&gt;  APPEND lwa_list TO li_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR lwa_list.&lt;/P&gt;&lt;P&gt;  lwa_list-text = lwa_list-key = 'OPTION2'.&lt;/P&gt;&lt;P&gt;  APPEND lwa_list TO li_list.&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     = l_name&lt;/P&gt;&lt;P&gt;      values = li_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output will have OPTION1 and OPTION2 in the listbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If OPTION1 is selected in the selection screen then po_list will have value as 'OPTION1'&lt;/P&gt;&lt;P&gt;If OPTION2 is selected in the selection screen then po_list will have value as 'OPTION2'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 15:50:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/finding-selected-value-in-listbox/m-p/6919949#M1484106</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T15:50:20Z</dc:date>
    </item>
  </channel>
</rss>

