on 05-06-2019 11:06 AM
Hello,
I've been looking all over Internet and couldn't find a solution to my problem. I really feel I'm doing it right though...
I'd like that each time I update my report via macro it shows the data from the last 2 months. These are set in a "Filter by range" on Calendar Day (0CALDAY). To do this I have a function that gives me the date of yesterday and the date of minus 61 days and values get concatenated and returned as a filter value. However, when checking after the macro has run I see that nothing has changed in my filters. Any thoughts?
Thanks in advance.
Best regards,
Private Sub RefreshAnalysis()
With Application
.Run("SAPExecuteCommand", "Refresh", "DS_5"
'freeze Analysis for variables & filters
.Run "SAPSetRefreshBehaviour", "Off"
.Run "SAPExecuteCommand", "PauseVariableSubmit", "On"
'### START PROBLEM IS HERE ###
.Run "SAPSetFilter", "DS_5", "0CALDAY", calendar_date_rng(), "INPUT_STRING" 'Update Orders from last 2 months
'### END PROBLEM IS HERE ###
'unfreeze Analysis for variables & filters
.Run "SAPExecuteCommand", "PauseVariableSubmit", "Off"
.Run "SAPSetRefreshBehaviour", "On"
End With
End Sub
Private Function calendar_date_rng() As String
Dim two_months As String, yesterday As String
two_months = Date - 61
yesterday = Date - 1
calendar_date_rng = two_months & " - " & yesterday
End Function
A W,
Have you tried w/o
.Run"SAPExecuteCommand", "PauseVariableSubmit", "On" and
.Run"SAPExecuteCommand", "PauseVariableSubmit", "Off"?
I ran into a similar issue once and removing the two lines of code worked for me..since I didn't set variables only filters it kinda made sense.
Regards
Seb
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.