<?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 Re: Getting selected value from Listbox in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356277#M1037162</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Balu for your advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I guess, I didn't explain myself clearly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem wasn't that I couldn't show the appropiate value on the screen. I needed to show 'S' or 'N', but when I was working with the value selected (S or N), in the field was stored 1 or 2, and I needed the S or N.&lt;/P&gt;&lt;P&gt;But you gave me a good idea (and that was a doubt I had). I changed the code for something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR values2.&lt;/P&gt;&lt;P&gt;value2-key = 'N'.&lt;/P&gt;&lt;P&gt;value2-text = 'N'.&lt;/P&gt;&lt;P&gt;APPEND value2 TO values2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value2-key = 'S'.&lt;/P&gt;&lt;P&gt;value2-text = 'S'.&lt;/P&gt;&lt;P&gt;APPEND value2 TO values2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using value-key to store also the value-text, and when I read the value selected I get the S or the N.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, thanks very much &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; I learned so much with the posts that I've found at the SDN.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Oct 2008 19:26:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-10-22T19:26:06Z</dc:date>
    <item>
      <title>Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356267#M1037152</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;I have populated my listbox on the selection screen using the function module VRM_SET_VALUES. &lt;/P&gt;&lt;P&gt;How do I get the value which is selected from the list box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where is the selected value in the listbox stored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 17:55:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356267#M1037152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T17:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356268#M1037153</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;This thread answers solves your issue -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="970780"&gt;&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Pls check these links on the usage of this FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="956929"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap.niraj.tripod.com/id38.html" target="test_blank"&gt;http://sap.niraj.tripod.com/id38.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5596304"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Lekha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 17:58:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356268#M1037153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T17:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356269#M1037154</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;there will be a screen field associated with list box rite, that screen field will hold the selected value from drop down&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 18:15:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356269#M1037154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T18:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356270#M1037155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The screen field doesn't hold any value for the selected field. It is blank.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 18:16:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356270#M1037155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T18:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356271#M1037156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can u copy paste the code used to call FM- VRM_SET_VALUES&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 18:21:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356271#M1037156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T18:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356272#M1037157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code I used is:&lt;/P&gt;&lt;P&gt;Another issue is that whenever I select any value in the listbox it is not displayed on the screen. It becomes blank again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS:  p_prin  AS LISTBOX VISIBLE LENGTH 30 USER-COMMAND sele.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: i_printers TYPE STANDARD TABLE OF frprlist,&lt;/P&gt;&lt;P&gt;        wa_printers TYPE frprlist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_name  TYPE         vrm_id,&lt;/P&gt;&lt;P&gt;        i_list  TYPE         vrm_values,&lt;/P&gt;&lt;P&gt;        l_ctr   TYPE         i VALUE 0,&lt;/P&gt;&lt;P&gt;        wa_value LIKE LINE OF i_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR: wa_value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get printers&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'RSPO_FRONTEND_PRINTERS_FOR_DEV'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      device         = p_print&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      list           = i_printers&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      no_list        = 1&lt;/P&gt;&lt;P&gt;      list_truncated = 2&lt;/P&gt;&lt;P&gt;      name_not_found = 3&lt;/P&gt;&lt;P&gt;      OTHERS         = 4.&lt;/P&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Populate to drop down box&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    l_name = c_prin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT i_printers INTO wa_printers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      l_ctr = l_ctr + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      wa_value-key = l_ctr.&lt;/P&gt;&lt;P&gt;      wa_value-text = wa_printers-prname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      APPEND wa_value TO i_list.&lt;/P&gt;&lt;P&gt;      CLEAR wa_value.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&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          = i_list&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;    IF sy-subrc NE 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do nothing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR: l_name, l_ctr, wa_value, i_list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 18:28:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356272#M1037157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T18:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356273#M1037158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pass&lt;/P&gt;&lt;P&gt;l_name = p_prin&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 18:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356273#M1037158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-25T18:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356274#M1037159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ID parameter of the FM VRM_SET_VALUES should contain the name of the field on which you have created list box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
l_name = 'P_PRIN'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Aug 2008 18:39:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356274#M1037159</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2008-08-25T18:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356275#M1037160</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 several list box on my screen without any problem, except that I don't know how to get the selected value from list box (the name of this post)&lt;/P&gt;&lt;P&gt;When I select a value from the list box, what I get it's the value-key, and I need the value-text... How can I get it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;  CLEAR values2.&lt;/P&gt;&lt;P&gt;  value2-key  = '1'.&lt;/P&gt;&lt;P&gt;  value2-text = 'E'.&lt;/P&gt;&lt;P&gt;  APPEND value2 TO values2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  value2-key  = '2'.&lt;/P&gt;&lt;P&gt;  value2-text = 'S'.&lt;/P&gt;&lt;P&gt;  APPEND value2 TO values2.&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     = 'TBI_DIRECCION_TEM-DS_ORIENT_VIA'&lt;/P&gt;&lt;P&gt;      values = values2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the program, when I need to get the value, I've found that the field &lt;EM&gt;TBI_DIRECCION_TEM-DS_ORIENT_VIA&lt;/EM&gt; has the value &lt;EM&gt;'2'&lt;/EM&gt; (corresponding to the value-key), and not &lt;EM&gt;'S'&lt;/EM&gt; (corresponding to the value-text, that's what I need)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I get it?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Carolina &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 16:36:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356275#M1037160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T16:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356276#M1037161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carolina,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hearty welcome to SDN.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please go through the site fully so that you can have better idea on how much SDN can help you. Please do give some time to search for some time in SDN before posting any query. Hope you follow from now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make the changes in the code as i have shown..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR values2.&lt;/P&gt;&lt;P&gt;value2-key = 'E'.&lt;/P&gt;&lt;P&gt;value2-text = '1'.&lt;/P&gt;&lt;P&gt;APPEND value2 TO values2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value2-key = 'S'.&lt;/P&gt;&lt;P&gt;value2-text = '2'.&lt;/P&gt;&lt;P&gt;APPEND value2 TO values2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!!&lt;/P&gt;&lt;P&gt;Balu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Balu CH on Oct 22, 2008 10:24 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 16:54:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356276#M1037161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T16:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Getting selected value from Listbox</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356277#M1037162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Balu for your advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I guess, I didn't explain myself clearly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem wasn't that I couldn't show the appropiate value on the screen. I needed to show 'S' or 'N', but when I was working with the value selected (S or N), in the field was stored 1 or 2, and I needed the S or N.&lt;/P&gt;&lt;P&gt;But you gave me a good idea (and that was a doubt I had). I changed the code for something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR values2.&lt;/P&gt;&lt;P&gt;value2-key = 'N'.&lt;/P&gt;&lt;P&gt;value2-text = 'N'.&lt;/P&gt;&lt;P&gt;APPEND value2 TO values2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value2-key = 'S'.&lt;/P&gt;&lt;P&gt;value2-text = 'S'.&lt;/P&gt;&lt;P&gt;APPEND value2 TO values2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using value-key to store also the value-text, and when I read the value selected I get the S or the N.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, thanks very much &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; I learned so much with the posts that I've found at the SDN.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 19:26:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/getting-selected-value-from-listbox/m-p/4356277#M1037162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-10-22T19:26:06Z</dc:date>
    </item>
  </channel>
</rss>

