cancel
Showing results for 
Search instead for 
Did you mean: 

How to call URL of the one application in the right click menu item?

Former Member
0 Kudos

Hi Guru's,

I have a requirement in webdynpro, that i need to display the new browser window on click of the right click menu item in the webdynpro application.

Please find the attached screen shot.

I found some of the scn links which didn't my purpose. please help me if anybody has some idea.

Thanks,

kasi.

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Check this wiki to create a context menu on right click: How to create static context menu in Webdynpro ABAP - ABAP Development - SCN Wiki

And in onAction of menu item, call the other web dynpro application.

Try the below code:


data lv_url type string.

CALL METHOD cl_wd_utilities=>construct_wd_url

EXPORTING

application_name = 'ZWD_COMP' " Your 2nd component which you want to open in new window

IMPORTING

out_absolute_url = lv_url.

data lo_window_manager type ref to if_wd_window_manager.

data lo_api_component  type ref to if_wd_component.

data lo_window         type ref to if_wd_window.

lo_api_component  = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window         = lo_window_manager->create_external_window(

                      url = lv_url  ).

lo_window->open( ).

hope this helps u,

Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

Thank you for your reply,

I have a doubt here, can i directly call the another browser window like Google on click of the menu item.

regards,

Prakash.

former_member184578
Active Contributor
0 Kudos

Hi,

Yes, You can. jus pass the url which you want to call to the create_external_window( ) method.


data lo_window_manager type ref to if_wd_window_manager.

data lo_api_component  type ref to if_wd_component.

data lo_window         type ref to if_wd_window.

lo_api_component  = wd_comp_controller->wd_get_api( ).

lo_window_manager = lo_api_component->get_window_manager( ).

lo_window         = lo_window_manager->create_external_window(

                      url =  'http://www.google.com' ).

lo_window->open( ).

Regards,

Kiran

Former Member
0 Kudos

Hi Kiran,

I have followed the link which you have given and created the menu item and i wrote the code in the action menu item but in the webdynpro application on right click the new menu item which i created is not appearing.

please suggest me.

Regards,

kasi.

ramakrishnappa
Active Contributor
0 Kudos

Hi Kasi,

Just creating context menu will not be sufficient to get your menu. You need to assign the context menu to the ui element or container.

Please find the below snap shot, in which the MENU is assigned to a rootuielementcontainer

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

Thank you for reply,I tried the way you suggested but the menu item is not appearing in the output window on right click.

Regards,

kasi.

ramakrishnappa
Active Contributor
0 Kudos

Hi Kasi,

Make sure that you have activated the view  ,

If you are still having issue, please share the screen shot of your ui element and menu assignment details.

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

I have Actived the View and whole component and tried to executed but it is not displaying. i have another post Thomas Jung is suggesting that static menu was blocked by SAP.

please refer below thread.

Even i tried in dynamic way the menu item is not appearing.

ramakrishnappa
Active Contributor
0 Kudos

Hi Kasi,

The browser's context menu is disabled in  WDA but not the context menus of WD applications.

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

ok. But in the browser when i right click in the window of WDA i didn't see the new menuitem which i have added.

here is attached screen shot.

but in the browser window right click the menu item URL is not appearing.

Regards,

kasi.

ramakrishnappa
Active Contributor
0 Kudos

Hi Kasi,

Change the contextMenuBehaviour to "Provide" instead of "Inherit" as below

Regards,

Rama

Former Member
0 Kudos

Hi Rama,

Thank you its working.

Regards,

kasi.

Answers (0)