Hi Rao,
Take a look at this similar thread, Exit button for web dynpro within portal.
Martin Lyall provides one solution using a specific navigation target with navigate_absolute and J Are provides a different solution using the portal's navigation history.
Cheers,
Amy