<?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: execute subroutine only when selection parameter changes in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120913#M1187607</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;Pressing Enter is triggering the PAI which is executing AT SELECTION-SCREEN regardless of any condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please include another perform like CHECK_VALUES_ENTERED and if values are not initial, call the PERFORM preselect in AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prosenjit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jan 2009 12:45:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-21T12:45:54Z</dc:date>
    <item>
      <title>execute subroutine only when selection parameter changes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120912#M1187606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ABAP workers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a block of selection parameters, and I created the event &lt;STRONG&gt;AT SELECTION SCREEN ON BLOCK bl1&lt;/STRONG&gt; with a subroutine. I want that subroutine to be executed only when a parameter in the selection block is changed by the user. But the behaviour right now is that it executes every time I press &lt;EM&gt;Enter&lt;/EM&gt;, even if no parameter changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to chieve this (like in the module pool case, with the extension "ON REQUEST")?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;P&gt;Ivson&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code involved:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;PARAMETERS: p_bukrs LIKE csks-bukrs MEMORY ID buk OBLIGATORY,&lt;/P&gt;&lt;P&gt;                         p_ryear LIKE glpct-ryear OBLIGATORY.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_poper  FOR glpct-rpmax,&lt;/P&gt;&lt;P&gt;                              s_racct  FOR glpct-racct,&lt;/P&gt;&lt;P&gt;                              s_kunnr  FOR glpca-kunnr,&lt;/P&gt;&lt;P&gt;                              s_lifnr  FOR glpca-lifnr,&lt;/P&gt;&lt;P&gt;                s_sprctr FOR glpct-sprctr.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK bl1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON BLOCK bl1.&lt;/P&gt;&lt;P&gt;  PERFORM preselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 12:35:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120912#M1187606</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T12:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: execute subroutine only when selection parameter changes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120913#M1187607</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;Pressing Enter is triggering the PAI which is executing AT SELECTION-SCREEN regardless of any condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please include another perform like CHECK_VALUES_ENTERED and if values are not initial, call the PERFORM preselect in AT SELECTION-SCREEN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prosenjit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 12:45:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120913#M1187607</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T12:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: execute subroutine only when selection parameter changes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120914#M1187608</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;U can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR  p_meth1(Screen field).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it'll solve ur problm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 12:46:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120914#M1187608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T12:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: execute subroutine only when selection parameter changes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120915#M1187609</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;You could try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the FM "DYNP_VALUES_READ" to get the contents of that screen parameter and then check for the parameter value inside the subroutine using a IF statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PNAME is a paramter name here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a  dynpfields-fieldname  = 'PNAME'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  append dynpfields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  repid = sy-repid.&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     = repid&lt;/P&gt;&lt;P&gt;            dynumb     = sy-dynnr&lt;/P&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            dynpfields = dynpfields&lt;/P&gt;&lt;P&gt;       exceptions&lt;/P&gt;&lt;P&gt;            others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  read table dynpfields index 1.&lt;/P&gt;&lt;P&gt;  pname = dynpfields-fieldvalue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Process the subroutine if needed based on the check condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subbu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 12:52:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120915#M1187609</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-21T12:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: execute subroutine only when selection parameter changes</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120916#M1187610</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 think you should use an additional variable like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : curr_value like &amp;lt;your_parameter_type&amp;gt;.
..
AT SELECTION-SCREEN ON VALUE-REQUEST FOR &amp;lt;your_parameter&amp;gt;.
if &amp;lt;your_parameter&amp;gt; ne curr_value.
 curr_value = &amp;lt;your_parameter&amp;gt;.
 perform &amp;lt;your_form&amp;gt; using .....
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should works&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2009 12:55:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/execute-subroutine-only-when-selection-parameter-changes/m-p/5120916#M1187610</guid>
      <dc:creator>andrea_galluccio2</dc:creator>
      <dc:date>2009-01-21T12:55:39Z</dc:date>
    </item>
  </channel>
</rss>

