Skip to Content

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

Multi Parameters only returning first criteria?

Hi,

I've create a report with multiple parameters but when the report is run it only returns the first parameter.

   

For example the code is:

If {?Supplier} = 'z' then {Supplier_Code} = {Supplier_Code} else {Supplier_Code} = {?Supplier} and

if {?Date} = 'z' then {Date_Field} = {Date_Field} else {Date_Field} = {?Date} and

if {?Stock} = 'z' then {Stock_Field} = {Stock_Field} else {Stock_Field} = {?Stock}

When the report runs it uses what I've entered in the supplier and only returns that supplier but returns all dates and all stock codes. If I swap date for example as the first line of the code that returns the date criteria but all suppliers and stock codes regardless if they've been entered or not.

I use the 'z' criteria to return all data even if nothing is specified.

If you can help that would be great.

Thanks

Tags:
Former Member
replied

Hi Nick,

Try:

({?Supplier} = 'z'  OR {Supplier_Code} = {?Supplier})

AND

({?Date} = 'z' OR {Date_Field} = {?Date})

AND

({?Stock} = 'z' OR {Stock_Field} = {?Stock})

-Abhilash

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