There can be scenarios (although rare) where a user needs to be pushed back to the search page when he clicks on a button or changes some value. Sometimes there arise requirements where if user launches a component, the user should be prevented from seeing the values based on the search values he might have provided.
All these requirements boil down to the need for a method\function to which can be written in peoplecode so that if the conditions are met the user is transferred back to the component search page.
Luckily there is a built-in function delivered by PeopleSoft which handles exactly the same scenario. You can use DoCancel() function to return to the search page.
If this function is used in Component context, the user is returned to the Search page. If it is used in a menu context, then user will be returned to the menu with no active component.
Simple and easy to use function but it can solve the hardest and rarest requirement put down buy your business group.