<?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: enter the value in selection screen's field dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-the-value-in-selection-screen-s-field-dynamically/m-p/5263293#M1215464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sheelesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the following code to achieve your goal :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

TABLES : d020s.
*  Name of the program from which the function module is called
DATA: dyname LIKE d020s-prog VALUE 'TESTPROG',
* Number of the screen, from which the call was made. sy-dynnr can be set here
      dynumb LIKE d020s-dnum VALUE '100'.

DATA: BEGIN OF dynpfields OCCURS 3.
        INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_kunnr.
* Place the code to populate contents for your F4 Value field here.
&amp;lt;...&amp;gt;

* Populate all the fields for which you want default 
* value along with the value in dynpfields internal table.

* Move the screen fileld name in fieldname column.
  MOVE 'G_NAME' TO dynpfields-fieldname.
* Move the field value in fieldvalue column.
  MOVE 'Testtable' TO dynpfields-fieldvalue.
  APPEND dynpfields.

* You can append more screen field names and there values in this internal table.
  
* Call this FM.
  CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
      dyname               = dyname
      dynumb               = dynumb
    TABLES
      dynpfields           = dynpfields
    EXCEPTIONS
      invalid_abapworkarea = 01
      invalid_dynprofield  = 02
      invalid_dynproname   = 03
      invalid_dynpronummer = 04
      invalid_request      = 05
      no_fielddescription  = 06
      undefind_error       = 07.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module should be used in the user-programmed help if one or more screen fields are to be given selected values, e.g. if the values are to be reset after calling HELP_VALUES_GET_WITH_TABLE_EXT. automatic value reset, as performed e.g. by the function module HELP_VALUES_GET_EXTEND, can also be overwritten.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this function module to reset selected help processor field contents in the corresponding screen fields w/o caling PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Screen field contents are read by the function module DYNP_VALUES_READ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ashwani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Mar 2009 09:36:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-03T09:36:04Z</dc:date>
    <item>
      <title>enter the value in selection screen's field dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-the-value-in-selection-screen-s-field-dynamically/m-p/5263290#M1215461</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;I have two parameters on my selection screen, i am taking the value of first parameter from F4 help and now i want to populate the value dynamically in second parameter depending upon the value selected by the user in first parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am using the following code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at selection-screen on value request p_first.&lt;/P&gt;&lt;P&gt;call the FM to get F4 help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at screen.&lt;/P&gt;&lt;P&gt;if screen-name = P_SECOND.&lt;/P&gt;&lt;P&gt;p_scond = desired value.&lt;/P&gt;&lt;P&gt;modify screen.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in adv.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 08:30:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-the-value-in-selection-screen-s-field-dynamically/m-p/5263290#M1215461</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T08:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: enter the value in selection screen's field dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-the-value-in-selection-screen-s-field-dynamically/m-p/5263291#M1215462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To set the value in your dynpro use this FM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DYNP_VALUES_UPDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give me some point if you found usefull my answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 08:43:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-the-value-in-selection-screen-s-field-dynamically/m-p/5263291#M1215462</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T08:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: enter the value in selection screen's field dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-the-value-in-selection-screen-s-field-dynamically/m-p/5263292#M1215463</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;use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;loop at screen.&lt;/P&gt;&lt;P&gt;if screen-name = P_SECOND.&lt;/P&gt;&lt;P&gt;p_scond = desired value.&lt;/P&gt;&lt;P&gt;modify screen.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Akshay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 08:45:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-the-value-in-selection-screen-s-field-dynamically/m-p/5263292#M1215463</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T08:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: enter the value in selection screen's field dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enter-the-value-in-selection-screen-s-field-dynamically/m-p/5263293#M1215464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sheelesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the following code to achieve your goal :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

TABLES : d020s.
*  Name of the program from which the function module is called
DATA: dyname LIKE d020s-prog VALUE 'TESTPROG',
* Number of the screen, from which the call was made. sy-dynnr can be set here
      dynumb LIKE d020s-dnum VALUE '100'.

DATA: BEGIN OF dynpfields OCCURS 3.
        INCLUDE STRUCTURE dynpread.
DATA: END OF dynpfields.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_kunnr.
* Place the code to populate contents for your F4 Value field here.
&amp;lt;...&amp;gt;

* Populate all the fields for which you want default 
* value along with the value in dynpfields internal table.

* Move the screen fileld name in fieldname column.
  MOVE 'G_NAME' TO dynpfields-fieldname.
* Move the field value in fieldvalue column.
  MOVE 'Testtable' TO dynpfields-fieldvalue.
  APPEND dynpfields.

* You can append more screen field names and there values in this internal table.
  
* Call this FM.
  CALL FUNCTION 'DYNP_VALUES_UPDATE'
    EXPORTING
      dyname               = dyname
      dynumb               = dynumb
    TABLES
      dynpfields           = dynpfields
    EXCEPTIONS
      invalid_abapworkarea = 01
      invalid_dynprofield  = 02
      invalid_dynproname   = 03
      invalid_dynpronummer = 04
      invalid_request      = 05
      no_fielddescription  = 06
      undefind_error       = 07.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This function module should be used in the user-programmed help if one or more screen fields are to be given selected values, e.g. if the values are to be reset after calling HELP_VALUES_GET_WITH_TABLE_EXT. automatic value reset, as performed e.g. by the function module HELP_VALUES_GET_EXTEND, can also be overwritten.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use this function module to reset selected help processor field contents in the corresponding screen fields w/o caling PBO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Screen field contents are read by the function module DYNP_VALUES_READ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ashwani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 09:36:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enter-the-value-in-selection-screen-s-field-dynamically/m-p/5263293#M1215464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T09:36:04Z</dc:date>
    </item>
  </channel>
</rss>

