<?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: Dynamic date in variant in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453005#M1414145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can think of one thing,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just use parameters for start date and end date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then set the their values in the variant as follows,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Press Save on the selection Screen and then put the name and short text then,&lt;/P&gt;&lt;P&gt;in the very last box called &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;"Selection screen objects 1000"&lt;/SPAN&gt; check on the fourth check box &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;"Selection variable"&lt;/SPAN&gt; for both start date and end date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then click on &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;"selection Variable" Button&lt;/SPAN&gt; on left hand top corner of the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then click on the &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;span class="lia-unicode-emoji" title=":anguished_face:"&gt;😧&lt;/span&gt; Dynamic date calculation&lt;/SPAN&gt; the must turn &lt;SPAN __default_attr="green" __jive_macro_name="color"&gt;Green&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;then click on the downward arrow that appears there you will have options to set the date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there choose current date for the start date and Current date +/- ??? days  for the end date.&lt;/P&gt;&lt;P&gt;now while setting the end date it will ask you the number of days there you have to put 30(as it is your requirement) and SAVE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then test it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;otherwise you can go for this approach.

Keep your date in select-options only and use the following option while selecting "Selection variables"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="green" __jive_macro_name="color"&gt;"Current date - xxx,current date + yyy"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps you,&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Abhijit G. Borkar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Abhijit Borkar on Jan 7, 2010 7:31 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jan 2010 06:29:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-07T06:29:12Z</dc:date>
    <item>
      <title>Dynamic date in variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453001#M1414141</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;I need to create a dynamic date for my variant.&lt;/P&gt;&lt;P&gt;Date will be the select option - The from date should be the current date and the to date should be current date + 30 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i am using the Selection variant and using the option D to calculate the current date+ 30 days. But that is getting stored in the from date but not in the to-date. My report will be running in back ground every day. So according to the requirment i need to have from date as current date and to-date as current date + 30 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot use the logic in initialization as the report will be running based on the variant saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 05:16:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453001#M1414141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-07T05:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic date in variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453002#M1414142</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;In the event initialization, u need to put values in the date variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg . if you select-option is s_date&lt;/P&gt;&lt;P&gt;then write following code in initialization&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;s_date-low = sy-datum.&lt;/P&gt;&lt;P&gt;v_date = sy-datum + 30.&lt;/P&gt;&lt;P&gt;s_date-high = v_date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 05:38:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453002#M1414142</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-07T05:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic date in variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453003#M1414143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As i mentioned i can not put the logic in Initialization as my report will be running in background every day.&lt;/P&gt;&lt;P&gt;Pls let me know how to save the variant so that i can have both from and to dates in the variant.&lt;/P&gt;&lt;P&gt;Currently i am able to get the current day + 30 days in the from date but i want the from date to be current date and the to date to be current date + 30 days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Raju&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 05:48:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453003#M1414143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-07T05:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic date in variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453004#M1414144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raju,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this function module in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ADD_TIME_TO_DATE&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this function module, enter the period you need to add to the export parameter I_TIME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'ADD_TIME_TO_DATE'

EXPORTING

I_IDATE = SY-DATUM

I_TIME = '30'

I_IPRKZ = ' '

IMPORTING

O_IDATE = date .

WRITE:/ DATE .
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Raj  Karunanidhi on Jan 7, 2010 11:36 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Raj  Karunanidhi on Jan 7, 2010 11:37 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 06:05:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453004#M1414144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-07T06:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic date in variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453005#M1414145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can think of one thing,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just use parameters for start date and end date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then set the their values in the variant as follows,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Press Save on the selection Screen and then put the name and short text then,&lt;/P&gt;&lt;P&gt;in the very last box called &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;"Selection screen objects 1000"&lt;/SPAN&gt; check on the fourth check box &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;"Selection variable"&lt;/SPAN&gt; for both start date and end date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then click on &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;"selection Variable" Button&lt;/SPAN&gt; on left hand top corner of the screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then click on the &lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;span class="lia-unicode-emoji" title=":anguished_face:"&gt;😧&lt;/span&gt; Dynamic date calculation&lt;/SPAN&gt; the must turn &lt;SPAN __default_attr="green" __jive_macro_name="color"&gt;Green&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;then click on the downward arrow that appears there you will have options to set the date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there choose current date for the start date and Current date +/- ??? days  for the end date.&lt;/P&gt;&lt;P&gt;now while setting the end date it will ask you the number of days there you have to put 30(as it is your requirement) and SAVE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then test it .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;otherwise you can go for this approach.

Keep your date in select-options only and use the following option while selecting "Selection variables"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="green" __jive_macro_name="color"&gt;"Current date - xxx,current date + yyy"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps you,&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Abhijit G. Borkar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Abhijit Borkar on Jan 7, 2010 7:31 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 06:29:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453005#M1414145</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-07T06:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic date in variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453006#M1414146</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;I have posted a blog on the same topic. Please check below link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/vinod.vemuru2/blog/2010/01/04/how-to-create-a-dynamic-variant-and-setup-batch-job-with-dynamic-variant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinod.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 06:41:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453006#M1414146</guid>
      <dc:creator>vinod_vemuru2</dc:creator>
      <dc:date>2010-01-07T06:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic date in variant</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453007#M1414147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this. It will work. I checked it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AT SELECTION-SCREEN OUTPUT.

REFRESH s_date.

  s_date-low = sy-datum.
  s_date-high = sy-datum + 30.

  APPEND s_date.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jan 2010 06:57:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-date-in-variant/m-p/6453007#M1414147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-07T06:57:08Z</dc:date>
    </item>
  </channel>
</rss>

