<?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: Selected Value in Dropdown List Box in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119965#M1510987</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Visible length of txt_reason was 30 so the value was no coming in the field. Resolved by extending the visible length.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Jun 2010 14:18:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-06-30T14:18:10Z</dc:date>
    <item>
      <title>Selected Value in Dropdown List Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119961#M1510983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a problem in Dialog Programming. I want to read the DDLB option selected by the user, but am not getting this value in the PAI module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a screen '200' in my program and set it as a 'Modal Dialog Box'. It has got the following elements.&lt;/P&gt;&lt;P&gt;1. LBL_REASON Text&lt;/P&gt;&lt;P&gt;2. TXT_REASON I/O&lt;/P&gt;&lt;P&gt;3. OK_CODE OK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The element TXT_REASON is a 'Listbox with Key'. Additionally, I have declared the elements as follows in the TOP Include.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-POOLs : VRM.&lt;/P&gt;&lt;P&gt;DATA: ok_code TYPE sy-ucomm,&lt;/P&gt;&lt;P&gt;txt_reason TYPE char80. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the PBO, I have set the values in the DDLB as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;set the values in the DDLB&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'VRM_SET_VALUES'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;id = 'TXT_REASON'&lt;/P&gt;&lt;P&gt;values = lt_rsn_code_ip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The passed values are properly available in the DDLB. However, the selected value is not available in the PAI module. The PAI code is given below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: dynpfields like dynpread occurs 1 with header line.&lt;/P&gt;&lt;P&gt;dynpfields-fieldname = 'TXT_REASON' .&lt;/P&gt;&lt;P&gt;append dynpfields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'DYNP_VALUES_READ'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;dyname = sy-cprog "Current program&lt;/P&gt;&lt;P&gt;dynumb = sy-dynnr "Current screen&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;dynpfields = dynpfields "Relevant screen fields&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;others = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE txt_reason TO gv_sel_reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I have made two attempts to get the selected value.&lt;/P&gt;&lt;P&gt;1. Used FM 'DYNP_VALUES_READ' to read the field&lt;/P&gt;&lt;P&gt;2. Tried to access the value of txt_reason &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the internal table dynpfields and the field txt_reason are empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something? Please help.&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;Abhinava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jun 2010 10:50:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119961#M1510983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-29T10:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Value in Dropdown List Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119962#M1510984</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 am not clear wats ur requirment but wat i understood is tat u have a dropdown list with 3 values for eg 1,2 &amp;amp; 3 thne wen u select 2 u want tat 2 in the pai if tat is ur requirement then assign a fcode  to tat field (dropdown field ) in screen painter field attributes .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help u&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jun 2010 11:17:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119962#M1510984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-29T11:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Value in Dropdown List Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119963#M1510985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, you are not missing anything. I made a test, the following code works fine&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPE-POOLS : vrm.
DATA: ok_code TYPE sy-ucomm,
txt_reason TYPE char80.

DATA value_tab TYPE vrm_values WITH HEADER LINE.

CALL SCREEN 100. 

MODULE pbo OUTPUT.

  REFRESH value_tab.
  value_tab-key = '1'.
  value_tab-text = 'TRUE'.
  APPEND value_tab.
  value_tab-key = '0'.
  value_tab-text = 'FALSE'.
  APPEND value_tab.

  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id     = 'TXT_REASON'
      values = value_tab[].

ENDMODULE.                 


MODULE pai INPUT.
  DATA: dynpfields LIKE dynpread OCCURS 1 WITH HEADER LINE.
  dynpfields-fieldname = 'TXT_REASON' .
  APPEND dynpfields.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname     = sy-cprog "Current program
      dynumb     = sy-dynnr "Current screen
    TABLES
      dynpfields = dynpfields "Relevant screen fields
    EXCEPTIONS
      OTHERS     = 0.

 "here field FIELDVALUE of DYNPFIELDS holds value 0 or 1 (key of selected entry)
ENDMODULE.                    
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So it seems very alike to your code. I can only suspect the error comes with screen pbo and pai. Ensure these two are set for this screen modal box. If you use other screen PAI you will not get the values of that field as they simply don't exist there. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as suggested above there is no reason to use DYNP_VALUES_READ as the &lt;EM&gt;txt_reason&lt;/EM&gt; will receive selected value automatically. Make sure that you have corresponding listbox field &lt;EM&gt;txt_reason&lt;/EM&gt; format set to CHAR as well. All the rest will come as standard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also please close duplicating thread &lt;SPAN __jive_macro_name="thread" id="1723127"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jun 2010 11:48:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119963#M1510985</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-06-29T11:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Value in Dropdown List Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119964#M1510986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Visible length of txt_reason was 30 so the value was no coming in the field. Resolved by extending the visible length.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 14:16:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119964#M1510986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-30T14:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Selected Value in Dropdown List Box</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119965#M1510987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Visible length of txt_reason was 30 so the value was no coming in the field. Resolved by extending the visible length.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jun 2010 14:18:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/selected-value-in-dropdown-list-box/m-p/7119965#M1510987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-06-30T14:18:10Z</dc:date>
    </item>
  </channel>
</rss>

