cancel
Showing results for 
Search instead for 
Did you mean: 

Close a component depending of another component

Former Member
0 Kudos
76

Hi Gurus!

i know this question could sound similar to a hundred of other..but i didn't find the exactly case. Please i really need to found a solution to this.

I have a component A, at save time I call to create_popup_to_confirm, if the answer is Yes in the popup, I call to create_window_for_cmp_usage to a component B (with interface node), and the pop up disappear.

So, component A -> pop up -> component usage B. But when i have the focus in B, the pop up is not there.

I need the follow: when component usage B is closed -> close automatically the component A.

I have try to send by reference the windows of component A, So, i can make windows_A->close() but it doesn't work, because I get the reference of windows pop up

I have try to subscribe to windows close event..and in component A doesn't catch it.

Please! Help me!

Thanks for all!

MR

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

So, component A -> pop up -> component usage B. But when i have the focus in B, the pop up is not there.

If you want a case where when you open a new popup window (Window B ) from an event in one already opened popup,

and you dont want the previous popup to close.

Then in that case you have to use create_window( ) method instead of create_pop_up_toconfirm(). confirmation pop up will

be closed as soon as you press any button on it.

In the create_window( ) method you have a parameter close_in_any_case make it abap_false to achieve that.

I need the follow: when component usage B is closed -> close automatically the component A.

Now here you want to close the main window A from the pop up that you have created from the used comp B.

i guess you can try with exit plug but how feasible that will be. because this is complex situation.

do as follow

1. create an exit plug in the window A with parameter close_window.

2. Go to component controller of Comp B and create an event say exit make it interface also by ticking the check box interface.

3. go to the comp A. there go to any view and create an eventhandler with event being the event EXIT ,you just created in the

second step , by using the interface controller of comp B.

4. In this eventhandler call the emthod fire_exit_plg of winodw A.

5. go back to the comp B and go the view method wddoexit and write the code to call the event of the comp controller like as shown below.

DATA lo_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER .
lo_COMPONENTCONTROLLER =   wd_this->get_componentcontroller_ctr( ).

  lo_componentcontroller->fire_exit_evt(
  ).

Thanks

sarbjeet singh

Former Member
0 Kudos

Hi sarbjeet singh !

Thank you very much! you solve my problem!

Best Rgds!

Former Member
0 Kudos

hello, would you please right how could you solve your problem, i need to close a window from a popup,#

BR

Former Member
0 Kudos

Hi!

you should follow the steps posted by sarbjeet singh. That's solve my problem and I think that should solve your problem too.

Rgds

Former Member
0 Kudos

i need more explanation, i really didnt get his points ! and then i dont have in this case 2 deferents WD Components, it the same one,

Answers (1)

Answers (1)

Former Member
0 Kudos

Hallo MR,

I have some problem understanding your requirement.

is it you want to

1. exit the appliction by closing the windows of component A ?

in this case you can create a Exit plug in your window from component A. You can achieve this in different ways either making use of the window-A interface in window-B.