Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Filtering Blanks


I am trying to filter a report based on a parameter that is sometimes blank. I can get it to filter with a single line of code but I can't get it to work with this code. Can someone point me in the right direction. What am I doing wrong?


StringVar Salesperson;

Salesperson = Trim({BAQReportParameter.Option09});

If Length({BAQReportParameter.Option09}) < 1 Then

{@SalesRep} Like "*"

Else {@SalesRep} = Salesperson


Option 9 is a Salesperson # that is sometimes blank. If there is no option number I would like it to display all records. Only one salesperson value is in the parameter at a time.

I have tried the If to be equal to "" as well but that behaves similarily.

This code returns only blank values for the {@SalesRep} even though 'Salesperson' is 8091.

Also, this formula is in the Record Selection.



Edited by: rosshughes on Apr 8, 2009 2:48 AM

Figured it out. I had to add a formula like this:

If Length(Trim({BAQReportParameter.Option09})) < 1 Then 1

Else If Length(Trim({BAQReportParameter.Option09})) > 1 AND {@SalesRep} = {BAQReportParameter.Option09} Then 1;

And then add a record select looking for this field to be 1.

Edited by: rosshughes on Apr 8, 2009 3:27 AM



Are you Looking for this...

Report>Selection Forulas>Record

Enter the record selection as follows .

if {?Parameter1} = "" THEN TRUE


= {?Parameter1}



Edited by: Sathish Chandran on Apr 8, 2009 10:49 AM

Edited by: Sathish Chandran on Apr 8, 2009 10:50 AM

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question