<?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: Setting default date range in selection screen when executing as batch job. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456237#M830409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinod,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would suggest you to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create two parameters : p_start_date and p_end_date of type sy-datum on your selection screen , instead of a range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now goto create a variant from SE38 for the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While creating the variant, mark the "Selection Variable" checkbox for the two parameters and click on "Selection Variables".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select the option "D: Dynamic date calculation" for both the date fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For p_start_date - select the option "Current Date"&lt;/P&gt;&lt;P&gt;For p_end_date  - select the option "Current date +/- ??? days" and put 7 in the pop up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence what you have done now is, set up a dynamic variant, where p_start_date will have sy-datum and p_end_date will have sy-datum + 7, everytime the job runs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, in the program, first step after START-OF-SELECTION code the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
RANGES: r_date FOR sy-datum.
start-of-selection.
refresh r_date.
r_date-sign = 'I'. r_date-option = 'BT'.
r_date-low = p_start_date. r_date-high = p_end_date.
append r_date.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence this way, you would have built your range and use it as needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Feb 2008 07:30:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-22T07:30:35Z</dc:date>
    <item>
      <title>Setting default date range in selection screen when executing as batch job.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456236#M830408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I have one report to be scheduled as weekly batch job and one of the selection screen field is date range. If i set this report to run today then the date range will be from one week back date(Lower value) to today date(Higher value). When it runs for next week(Already scheduled as weekly batch job) the date range should be like this&lt;/P&gt;&lt;P&gt;Lower value = today date&lt;/P&gt;&lt;P&gt;higher value= next week run date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i achieve this functionality. Is it possible through Dynamic variant concept?. Rest of the selection screen fields have some default values and should not change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Feb 22, 2008 3:52 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2008 07:15:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456236#M830408</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2008-02-22T07:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Setting default date range in selection screen when executing as batch job.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456237#M830409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vinod,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would suggest you to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create two parameters : p_start_date and p_end_date of type sy-datum on your selection screen , instead of a range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now goto create a variant from SE38 for the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While creating the variant, mark the "Selection Variable" checkbox for the two parameters and click on "Selection Variables".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select the option "D: Dynamic date calculation" for both the date fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For p_start_date - select the option "Current Date"&lt;/P&gt;&lt;P&gt;For p_end_date  - select the option "Current date +/- ??? days" and put 7 in the pop up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence what you have done now is, set up a dynamic variant, where p_start_date will have sy-datum and p_end_date will have sy-datum + 7, everytime the job runs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, in the program, first step after START-OF-SELECTION code the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
RANGES: r_date FOR sy-datum.
start-of-selection.
refresh r_date.
r_date-sign = 'I'. r_date-option = 'BT'.
r_date-low = p_start_date. r_date-high = p_end_date.
append r_date.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence this way, you would have built your range and use it as needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2008 07:30:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456237#M830409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-22T07:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Setting default date range in selection screen when executing as batch job.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456238#M830410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ya u can do it using variant............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goto the variant,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for that select-option click the F4 help on &lt;STRONG&gt;selection variable&lt;/STRONG&gt; field and select &lt;STRONG&gt;D&lt;/STRONG&gt;.....click the F4 help on &lt;STRONG&gt;name of variable&lt;/STRONG&gt; field and &lt;STRONG&gt;Current date +/- ??? days&lt;/STRONG&gt;  and do as u wish......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in SM36 while scheduling give this variant name with program...............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;jose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2008 07:32:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456238#M830410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-22T07:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Setting default date range in selection screen when executing as batch job.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456239#M830411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using "Current date - xxx,current date + yyy" option in the Dynamic date calculation while saving the variant. I think this should solve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that does not work, create a variable in TVARVC table and try using the same variable while saving the variant. You can update the variable with the required values during INITIALIZATION Event of your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2008 09:37:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456239#M830411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-22T09:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Setting default date range in selection screen when executing as batch job.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456240#M830412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp; data: 3mdate type datum. &lt;BR /&gt;call function 'RP_CALC_DATE_IN_INTERVAL'&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; exporting&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = sy-datum&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;days&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = '00'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;months&amp;nbsp;&amp;nbsp;&amp;nbsp; = '03'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;signum&amp;nbsp;&amp;nbsp;&amp;nbsp; = '-'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;years&amp;nbsp;&amp;nbsp;&amp;nbsp; = '00'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;importing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;calc_date = 3mdate.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s_budat-low = 3mdate.&amp;nbsp;&amp;nbsp; &lt;BR /&gt;s_budat-high = sy-datum.&amp;nbsp;&amp;nbsp; &lt;BR /&gt;s_budat-sign = 'I'.&amp;nbsp;&amp;nbsp; &lt;BR /&gt;s_budat-option = 'BT'.&amp;nbsp;&amp;nbsp; &lt;BR /&gt;append s_budat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jan 2015 12:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-default-date-range-in-selection-screen-when-executing-as-batch-job/m-p/3456240#M830412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-21T12:34:22Z</dc:date>
    </item>
  </channel>
</rss>

