cancel
Showing results for 
Search instead for 
Did you mean: 

Call a new WD application from a WD application?

Former Member
0 Kudos

Hi,

I have a scenario, where i need to call a new WD application on button click event. The new WD application should open as a pop up and then return a value back to my WD where the call was made from.

How can i solve this issue?

Please explain me the process and any sample code will be appreciated.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member185029
Active Contributor
0 Kudos

Hi,

there are 2 approaches

1. Using NWDI, create 2 Webdynpro components and include the 2nd component as a used component in 1st component.

2. Open the window using URL of the 2nd application.

-Ashutosh

Former Member
0 Kudos

Can you please tell me in detail how i would implement either of the solution as i am not an expert in WD by any mean. The WD i want to call does not have an application, but it has component usages OADP.

Thanks

Former Member
0 Kudos

Hi,

You have to create Inbound and outbound plugs of window to do this requirement.

To navigate and get back from the second application.You need to create Outbound plug of type Suspend and when you get back from second application to start the first application create Inbound plug of type Resume of window.

Similarly in the second application create inbound plug of type Startup to start the application and create Outbound plug of type Exit of window to navigate back to first application.

check this Article written by me How to call one application from other.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2064719b-8851-2b10-a399-b356d91c...

and also cjeck this wiki How to use Exit plug of a window.

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/snipppets%2b%2bweb%2bdynpro%2babap-%2bho...

check this SAP document.

http://help.sap.com/SAPHELP_NW04S/helpdata/EN/45/2233b60c21072ce10000000a155369/content.htm

Thanks

Suman

Former Member
0 Kudos

Thanks for the detailed reponse.

Once i call the WD application, i get the following error: Access via 'NULL' object reference not possible.

In wdinit of the second view i have the following code where i get the dump.

DATA view_select_position TYPE REF TO if_wd_view_controller.

view_select_position = wd_this->wd_get_api( ).

***At this line i get the dump

wd_comp_controller->popup_window->subscribe_to_button_event(

button = if_wd_window=>co_button_ok

action_name = 'CLOSE'

action_view = view_select_position ).

Any suggestion?

Thanks

Former Member
0 Kudos

Hi,

i think you are doing mistake in assigning the action_view is wrong.

check this code......

method onactionaction .

data: l_cmp_api          type ref to if_wd_component,
        l_window_manager   type ref to if_wd_window_manager,
        l_popup            type ref to if_wd_window,
        l_text             type string_table,
        l_api              type ref to if_wd_view_controller.


  l_cmp_api        = wd_comp_controller->wd_get_api( ).
  l_window_manager = l_cmp_api->get_window_manager( ).
  insert `Data where changed` into table l_text.    "#EC *
  insert `Do you want to save?`        into table l_text.    "#EC *

  l_popup = l_window_manager->create_popup_to_confirm(
                text            = l_text
                button_kind     = if_wd_window=>co_buttons_yesnocancel
                message_type    = if_wd_window=>co_msg_type_question
                window_title    = 'Test: Popup to confirm'
                window_position = if_wd_window=>co_center )."#EC *



  l_api = wd_this->wd_get_api( ).

  l_popup->subscribe_to_button_event(
               button            =  '07' "if_wd_window=>co_button_yes
               action_name       = 'YES'
               action_view       = l_api
               is_default_button = abap_true ).

  l_popup->subscribe_to_button_event(
               button            = '08' "if_wd_window=>co_button_no
               action_name       = 'NO'
               action_view       = l_api
               is_default_button = abap_false ).

  l_popup->subscribe_to_button_event(
               button            = '06' "if_wd_window=>co_button_cancel
               action_name       = 'CANCEL'
               action_view       = l_api
               is_default_button = abap_false ).

  l_popup->open( ).


endmethod.

Thanks

Suman

Former Member
0 Kudos

Hi,

I am little confused here.

The code in WDInit in the second view where i get the dump is actually sap standard wd which i am using in an other application as well. So that can not be wrong. Do i need to assign some values in my first view before i pop up the second view?

Thanks

Former Member
0 Kudos

Hi,

Your second application is Standard Wd application.can you tell me that component name i will look into that.why you are getting the error.

thanks

Suman

Former Member
0 Kudos

The name of the WD is HRRCF_C_POSITION. It does not have an application. I have made Z version of this application and in that i have added an application which i am calling.

The dump is in WDInit of view.

Thanks for your help.

Former Member
0 Kudos

Sorry Nahman i am not able to open that component.Can you post your code.

Thanks

Suman

Former Member
0 Kudos

Sorry for the late reply. I have decided to write my own code since it is a very minor WD which is used as search help to find positions.

I am now able to call the new WD and do what ever operation i need to do. My last step is now to figure out how to send back data to my original WD and close the second WD.

I have awared some points. I will close the thread once i have finished my task. I might as a question if i get stuck.

Thanks for your help so far.

Former Member
0 Kudos

Hi,

When i call the new WD using suspend/resume plug it opens the new WD in same browser. I would like to open the second WD in a new a browser as popup.

Any idea?

Thanks

Answers (0)