cancel
Showing results for 
Search instead for 
Did you mean: 

How to code to navigate to previous portal page?

praveenkumar_kadi
Active Contributor
0 Kudos

Hi,

I struck with portal navigation from Webdynpro ABAP. My scenario is to develop a custom application and on closing this application using a BACK button should navigate to previously visited portal page.

I have ESS Personal information screen from there I attached my custom application developed in WDA and the appearance behaviour is SHOW_INPALCE in the portal.. I have a Close button on custom application which should take me back to previous portal screen instead of closing entire portal browser.

I found below code, in the sdn forum itself and unable to use it according my requirements. Please help with with this.

 
data: L_API_COMPONENT  type ref to IF_WD_COMPONENT,

        LO_PORTAL_MANAGER type ref to IF_WD_PORTAL_INTEGRATION.

  L_API_COMPONENT = WD_COMP_CONTROLLER->WD_GET_API( ).

  LO_PORTAL_MANAGER = L_API_COMPONENT->GET_PORTAL_MANAGER( ).

IF NOT lo_portal_manager->m_portal_version IS INITIAL.
DATA baseURL TYPE STRING.
DATA portalPATH TYPE STRING.

baseURL = 'pcd:portal_content/com.sap.pct/every_user/com.sap.pct.erp.common.bp_folder/com.sap.pct.erp.common.roles/com.sap.pct.erp.common.erp_common/com.sap.pct.erp.common.lpd_start_wd_abap'.
portalPATH = 'pcd:portal_content/com.sap.pct.erp.common.lpd_start_url'.
* Navigate to calling iview
CALL METHOD lo_portal_manager->navigate_relative
EXPORTING
"base_url = baseURL
levels_up = '1'
navigation_mode = 'WDPortalNavigationMode.SHOW_INPLACE'
*path = lt_path.
*path = 'pcd:portal_content/com.sap.pct/every_user/com.sap.pct.erp.common.bp_folder/com.sap.pct.erp.common.roles/com.sap.pct.erp.common.erp_common/com.sap.pct.erp.common.lpd_start_url'.
path = portalPATH.

CALL METHOD lo_portal_manager->fire
EXPORTING
portal_event_namespace = 'urn:com.sapportals:navigation'
portal_event_name = 'historyNavigate'
portal_event_parameter = '-1'.

ELSE.
* Trigger window to be closed
lr_wdw_main = wd_this->get_wdw_main_ctr( ).
lr_wdw_main->fire_exit_plg( close_window = abap_true ).
ENDIF.

Thanks

Praveen

Accepted Solutions (0)

Answers (1)

Answers (1)

nikhil_bose
Active Contributor
0 Kudos

Praveen,

Guess CALL METHOD lo_portal_manager->fire to historyNavigate is inside event handler of BACK button.

regards,

Nikhil Bose

praveenkumar_kadi
Active Contributor
0 Kudos

Hi,

Thnaks for the reply. However, when I use inside the back button, build error comes at below lines which I am unable to understand although I tried with test with different data types.

Error says - portalPATH = 'pcd:portal_content/com.sap.pct.erp.common.lpd_start_url'.is not in compatible types.

What is the format/type to input path in below method navigate_relative? it was like a string but giving compataiobility error. (showing in bold below)


DATA baseURL TYPE STRING.
DATA portalPATH TYPE STRING.
 
baseURL = 'pcd:portal_content/com.sap.pct/every_user/com.sap.pct.erp.common.bp_folder/com.sap.pct.erp.common.roles/com.sap.pct.erp.common.erp_common/com.sap.pct.erp.common.lpd_start_wd_abap'.
*bold* portalPATH = 'pcd:portal_content/com.sap.pct.erp.common.lpd_start_url'.*bold* 
* Navigate to calling iview
CALL METHOD lo_portal_manager->navigate_relative
EXPORTING
"base_url = baseURL
levels_up = '1'
navigation_mode = 'WDPortalNavigationMode.SHOW_INPLACE'
*path = lt_path.
*path = 'pcd:portal_content/com.sap.pct/every_user/com.sap.pct.erp.common.bp_folder/com.sap.pct.erp.common.roles/com.sap.pct.erp.common.erp_common/com.sap.pct.erp.common.lpd_start_url'.
*bold* path = portalPATH.*bold* 

Edited by: Praveen kumar Kadi on Oct 17, 2011 11:47 AM

nikhil_bose
Active Contributor
0 Kudos

Hi Praveen,

datatype are string only and they are correct too.

but the value for portalPath is wrong. it contain only the subpath of desired folder.

see [Relative Navigation Doc.|http://help.sap.com/saphelp_nw73/helpdata/en/87/f96f4132f15c58e10000000a1550b0/content.htm]

- Nikhil Bose