cancel
Showing results for 
Search instead for 
Did you mean: 

How to close parent window

Former Member
0 Kudos

Hello ,

I have sceanrio where once user clicks on Enter confirmation , system opens new dynpro component in new browser window.once userd creates confirmation , system tries to show success message of a anotheer from the same dypro component.I have coded wddoinit methos such a way that it will display popup and once user clicks ok button of that popup , i am calling standard even close_window(). Event handler of this close window even has code wd_comp_controller->close_window( ). When I see the o/p, its closing the view which gives success message. I want to close full window which had called by user after clicking on enter confirmation.

How to do this.

thanks in advance,

Sharada

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hello ,

We have created a exit plug in window.

placed this code on onclose event.

DATA: L_REF_CONFIRMATION TYPE REF TO IG_CONFIRMATION

L_REF_CONFIRMATION = WD_THIS->GET_CONFIRMATION_CTR( ).

L_REF_CONFIRMATION->FIRE_MYEXIT_PLG( exporting URL = 'http://veenavinchurkar.bravehost.com/a2.html' ).

content of a2.html is as

<html>

<head><title>Exit MyApp</title></head>

<body onload="self.top.close()">

</body>

</html>

Former Member
0 Kudos

Hi Sharada,

I and Sascha have been trying to suggest you to use component reuse concept instead of calling application using OBN, the way you have done currently, so that instead of new browser window you have a popup whose reference you will get while creating it and then you can call standard method to close this window along with the one you have opened. All you need to do is call the close_window method of the parent window in WDONCLOSE of the child window or you can trigger a event of parent window which will call close_window method with parent windows reference.

Now how you can reuse a component has been very demonstrated by Thomas Jung in his videos so request you to go through same. Here is the link.

/people/thomas.jung/blog/2006/06/20/web-dynpro-abap-demonstration-videos

I hope this helps.

Regards,

Anoop

Former Member
0 Kudos

Try using a window exit plug.

This terminates the application.

Browser still there looking all grey and empty.

Now go to SICF.

Go to exit page setting for service.

Drop some fancy javascript in there.

onload does a window.close()


<html>
<head>
 
<script language="JavaScript">
    function closeMyWin()
    {
        window.close();
    }
 
</script>
 
</head>
<body onload="window.opener='';closeMyWin()">
</body>
</html>

I use something like this at sites were customer insists users cant deal with clicking close button.

So exit of service sends javascript to kill a browser.

Not pretty if the service is ever used in the portal

Why you dont see std SAP stuff killing the browser.

cheers

Phil

Former Member
0 Kudos

Hi Phil,

I just wanted to know if we can do this for WD ABAP.

And yes thanks for the suggestion.

Regards,

Anoop

Former Member
0 Kudos

hey Anoop /Sascha,

I was looking into some other issue.

I am extermelly sorry...but didnt get anyhting ...is it possible for you guys to give me detail steps/process.

Without knowing abc of dynpro , i have to help on dynpro development in my project.

So pl can you send me steps.

thanks,

Sharada

Former Member
0 Kudos

Hello Sascha,

Thanks alot for your input.

To be very frank , pl can you explain it in detail. I didnt understand what to do.

I am new to this abap dynpro and there is issue in project to be solved on top priority.

I will greatful to you if you explain it in detail.

thanks,

Sharada

Former Member
0 Kudos

Hi Sharada, Sascha,

I am sorry for interrupting your conversation Sascha but thought of explaining what you tried to suggest.

Well Sharada what Sascha is saying is that you can re-use the component in your called application and it will be available to you for any processing, including close. i.e. instead of going for OBN call go for Component Reuse.

Hope this helps.

Regards,

Anoop

Former Member
0 Kudos

Hi Anoop.

You do not have to apologize for contributing. Every contribution that helps others

is driving this Forum and everyone who has answers to questions should post

them immediately to help others as fast as possible.

Cheers,

Sascha

Former Member
0 Kudos

Hi Sharada.

You can define a component usage to for the confirmation component inside the

component that triggers the new browser window. Instead of opening the new

browser window you can use the method

CREATE_WINDOW_FOR_CMP_USAGE of the window manager.

You have to pass the name of the component_usage and the name of the interface

view of the used component. You receive a reference to the window with open()

and close() method. Just call open to display the pop up.

Just try what happens. If you still have problems your welcome to ask.

Cheers,

Sascha

Former Member
0 Kudos

thanks Anoop,

Here on enter confirmation button click , I am opening a web dynpro application in new browser window. once user does the confirmation from this new window success message is given by pop up. This pop up has ok button. once user clicks on this ook button, it should close pop up as well the new browser window which was opened after clicking on enter confirmation button.

at this monent what happening , once a user clicks on ok button ,pop up window is closed and the success view in the new browser window is closed , but the parent new broswer window remains empty and then user has to close it manually .

It will be really helpful if you can throw some light.

thanks,

Sharada

Former Member
0 Kudos

Hi Sharada,

i dont really think if this is possible i.e. we dont have any control over the Browser Windows(internet explorer window) behaviour .. the user has to close it manually ..

Addl Info: This issue was raised as a bug and now has been fixed but I dont know if it will be available in a SP or in next release of NetWeawer[Mods please confirm this] ..

Have a nice day and do award points if you think this post deserves ..

Regards,

Anoop

Additional info provided

Message was edited by:

Anoop Singh Saini

Former Member
0 Kudos

Hi Saharda.

Couldn't you just open the confimation component in a pop up window too and not

in a new browser window?

You could create a new window in your component that contains the interface view

of the confirmation component. This window could be opened as pop up and

should be closable like usual.

Cheers,

Sascha

Former Member
0 Kudos

Hello ,

Pl can anyone suggest on this.

thanks,

Sharada

harishankar_n
Discoverer
Former Member
0 Kudos

Hi Sharda,

The parent window you are talking about .. is that a "Popup" or a "new browser window" if it is a popup then you can trigger a event with the OK or close button of the window that displays success message and then close this parent window using its reference. But if it is a browser window then I guess we both need to search through SDN.

Regards,

Anoop