Dynpro application: how to perform some  code when user click window close

Hello,
I'm developing dynpro application. This application needs to perform some code when exiting.
I can do that with MODULE xxxxx AT EXIT-COMMAND. But this code can't be performed when user of application click on button closing window (classic R/3 window, not pop-up).
Does anybody know how to bind some code to clicking on button closing window?
Best regards,
Josef Motl

As far as the prompt that you get when you close the last window is coming from the counter that SAP maintains regarding the number of open sessions(windows). When this counter reaches 1, I guess they have a check to issue a prompt. There was a discussion in this forum a long time back regarding how we can know that session id like SM04. There was no conclusion reached then. Theoritically, let us know you know this id for the session in which the user opened a particular page, then you can see if that session is deleted and then take the necessary action. There are some TH_* function modules that seem to be promising, but I was not able to conclusively achieve the control over a particular session.
See if you can look at SM04 and get an idea. Please do let us know if you find the solution.
Srinivas

Similar Messages

  • How to initiate some action when user clicks a field in CRViewer?

    <p><span style="font-family: Courier"><font size="1">ReportObjects doesn't expose click event despite the fact that a field can get focus frame, you can even tab from field to field. </font></span><span style="font-family: Courier"><font size="1">Drill() event works only on group names.</font></span><span style="font-family: Courier"><font size="1">So, how to initiate some action (based on a clicked field value) when user clicks a field in CRViewer?</font></span><span style="font-family: Courier"><font size="1">After doing some googling, have found that something similar exists but it's FoxPro API</font></span></p><p><strong><span style="font-size: 12pt; font-family: Courier"><font size="1">From some PDF: </font></span></strong><strong><span style="font-size: 12pt; font-family: Courier"><font size="1"> </font></span></strong></p><p><strong><span style="font-size: 12pt; font-family: Courier"><font size="1">> Report objects events</font></span></strong> </p><p style="margin: 0cm 0cm 0pt; line-height: normal" class="MsoNormal"><span style="font-size: 10pt; font-family: Courier"><font size="1"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>Report object events occur when you click or double-click a field, </font></span></p><span style="font-size: 10pt; font-family: Courier"><font size="1"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>heading, or label in a report.</font></span> <p style="margin: 0cm 0cm 0pt; line-height: normal" class="MsoNormal"><span style="font-size: 10pt; font-family: Courier"><font size="1"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>Doing this creates the EventInfo object. This object contains </font></span></p><span style="font-size: 10pt; font-family: Courier"><font size="1"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>information about the event and</font></span> <p style="margin: 0cm 0cm 0pt; line-height: normal" class="MsoNormal"><font size="1"><span style="font-size: 10pt; font-family: Courier"><span style="font-size: 12pt; font-family: Courier"><font size="1"><strong>> </strong></font></span>passes as a parameter to the event method. </span><strong><span style="font-size: 10pt; font-family: Courier">Table 3 </span></strong><span style="font-size: 10pt; font-family: Courier">lists the</span></font></p><p style="margin: 0cm 0cm 0pt; line-height: normal" class="MsoNormal"><font size="1"><span style="font-size: 10pt; font-family: Courier"><strong><span style="font-size: 12pt; font-family: Courier"><font size="1">> </font></span></strong>EventInfo object properties.......</span></font></p>

    The article you found refers to the ActiveX viewer which is used with the COM-based tool called Report Designer Component. Since you have posted to the .NET forum, I'm assuming you're not using the RDC and therefore this article will not apply.
    Recently, Click events were added to the Windows Form Viewer to get similar functionality as the ActiveX viewer. Take a look at the following link for more information....
    [http://diamond.businessobjects.com/node/2109 | /node/2109]
    However, if you are using the CR Web Forms Viewer in an ASP.NET app, then this functionality is not available.

  • How to get login page when user clicks on browser's back button

    Hi,
    I am using struts framework.
    I have set property nochache=true in response header of all pages.
    So, browser does not caches my pages.
    Now,when I am clicking on browser's back button, I am getting following message..generated by browser.
    Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.
    To resubmit your information and view this Web page, click the Refresh button.
    Instead of that I want to show user a login page, when it clicks on back button.
    Can anyone help me?

    Hi,
    I agree with your suggestion.But my query is,
    If you have seen many credit card or banking websites,generally when user clicks on browser's back button,its redirectly user to login page of it for security reasons.
    I want to implement that kind of functionality.So need help on that point

  • How to find out date when user clicks on a date of Date Navigator

    Hi Experts,
    I have created WD application. It contains DateNavigator. User clicks on a particular date. We want to display the clicked date. How we can do so? I have done following coding. What I should type after "hi" + ????? to display the selected date.
    public void onActionSelectDate(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSelectDate(ServerEvent)
        wdComponentAPI.getMessageManager().reportSuccess("hi ");
        //@@end
    Regards,
    Gary

    HI Gary,
    You can do this by binding the context attribute of type date to the firstSelectedDate property of the datenavigator Ui element.
    then suppose context attribute to which you have bound the UI element has the name date then create an action for the event onDaySelect. then write the following code in the event handler
    public void onActionselectdate(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionselectdate(ServerEvent)
        String str = wdContext.currentContextElement().getDate().toString();
        wdComponentAPI.getMessageManager().reportSuccess("HI" + str);
        //@@end
    It will solve your issue.
    But the date format here will be YYYY-MM-DD if you want to change it then either you have to use one simple type or modify it in the code itself by using some string operation.
    Regards,
    Sarbjeet

  • BDC - How to ignore skipped screens when user click on back button

    Hello all,
    I am working on a module pool program. From this custom transaction I am calling a standard SAP screen using BAC call transaction. I am calling this screen by skipping 2-3 screens and user can directly see the 3 screen on an event on my custom transaction.
    Now my issue is whenever the user want to back, he clicks on back button then user have to back from all the screens that I skipped.
    Is this any way by which if user click on back then he can directly go to my custom transaction.
    Please suggest.
    FYI..
    I am calling IA06 - Inspection characterstics screen from my custom screen using BDC.
    Thanks,
    Sanket Sethi

    Hi Jovito,
    I also think the same that it's not possible. Now my issue is how to get my requirement.
    FYI..
    To open Classification screen directly we have a function module CLFM_OBJECT_CLASSIFICATION. But if I want to open IA06
    Inspection characterstics screen we don't have any FM or API to do the same.
    So how will I get my requirement done. That why I use the BDC call transaction to open IA06 Insp. characterstics screen but here I am facing this Back issue.
    Please advice if there is any suggestion.

  • How to show an dropdown menu when user click on one point on lineseries?

    Hi all,
    I am new  in flex development.
    I am showing line series on the chart, I'd like to give some interaction, when user click on the "point" on the line, I'd like to show a dropdown menu, and react to user's choice on the menu item.
    Is it doable? Any sample or reference?
    Thanks in advance.
    /// Jack

    Cool, that definitely moving forward.
    I saw two questions here:
    1. I added mouseOver/mouseOut action to the LineSeries, it then react when I mouse over the line, instead of at the data point.
    2. How do I know the dataPoint's position and locate popmenu in that place? on other words, how do I have dropdown menu. I tried to use "this" as DisplayObjectContainer and send to Menu.createMenu, but seems not working.
    Here is the code pieces I am talking about:
    [Bindable]public var myMenu:Menu;
                // Create and display the Menu control.
                private function createAndShow():void {
                    Menu.
                    myMenu = Menu.createMenu(holder, myMenuData, true);
                    myMenu = Menu.createMenu(null, myMenuData, false);
                    myMenu.labelField="@label";
                    myMenu.show(10, 10);
                private function hideMenu():void {
                    myMenu.hide();
    <mx:series>
                        <mx:LineSeries mouseOver="createAndShow()" mouseOut="hideMenu()" sortOnXField="true"  xField="date1" yField="score1"  displayName="Score1">
    Thanks.

  • How do I execute some code when a line of a table control is selected?

    Hi,
    I would like to execute some code when a line of a table control is selected.  At the moment I have to select one or multiple rows and then press enter, this forces a screen refresh and my code is executed but I would like the code to be executed as soon as any line is selected.
    I've done something like this using ALV grids and object orientated code but is there a way of doing this in a normal non-OO table control?
    Thanks in advance.
    Gill

    Hi,
    U need to declare a char1 field for marking (mark field).  This will reflect with value 'X' in your tcontrol internal table for all the selected rows. 
    Now u need to handle the okcode for enter in your PAI.
    There u need to loop through the table for all marked fields.
    There after u can do what ever u want.
    Venkat.

  • How to do some cleanup when closing JFrame

    Hi all,
    1st: Is it possible to call a method (or something) when the user clicks the close button on a JFrame so that some cleanup can happen before exiting? I have a dropdown menu that has an exit button which calls a method that performs a whole lot of neccesary cleanup operations. The problem is that Im not sure how to call that cleanup method if the user clicks the 'x' instead of exititing with the menu. (I know Java has automatic garbage collection but there are additional things i need to do when the program exits)
    2nd: Once ive done all the necessary cleanup is it correct to simply call Sytem.exit(0); ? Is that a safeway of closing the program?
    3rd: How do you display multiple lines of text on a JButton? I have a button wich has a small amount of horizontal space and so I need to display the text on two lines but I cant figure out how to make the text rollover. Ive tried using '\n' which doesnt work., and there is no multiline or rollover property that I am aware of.
    Much appreciated. R
    ps. Is there a page here where i can read more on assigning dukes and rewarding them? Im feeling stingy not knowing how to assign them to helpfull people.

    You might also want to have a look at shutdown hooks. You can use them to be sure that certain cleanup will happen before exiting even if exiting was forced because of your application crashing or the user killing it through the task manager or the unix "kill" command.
    http://java.sun.com/developer/TechTips/2000/tt0711.html#tip1
    2) calling Sytem.exit(0) will be enough
    3) There are a couple of ways: you can use HTML in the label or do something a bit more fancy:
    http://javaalmanac.com/egs/javax.swing/button_MultiLine.html
    http://www.javaworld.com/javaworld/javaqa/2000-03/01-qa-button.html
    4) The Duke Dollars FAQ is at http://forum.java.sun.com/rewardFaq.jsp

  • How to trigger a custom code when user log in?

    Hi my friends,
    We are using multiple sharepoint sites at work. Users log in with AD accounts, so they dont see any login page.
    I need to run a custom code when user login to website. Event receivers do not help at this point. Any suggestions?
    thanks in advance

    Hi Ahmet,
    From your description, my understanding is that you want to trigger some custom code when users log in SharePoint.
    As a solution, you could customize a login page for your SharePoint, then you could trigger your code.
    You could also use httpmodule to monitor user login. Please refer to this article about how to use httpmodule:
    http://sharepoint.stackexchange.com/questions/100976/get-the-current-logged-in-user-in-sharepoint-added-httpmodule
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • HT204266 For some reason when I click on my App Store icon it takes me to the US version......how do I swap it back to the UK store so I can update apps and buy more etc?

    Hello for some reason when I click on the App Store icon on my iPad it sends me to the US version not the UK where I live!
    I have no idea how to switch this back so that I can update my apps etc
    All help welcomed

    How to change the store location
    http://www.ehow.com/how_8202183_change-app-store-account-location.html

  • Can anyone tell me how to get crossfade to work...was working ok, but now for some reason when i click on a track and try to drag on a fade it just highlights the track but does not leave a fade on?

    can anyone tell me how to get crossfade to work...was working ok, but now for some reason when i click on a track and try to drag on a fade it just highlights the track but does not leave a fade on?

    Hello mate!
    Are you sure u have the option on the up-right side of the arrange window checked to x-fade?

  • How to change security codes when you forget them

    How to change security codes when you forget them?

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (115681)

  • What should I do if the iphoto keeps on saying that "Plz wait for import to complete" when i click the close button but it is not importing photos? How can I close the iPhoto? I try to switch my mac off but it doesn't work. Thanks.

    What should I do if the iphoto keeps on saying that "Plz wait for import to complete" when i click the close button but it is not importing photos? How can I close the iPhoto? I try to switch my mac off but it doesn't work. Thanks.

    You should be able to select Force Quit from the menu beneath the Apple icon in Finder
    and choose to Quit iPhoto from there, without messing up the Mac OS X in the process.
    OS X - Support
    Not sure if rebuilding the iPhoto library would help this issue. However if you had to
    turn off the computer without the correct method (unplug, etc; instead of menu choice)
    the system may have accrued damages and should be checked, maybe repaired by
    use of the Disk Utility in the system. Or restart the computer in Safe Boot mode, then
    run 'repair disk permissions' while it is running in that reduced mode; then restart after.
    •Understanding Safe Mode - tuts+ computer skills tutorial:
    http://computers.tutsplus.com/tutorials/understanding-safe-mode--mac-59897
    •OS X: What is Safe Boot, Safe Mode?
    Suggestions on how to use Safe Mode in article, to resolve issues, may be helpful.
    There likely are other means to rectify troublesome applications, including reinstall.
    Be sure to backup your music, image, video, and other work on an external drive
    or suitable device as a precaution against loss should there be a hard drive failure.
    iPhoto - Mac Apps - Apple Support
    There should be some tips and help information using iPhoto via this tiny Support link.
    Good luck & happy computing!

  • Hi when i open my application folder, all the application is shown in trash folder. when i click the application it says this app is in trash first move it out. and when i try to open through finder go it says this file doesn't exist. can some1 plz help?

    hi when i open my application folder, all the application is shown in trash folder. when i click the application it says this app is in trash first move it out. and when i try to open through finder> go it says this file doesn't exist. can some1 plz help? how can i put all my application through application folder?

    Something really odd is going on. In your first screen shot, I noticed that the Applications folder does not have the proper icon displayed in the side bar. Also, in the title bar it lists it as Applications 08-59-29-909.
    Not sure where it's picking up that odd name, unless it's because it's still truly within the Trash folder.
    Try this. In the Finder > Preferences > General > turn on "Always open folders in a new window". (I have a feeling you have the default setting with this off).
    Now, in Finder > Go > move down and open the Applications Folder from there. Now open the folder where you see all your applications that you show in your screen shot, select all, and move them to this true appliactions folder.
    This is what you should properly seeing (but with different apps listed):
    See how the Applications folder has the icon of the letter A shaped with a pencil, ruler & pen.

  • How to catch data from Purchase Order form, when user click CLOSE menu?

    Hi,
    I need do my own biz process when user click CLOSE in the Data menu to close a purchase order.
    But I don't know how to get data from PO form which opened by user.
    Can anybody give me some suggestions? thanks.

    Clicking "Close" is menuUID 1286. (Check this by going to View->System Information, and then hovering your mouse over "Close" in the menu. The menuUID is displayed in the bottom left of the screen)
    So catch the menu event, when menuUID and pVal.BeforeAction = True.
    The slightly tricky thing here is that pVal for a menu event doesn't give you the form, but it will be the active form, so you can do this:
    Private Sub SBO_Application_MenuEvent(pVal As SAPbouiCOM.IMenuEvent, BubbleEvent As Boolean)
         If(pVal.BeforeAction And pVal.menuUID = "1286")
             SAPbouiCOM.Form oForm = SBO_Applcation.Forms.ActiveForm
             //Now you have the form, when the user has clicked close, so process the data
             //from the form as normal
         End If
    End Sub
    Syntax might be wrong, I typed it up from memory and have no error checker!
    Edited by: njmog1 on Feb 28, 2011 10:35 AM

Maybe you are looking for