Hi Kalyan,
Below record selection formula is working perfectly for me without any error in 2011 Crystal version.
if hasValue({?All}) then true
else if (hasValue({?carton}) and hasValue({?location})) then
({Command.carton_no} = {?carton} and {Command.putAway} = {?location})
else if (hasValue({?carton}) and not(hasValue({?location}))) then
{Command.carton_no} = {?carton}
else if (not(hasValue({?carton})) and hasValue({?location})) then
{Command.putAway} = {?location}
Also, check whether you have created All parameter as optional prompt or not.
Thanks,
Raghavendra