void SETFILTER(string FieldName, 
  string Filter = "", 
  string replaceString1,
  string replaceString2, 

Use this function to set a filter.

This is wrong:
SalesHeader:SETFILTER('Posting Date', 

The filter string must have logic operators and/or parameters %1, %2 only, but no data. Always put data into the arguments.

SalesHeader:SETFILTER('Posting Date','%1..', 

Set a filter starting with the value FromDate.

SalesHeader:SETFILTER('Posting Date','..%1', 

Set a filter ending with value ToDate.

SalesHeader:SETFILTER('Posting Date', '%1..%2', 
  FromDate, ToDate);

Set a filter starting from FromDate to ToDate