naviagate_absolute is not working first time after login
I wrote a code for navigating to the portal iview in webdynpro ABAP using below code
CALL METHOD lr_port_manager->navigate_absolute
navigation_target = 'ROLES://portal_content/test/test123&NavMode=3'
navigation_mode = if_wd_portal_integration=>co_show_inplace
history_mode = if_wd_portal_integration=>co_allow_duplicates.
If I login to the portal first time it is not working. But if I refresh the browser and open the same application , I am able to navigate perfectly.
Again if I close all the browsers and refresh the cache and try to login again, it is not working.
Can anyone please help me on this issue. Thank you.