We can do enhancement of standard web dynpro component of the component controller or window controller or View Controller. This allows us to create the pre-exit, post-exit or overwrite-exit of the standard hooks methods.
For the demo we have taken a Z component but the same process can be followed for a standard web dynpro component.
Open the component in display mode and go to the component controller and select the Spiral button.
The enhancement maintenance screen comes up.
Provide an enhc. impl name and text and continue.
We can observe, exits methods appeared for each methods. any logic can be maintained in any of the exit methods as per needed.
Now we created enhancement for component controller. This also can be maintained for the view controller. Go to the VIEW and select the spiral button.
Select the already created ehnc. impl or else we can create a new one.
So the exit methods appeared in the view controller hooks methods.