Skip to Content
avatar image
Former Member

SAPSetFilter with Range values

Hello,

I have a requirement to restrict Datasource to range of values for a field. It is working fine with single values, not for range. Please guide me with correct syntax.

1. Created 2 Excel Dropdown filled with values for 0CALWEEK i.e. "Calweek from" and "Calweek to"

2. if i select a value in "CalWeekTo" Dropdown, i want to restrict Datasource with Calweek Range

Code:

Dim WeekFr As String

Dim WeekTo As String

WeekFr = Sheets("Main").FromWeek.Value

WeekTo = Sheets("Main").ToWeek.Value

Dim lResult As Long

lResult = Application.Run("SAPSetFilter", "DS_1", "0CALWEEK", WeekFr - WeekTo, "INPUT_STRING")

Thanks,

Benarji.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • May 28, 2015 at 05:15 AM

    Hi Benarji Ganapthi,

    try this code,

    WeekFr = Sheets("Main").FromWeek.Value

    WeekTo = Sheets("Main").ToWeek.Value

    'MsgBox WeekFr

    'MsgBox WeekTo

    Value = WeekFr & " - " & WeekTo

    'MsgBox Value

    Dim lResult As Long

    lResult = Application.Run("SAPSetFilter", "DS_1", "0CALWEEK", Value, "INPUT_STRING")

    Subhash

    Add comment
    10|10000 characters needed characters exceeded