<?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: at selection-screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484521#M226257</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, I guess the reall problem is that you have your parameters reversed in the function call.  You are getting a negative value in the g_no_months.  Swap the parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

call function 'MONTHS_BETWEEN_TWO_DATES'
exporting
&amp;lt;b&amp;gt;i_datum_bis = enddat
i_datum_von = strdat&amp;lt;/b&amp;gt;
* I_KZ_INCL_BIS = ' '
importing
e_monate = g_no_months
.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Aug 2006 17:23:47 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-08-30T17:23:47Z</dc:date>
    <item>
      <title>at selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484519#M226255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friends,&lt;/P&gt;&lt;P&gt;      Could u please send me the details&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: STRDAT LIKE SY-DATUM,&lt;/P&gt;&lt;P&gt;      ENDDAT LIKE SY-DATUM,&lt;/P&gt;&lt;P&gt;      g_NO_MONTHS type i.&lt;/P&gt;&lt;P&gt;      STRDAT = S_IDATU-LOW.&lt;/P&gt;&lt;P&gt;      ENDDAT = S_IDATU-HIGH,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT-OPTIONS:g_IDATU FOR LINV-IDATU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at-selection-screen&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    I_DATUM_BIS         = STRDAT&lt;/P&gt;&lt;P&gt;    I_DATUM_VON         = ENDDAT&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  I_KZ_INCL_BIS       = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   E_MONATE            = g_NO_MONTHS&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF g_no_months not BETWEEN 1 AND 12.&lt;/P&gt;&lt;P&gt;MESSAGE i001(00)  WITH 'ENTERED DATE IS WITHIN RANGE'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;g_timbin_peryr = 12 / g_NO_MONTHS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; the above code purpose is when i enter the dates in seletion option range if the diffrence between the two dates more than the 12 months i need to display the error message.&lt;/P&gt;&lt;P&gt;but here my problem is if the month is in between the 1 and 12 it displaying the Error Message.&lt;/P&gt;&lt;P&gt;Could u please suggest me how to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Siri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 17:17:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484519#M226255</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T17:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: at selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484520#M226256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you want to change like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

&amp;lt;b&amp;gt;if g_no_months &amp;gt; 12.&amp;lt;/b&amp;gt;
MESSAGE i001(00) WITH 'ENTERED DATE IS WITHIN RANGE'.
endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 17:21:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484520#M226256</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-30T17:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: at selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484521#M226257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, I guess the reall problem is that you have your parameters reversed in the function call.  You are getting a negative value in the g_no_months.  Swap the parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

call function 'MONTHS_BETWEEN_TWO_DATES'
exporting
&amp;lt;b&amp;gt;i_datum_bis = enddat
i_datum_von = strdat&amp;lt;/b&amp;gt;
* I_KZ_INCL_BIS = ' '
importing
e_monate = g_no_months
.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 17:23:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484521#M226257</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-30T17:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: at selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484522#M226258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Small correction in ur code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: STRDAT LIKE SY-DATUM,&lt;/P&gt;&lt;P&gt;ENDDAT LIKE SY-DATUM,&lt;/P&gt;&lt;P&gt;g_NO_MONTHS type i.&lt;/P&gt;&lt;P&gt;STRDAT = S_IDATU-LOW.&lt;/P&gt;&lt;P&gt;ENDDAT = S_IDATU-HIGH,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS:g_IDATU FOR LINV-IDATU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at-selection-screen&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;I_DATUM_BIS = STRDAT&lt;/P&gt;&lt;P&gt;I_DATUM_VON = ENDDAT&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I_KZ_INCL_BIS = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;E_MONATE = g_NO_MONTHS&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;if not g_no_months is initial and g_no_months GT 12.&lt;/P&gt;&lt;P&gt;MESSAGE e001(00) WITH 'ENTERED DATE IS WITHIN RANGE'.&lt;/P&gt;&lt;P&gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;g_timbin_peryr = 12 / g_NO_MONTHS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 17:24:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484522#M226258</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T17:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: at selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484523#M226259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Prakash Ramu ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for giving the Replay&lt;/P&gt;&lt;P&gt;but when i used than one the months difference is morthan the 12 it wont displaying any error message it displaying the output&lt;/P&gt;&lt;P&gt;I need to display when the months difference is more than 12 error Message, otherwise i need to display output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plaese suggest me how to do this&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;siri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 17:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484523#M226259</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T17:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: at selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484524#M226260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see my answers above. This is will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You parameters to the function call are backwards, there for the g_no_months is a negative number which is why the error message is not being fired.  You need to change the values that you are passing to the function module around.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;i_datum_bis = enddat   &amp;lt;---- Right here&lt;/P&gt;&lt;P&gt;i_datum_von = strdat   &amp;lt;----- Right here&amp;lt;/b&amp;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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 17:38:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484524#M226260</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-08-30T17:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: at selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484525#M226261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sireesha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try with this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;IF NOT g_no_months IS INITIAL AND ( g_no_months &amp;lt; 1 OR&lt;/P&gt;&lt;P&gt;g_no_months &amp;gt; 12 ).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;MESSAGE i001(00) WITH 'ENTERED DATE IS WITHIN RANGE'.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Plz mark all helpful answers and close the thread once problem is solved. Dont open threads even they were solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 17:40:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484525#M226261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T17:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: at selection-screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484526#M226262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Rich Heilman ,&lt;/P&gt;&lt;P&gt; thanks For given the Reply its working&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;siri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 17:44:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/at-selection-screen/m-p/1484526#M226262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T17:44:02Z</dc:date>
    </item>
  </channel>
</rss>

