<?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>Question Re: SAP Set Variable with Array of Dates in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sap-set-variable-with-array-of-dates/qaa-p/12565816#M4711571</link>
    <description>&lt;P&gt;Thank
you for visiting SAP Community to get answers to your questions.&lt;/P&gt;

&lt;P&gt;Since you're asking a question here for the first time, I'd like
to recommend you with the following steps so you can get the most out of your
community membership:&lt;/P&gt;

&lt;UL&gt;
 &lt;LI&gt;Please
     see: &lt;A href="https://community.sap.com/resources/questions-and-answers"&gt;https://community.sap.com/resources/questions-and-answers&lt;/A&gt; as this
     resource page provides tips for preparing questions that draw responses
     from our members&lt;/LI&gt;
 &lt;LI&gt;Consider to take
     our Q&amp;amp;A tutorial at: &lt;A href="https://developers.sap.com/tutorials/community-qa.html" target="_blank"&gt;https://developers.sap.com/tutorials/community-qa.html&lt;/A&gt;. as that will
     help you when submitting questions to the community.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I also recommend that you include a profile picture. By
personalizing your profile, you encourage readers to respond: &lt;A href="https://developers.sap.com/tutorials/community-profile.html" target="_blank"&gt;https://developers.sap.com/tutorials/community-profile.html&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;I hope you find this advice useful, and we're happy to have you
as part of SAP Community!&lt;/P&gt;

&lt;P&gt;All the best,&lt;BR /&gt;
-Alex&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 14:44:31 GMT</pubDate>
    <dc:creator>AlexGourdet</dc:creator>
    <dc:date>2022-05-24T14:44:31Z</dc:date>
    <item>
      <title>SAP Set Variable with Array of Dates</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-set-variable-with-array-of-dates/qaq-p/12565815</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I'm a complete newbie when it comes to SAP BI VBA. &lt;/P&gt;
  &lt;P&gt;I have a report that needs daily refreshes and the date range in prompts needs to be updated when new month comes around. For two weeks of a new month, the range needs to be Previous Month - Current Month, then it can be Current Month from and to&lt;/P&gt;
  &lt;P&gt;.&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2052625-prompts.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I found multiple solutions to when the prompt update is a single input, however in my case it's a range From - To.&lt;/P&gt;
  &lt;P&gt;I have tried both to filter by text MAY 2022 - MAY 2022 (this is how it shows in the Filter Information in the side pane) and by range like 05.2022 - 05.2022, but nothing works. &lt;/P&gt;
  &lt;P&gt;Below the code I have come up with - could you please support with how the function should be structured so that the array works?&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;Sub UpdateData()
Dim SetPeriod As Long
Dim RefPeriod As String

Call Application.Run("SAPSetRefreshBehaviour", "Off")
Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "On")

'RefPeriod = UCase(Range("r_FilterFrom").Value) &amp;amp; " - " &amp;amp; UCase(Range("r_FilterTo").Value) 'returns MAY 2022 - MAY 2022
RefPeriod = Format(Date - 14, "MM.yyyy") &amp;amp; " - " &amp;amp; Format(Date, "MM.yyyy") 'returns 05.2022 - 05.2022

SetPeriod = Application.Run("SAPSetVariable", "[0CALMONTH_C_C_I_M_001]", RefPeriod, "INPUT_STRING_AS_ARRAY", "DS_1")

Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "Off")
Call Application.Run("SAPSetRefreshBehaviour", "On")

SetPeriod = Application.Run("SAPExecuteCommand", "RefreshData", "DS_1")

End Sub
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 May 2022 14:44:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-set-variable-with-array-of-dates/qaq-p/12565815</guid>
      <dc:creator>former_member1121432</dc:creator>
      <dc:date>2022-05-24T14:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Set Variable with Array of Dates</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-set-variable-with-array-of-dates/qaa-p/12565816#M4711571</link>
      <description>&lt;P&gt;Thank
you for visiting SAP Community to get answers to your questions.&lt;/P&gt;

&lt;P&gt;Since you're asking a question here for the first time, I'd like
to recommend you with the following steps so you can get the most out of your
community membership:&lt;/P&gt;

&lt;UL&gt;
 &lt;LI&gt;Please
     see: &lt;A href="https://community.sap.com/resources/questions-and-answers"&gt;https://community.sap.com/resources/questions-and-answers&lt;/A&gt; as this
     resource page provides tips for preparing questions that draw responses
     from our members&lt;/LI&gt;
 &lt;LI&gt;Consider to take
     our Q&amp;amp;A tutorial at: &lt;A href="https://developers.sap.com/tutorials/community-qa.html" target="_blank"&gt;https://developers.sap.com/tutorials/community-qa.html&lt;/A&gt;. as that will
     help you when submitting questions to the community.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I also recommend that you include a profile picture. By
personalizing your profile, you encourage readers to respond: &lt;A href="https://developers.sap.com/tutorials/community-profile.html" target="_blank"&gt;https://developers.sap.com/tutorials/community-profile.html&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;I hope you find this advice useful, and we're happy to have you
as part of SAP Community!&lt;/P&gt;

&lt;P&gt;All the best,&lt;BR /&gt;
-Alex&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 14:44:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-set-variable-with-array-of-dates/qaa-p/12565816#M4711571</guid>
      <dc:creator>AlexGourdet</dc:creator>
      <dc:date>2022-05-24T14:44:31Z</dc:date>
    </item>
  </channel>
</rss>

