Event handler as a method. How ?? ( WD for ABAP)

Hi All,
        Can you tell me how i can use an event handler as a method. I mean i use the wizard and get the parameter list to be passed .. but then I dont know what to pass as WDEVENT. I am trying to call this within another method.
Regards,
Anoop
Message was edited by: Anoop Singh Saini

Hello Anoop,
did you have a look at the event and event handler documentation?
http://help.sap.com/saphelp_nw2004s/helpdata/en/eb/ed6f4169e25858e10000000a1550b0/frameset.htm
Regards, Heidi

Similar Messages

  • Post Process Event Handler not getting user's CURRENT_STATE for a UDF field

    I have a post process event handler in OIM R2 BP04 , which runs on Trusted Reconciliation and it compares user's ("CURRENT_USER") state and ("NEW_USER_STATE") and based on that derives a business logic.
    The problem that i am  facing is that, it is not able to get the User's ("CURRENT_USER") state for a UDF(EMAIL_LIST) field and it is coming as null,and  hence is breaking the business logic.The same Event Handler is working on TEST and QA ( 4 node cluster)environments and is not working on PROD environment( 4 node cluster).
    The different thing that was done on was that during the initial recon the event Handler was not present  and after the initial load of the users i have manually executed the database sql query which have updated the "EMAIL_LIST field manually for all the users
    I think  that since during the initial recon as the  EMAIL_LIST was not populated and was  populated  through the SQL update for all the users, the orchestration inter event data does not contain email list, and so it is coming as null.
    But i am seeing the same behavior for new records as well, which are created and  then updated after event handler is registered.
    Please reply, if you have encountered something similar.
    Thnx
    Akshat

    Yes i need the old state, which is
                        Identity[] oldUserStatesIdntArr =
                            (Identity[])(Identity[])interEventData.get("CURRENT_USER");

  • Indesign Events handling in my AIR CS Extension for Indesign

    Hello,
    I wanted to be able, from my indesign extension developped with CS Extension Builder in Actionscript/AIR, to catch the events defined in com.adobe.indesign.Event.* and handle them in this. same extension
    How Am i supposed to do that ? I can't find a way.
    And in the same idea, is it possible to catch an event of the type "when user double click on a frame in an opened indesin document" or anything like that ?
    Here is what i tryed in my actionscript code for a simple AFTER_OPEN event i tried to catch :
    this.app.eventListeners.add(com.adobe.indesign.Event.AFTER_OPEN, afterOpenHandler);
    (where this.app = InDesign.app;)
    and
    private function afterOpenHandler(e:Event):void {
    //handling event code here
    But it was not a real surprise when it drops an error : the add() function doesnt take a simple function name as second parameters like you do in actionscript, but an "Object" or a "javascript function". How Im supposed to handle this event in my actionscript now ? is this only possible ?
    Any thoughts ?
    Thanks in advance for your time !
    Lionel
    PS: I also tried a dozen unsuccessful attempt like Casting my function as an Object Type in the eventListeners.add() arguments and so on....

    Ok, Now i get it. I need to use the Host adapter "CSHA InDesign" to enable this kind of integration ! thanks to this link if anyone has the same questions:
    http://blogs.adobe.com/cssdk/2010/08/makesideheads-a-complete-indesign-cs5-panel-2.html
    Regards

  • SRM event handler creation

    Hi experts,
    we are trying to configure a questionnaire on the SRM.
    We would like to know if it is possible to put control on fields (example: field has to be numeric and of 5 digits. If the vendor writes only 4 digit the quastionnaire should not be sent). Is it possible to create a control by using event handler? How and where do I have to write the function?
    Thanks in advance,
    Regards,
    Riccardo

    Hi Chandra,
    when I have to deal with dependent values I normally do the following:
    Raise a Server Side Event in GET_P method as you did
    In the GET_V method I build up the value help and store it in a global variable on the context node. In the GET_V you have got access to the current entity with collection_wrapper->get_current() --> meaning you can always have the correct value of all the fields and read dependent on them.
    In the implementation class create an event handler that clears the global variable for the dependent value help whenever a new value is selected in the leading field.
    I suppose you have got a similar setup.
    One possibility to circumvent your problem is to skip the step with the global variable. Just shoot the server side event. This leads to a server roundtrip and the valuehelp for the dependent field is calculated again, based on the updated value of the leading field.
    However, this method is not very good for performance! Thus I would normally keep away from it.
    Concerning your problem with the wizard. It is correct that you have to have the view created with the wizard to be able to use it later on. On copied views the wizard does some redefinitions of common methods and it does complain if they are not exactly as it expects them.
    For event handlers I believe this should only be the DO_HANDLE_EVENT in the parent class of your IMPL. Meaning if you inherit from a SAP view inheritance is as follows:   SAP class --> SAP class _IMPL --> Your class --> Your class _IMPL
    The DO_HANDLE_EVENT would have to be in the Your class.
    An easy way would be recreating the view using the wizard (be sure to restart the component workbench after this).
    Another is create the event handler manually. Copy an existing EH_ONXXX method, and add a CASE statement into the DO_HANDLE_EVENT that calls this copied method.
    cheers Carsten

  • Event handler Creation in CRM Webclient UI

    Hi,
    In CRM Webclient UI, we are using service application.
    We have enhanced some fileds through eewb.
    Few of them are dependent dropdowns. on change of one dropdown other dropdown values needs to be loaded.
    To load the values dynamically, In the get_P_XYZ method of the field XYZ , i have raised an event DDLB_ONSELECT.
    I am new to bsp applications. I want to generate event handler for this. I tried to create the event handler using the wizard. But i am getting the error - View not copied with wizard; processing not possible.
    Please guide me how to create an event handler for the corresponding event or solve the error.
    -Chandra Sekhar.

    Hi Chandra,
    when I have to deal with dependent values I normally do the following:
    Raise a Server Side Event in GET_P method as you did
    In the GET_V method I build up the value help and store it in a global variable on the context node. In the GET_V you have got access to the current entity with collection_wrapper->get_current() --> meaning you can always have the correct value of all the fields and read dependent on them.
    In the implementation class create an event handler that clears the global variable for the dependent value help whenever a new value is selected in the leading field.
    I suppose you have got a similar setup.
    One possibility to circumvent your problem is to skip the step with the global variable. Just shoot the server side event. This leads to a server roundtrip and the valuehelp for the dependent field is calculated again, based on the updated value of the leading field.
    However, this method is not very good for performance! Thus I would normally keep away from it.
    Concerning your problem with the wizard. It is correct that you have to have the view created with the wizard to be able to use it later on. On copied views the wizard does some redefinitions of common methods and it does complain if they are not exactly as it expects them.
    For event handlers I believe this should only be the DO_HANDLE_EVENT in the parent class of your IMPL. Meaning if you inherit from a SAP view inheritance is as follows:   SAP class --> SAP class _IMPL --> Your class --> Your class _IMPL
    The DO_HANDLE_EVENT would have to be in the Your class.
    An easy way would be recreating the view using the wizard (be sure to restart the component workbench after this).
    Another is create the event handler manually. Copy an existing EH_ONXXX method, and add a CASE statement into the DO_HANDLE_EVENT that calls this copied method.
    cheers Carsten

  • Labview slider event handling problems - revisited

    This topic asked a question that was very close to a problem I am having:
    Labview slider event handling problems
    That is, how do I, using an event structure and/or other means, only read out the value of a slider control after the value change is finalized?
    The extra constraint I'd like to place on this, which I believe will invalidate the answer given in the thread above, is that my slider control also has a digital display which can also be used to change the value without ever using the mouse. I cannot look for a value change followed by a mouse-up event if the mouse was not used to change the value.
    Any ideas how this might be accomplished? FWIW, I am using LabVIEW 7.0

    Each and every incremental value-change event generated by the movement of the slider is still detected and queued up for use by the event structure and the event structure loop wades through them all before it's done.
    I have come up the attached "fix" (LV v7.0) for this problem. While it is not as clean a solution as I had hoped it would be, it's the best I can manage given what LabVIEW offers me to work with and it does work in the situation where I need to use it.
    Now, within the Finalize Slider Events subVI, I'm keeping track of the most-recent values seen by the subVI, checking to see if they have changed, and reporting out that fact. That gives me a Changed/Not-Changed bit within the event case that I can use to control what code then gets executed. If the event case is just playing catch-up to the real value of the control, I can now see that fact and ignore it.
    In this version I've also dumped the variant output and limited the VI to using DBL values. I decided it added complication to something that was too complicated already and I wanted the output terminals for other purposes anyway (reporting of the correct "OldVal" of the control).Message Edited by Warren Massey on 04-28-2005 03:56 AM
    Attachments:
    slider_events[5].llb ‏77 KB

  • Is it possible to install an event handler on another applicaiton process?

    I'm trying to find a way to capture the Apple Event Print from another application. I'm thinking if possible, I might install an event handler on the application I'm trying to get the event from. I'm doing this because, I currently have written a Safari plugin (Carbon based) that is it's own floating window and not a child of Safari. The plug in is written using the Gecko NPAPI, and I'm looking at doing this to work around the NPP_Print problem I've run into. The print structure I get passed is an old no longer supported structure and because Safari is Cocoa based and I'm not printing through the Cocoa view stuff is not quite feasible.
    I've looked around and I can't figure out how one might get an EventTargetRef for another application process. I do realize that this might not be possible due to security issues.
    Thanks

    I have tried to directly use apple events and an apple event handler instead of a Carbon based Event handler. I never get called for apple events in my plugin. I would imagine that AEInstallEventHandler would install to the Safari application process. Is there something special that is required to do this?

  • SBO2004: Event Handling problems

    Hello, all
    I have noticed a very peculiar thing about the way SBO handles events.
    I wrote a handler for the et_VALIDATE event on an EditText item (Sales Quotation->Customer) which does nothing but waits for two minutes. Then I performed the following experiment:
    Opened a sales quotation from in the Add mode, chose a Customer and added an item. Them I put the cursor into the Cusotmer field and pressed "Add". As a result, my event handler fired, so SBO was "frozen" for two minutes. But when the handler had completed nothing happened. The quotation wasn't added, although I didn't set BubbleEvent to false in the eventhandler.
    However, when I reduced the wait time to 30 seconds in the event handler everything started to work as it should: after completion of the eventhandler the quotation got added.
    Looks like if the handler of the preceding event (VALIDATE) executes for too long the following event (ITEM_PRESSED) may not fire at all...
    I this a correct behavior?
    Thanks in advance,
    Anton
    PS: I was testing in SBO2004

    Please update your system. Version 2004 is no longer supported.
    Hello, Vitor
    I know this, but I can't update soon. So I hope somebody can either confirm this problem or suggest a solution/workaround. But OK, I will check this in SBO2007.
    Anton

  • Pass URL parameters from BSP to WDA for ABAP (via Post   )

    Dear Gurus,/ Joerge,
    I am unable to post my Code here, but with the guidance provided by Joerge i am able to solve this
    i Have been through the Below thread
    Pass URL parameters from WD to BSP via Post
    Dear Gurus,
    "Since I am unable to Post new thread i am Continuing this thread, though this Issue has been
    " resolved,i need some more info on the following issue, Kindly guide me,
    I have gone through the below thread but left with no clue
    Pass URL parameters from WD to BSP via Post
    Here i have 2 Issues
    First one is --->
    " After pressing the Button I am calling this URL which is WDA for ABAP
          action="http://company/sap/bc/webdynpro/sap/zuser"> " I am calling WDA for ABAP URL here
    " Kindly guide me how to pass the Value
    Second one is -->
    " This value need to be passed to the URL above and
    " How to capture the Same in WINDOWINIT method of WDA for ABAP
    " And how to Capture this Value in Webdynpro INIT method
    "Here am using Form and method = post , I am removing this as it is causing some problem while posting
          action= my WDA For ABAP URL here " I am calling WDA for ABAP URL here
    " Kindly guide me how to pass the Value
    " This value need to be passed to the URL above and
    " How to capture the Same in WINDOWINIT method of WDA for ABAP
    Thanks and Regards
    Ramchander Rao.K

    Hi,
    let me see if I understand you well.
    BSP -
    You wrote the code for catching the user name in the event OnCreate, which means that you know who´s working with the BSP application when it starts.
    Somewhere you must have a button or something with text like "Call WDA application". When user presses the button, it triggers events OnInputProcessing. Here you must write the code for the cookie that "sends" the parameter(s), something like:
    CALL METHOD cl_bsp_server_side_cookie=>set_server_cookie
      EXPORTING
        name                  = 'MY_COOKIE'
        application_name      = 'ZUSER_NAME_GET'
        application_namespace = 'ZUSER_NAME_GET'
        username              =  sy-uname
        session_id            = 'SAME_FOR_ALL'
        data_value            = PAGE_DATA
        data_name             = 'PAGE_DATA'
        EXPIRY_TIME_REL       = 3600.
    you call then the URL for the WDA application.
    WDA -
    probably in method WDDOINIT of the component controller you´ll write the code for reading the "content" of the cookie:
    CALL METHOD cl_bsp_server_side_cookie=>get_server_cookie
      EXPORTING
        name                  = 'MY_COOKIE'
        application_name      = 'ZUSER_NAME_GET'
        application_namespace = 'ZUSER_NAME_GET'
        username              =  sy-uname
        session_id            = 'SAME_FOR_ALL'
        data_name             = 'PAGE_DATA'
    CHANGING
        data_value            = PAGE_DATA.
    read more about the cookies in SDN, because I am not sure if this is the correct example for transmiting values. I´ve used it in conjunction of instructions IMPORT and EXPORT for transmiting an internal table.
    if this is not working properly, then try with IMPORT TO MEMORY and EXPORT FROM MEMORY.

  • How to run a dialog's method from a button's event handler?

    I've created my first dialog from the samples, but I am having trouble figuring out how to run a method in my dialog from an button's event handler. Can anyone please point me in the right direction?
    function CreateDialog() 
        this.windowRef = null;
    CreateDialog.prototype.run = function()
        //...declare a bunch of vars
        // Create a window of type palette.
        var win = new Window("dialog", "Element Spray Generator",[iTop,iLeft,iTop + iWidth,iLeft + iHeight] );  // bounds = [left, top, right, bottom] 
        this.windowRef = win;
        // Add a frame for the contents.   
        win.btnPanel = win.add("panel", [iPadding,iPadding,iWidth-iPadding,iHeight-iPadding], "");
        .... add a bunch of other stuff ...
        win.btnAdd = win.btnPanel.add("button", [win.btnRemove.bounds.left - iPadding - iButtonWidth,win.lstImages.bounds.bottom + iSmPadding,win.btnRemove.bounds.left - iPadding,win.lstImages.bounds.bottom + iSmPadding +iTextHeight], "Add");
        win.btnAdd.onClick = function() {
           //todo implement this
           var f = File.openDialog("Open File") ;
           win.lstImages.add("item", f.displayName );
           this.EnableControls();    //<--- problem is on this line here!!
        this.EnableControls();  //<--- this works
        // Display the window
        win.show();
        return true;      
    CreateDialog.prototype.EnableControls = function (){
        var result = true;
        result = result && (this.windowRef.ddlPaths.selection != "");
        result = result && (this.windowRef.lstImages.items.length > 0);
        this.windowRef.btnOK.enabled = result;

    This may not be the reason, but when using the way I create dialogs 'this' inside of an onClick points to the control.
        win.btnAdd.onClick = function() {
           //todo implement this
           var f = File.openDialog("Open File") ;
           win.lstImages.add("item", f.displayName );
           this.EnableControls();    //<--- I would expect it to call another function of btnAdd
                                            // this.parent.EnableControls() might be what you want if the control is not in some other container

  • How to Call Event Handler Method in Another view

    Hi Experts,
                       Can anybody tell me how to call Event handler Method which is declared in View A ,it Should be Called in
      view B,Thanks in Advance.
    Thanks & Regards
    Santhosh

    hi,
    1)    You can make the method EH_ONSELECT as public and static and call this method in viewGS_CM/ADDDOC  using syntax
        impl class name of view GS_CM/DOCTREE=>EH_ONSELECT "method name.
                 or
    2)The view GS_CM/ADDDOC which contains EH_ONSELECT method has been already enhanced, so I can't execute such kind of operation one more time.
                         or
    3)If both views or viewarea containing that view are under same window , then you can get the instance ofGS_CM/DOCTREE from view GS_CM/ADDDOC  through the main window controller.
    lr_window = me->view_manager->get_window_controller( ).
        lv_viewname = 'GS_CM/DOCTREE '.
      lr_viewctrl ?=  lr_window ->get_subcontroller_by_viewname( lv_viewname ).
    Now you can access the method of view GS_CM/DOCTREE .
    Let me know in case you face any issues.
    Message was edited by: Laure Cetin
    Please do not ask for points, this is against the Rules of Engagement: http://scn.sap.com/docs/DOC-18590

  • How to call a static method from an event handler

    Hi,
       I'm trying to call a static method of class I designed.  But I don't know how to do it.  This method will be called from an event handler of a web dynpro for Abap application.
    Can somebody help me?
    Thx in advance.
    Hamza.

    To clearly specify the problem.
    I have a big part code that I use many times in my applications. So I decided to put it in a static method to reuse the code.  but my method calls functions module of HR module.  but just after the declaration ( at the first line of the call function) it thows an exception.  So I can't call my method.

  • How to add event handling for a menu?

    hi,
    I have created a menu and few mneu items.
    for eachmenu itme , i did event handling and it is workign fine.
    it was like this
    menuItem = new JMenuItem("Exit",KeyEvent.VK_X);
    menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
    menuItem.addActionListener(this);
    menu.add(menuItem);
         public void actionPerformed(ActionEvent e)
    JMenuItem source = (JMenuItem)(e.getSource());
    String s = "Action event detected. Event source: " + source.getText();
    System.out.println(s);     
    public void itemStateChanged(ItemEvent e)
    JMenuItem source = (JMenuItem)(e.getSource());
    String s = "Item event detected. Event source: " + source.getText();
    System.out.println(s);
    now int he second menu i don't have any menu item and i want to do the event handling for the menu itself. any ideas how to do it. following is the code for the menu
    //Build the second menu.
    menu2 = new JMenu("Options");
    menu2.setMnemonic(KeyEvent.VK_O);
    menuBar.add(menu2);
    menu2.addActionListener(this);     //this does nto work

    You were on the right track. However, selecting a menu is different from selecting a menu item. MenuItem chucks an ActionEvent and Menu will send an ItemEvent.
    If you pile all action output to one actionPerformed method then be careful of your assumptions on what the source type will be. If by any chance the Menu has sent an ActinoEvent then your code will have caused a ClassCastException.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MenuTest implements ActionListener, ItemListener {
        JMenuItem menuItem;
        JMenu menu1, menu2;
        JMenuBar menubar;
        JFrame frame;
        public MenuTest() {
            frame = new JFrame("MenuTest");
            frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
            menubar = new JMenuBar();
            frame.setJMenuBar(menubar);
            menu1 = new JMenu("File");
            menu1.setMnemonic(KeyEvent.VK_F);
            menuItem = new JMenuItem("Exit",KeyEvent.VK_X);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
            menuItem.addActionListener(this);
            menu1.addItemListener(this);
            menu1.add(menuItem);
            menubar.add(menu1);
            //Build the second menu.
            menu2 = new JMenu("Options");
            menu2.setMnemonic(KeyEvent.VK_O);
            menu2.addActionListener(this); //this does not work
            menu2.addItemListener(this); // use this instead
            menubar.add(menu2);
            JPanel panel = new JPanel();
            panel.setPreferredSize(new Dimension(100,100));
            frame.getContentPane().add(panel);
            frame.pack();
            frame.show();
        public void actionPerformed(ActionEvent e)
            String s = "Action event detected. Event source: " + e.getSource();
            System.out.println(s);
        public void itemStateChanged(ItemEvent e)
            String s = "Item event detected. Event source: " + e.getSource();
            System.out.println(s);
        public static void main(String[] args) {
            new MenuTest();
    }

  • How to pass parameter (tray name) to event handler for Trays?

    Hi,
         I've several UI tray elements in my view and all these elements are associated with the action onToggleTrays.
         I want to capture the name of the Tray and state of tray(expanded/collapsed).
         For this when I try to add parameters to this event handler method, through IWD ParameterPassing, I can add only the expanded property. I'm not able to add the UI element (tray name).
         Can you please suggest how to add/pass tray name and tray state to the event handler method?
    Regards
    Sagar Nanda

    create a parameter for the action OnToggle say "id".
    In wdDoModifyView get the reference of tray element and map its id to this parameter.
    IWDTray tray=(IWDTray)view.getElement("Tray1");
    tray.mappingOfOnToggle().addParameter("id",tray.getId());
    IWDTray tray2=(IWDTray)view.getElement("Tray2");
    tray2.mappingOfOnToggle().addParameter("id",tray2.getId());
    Hope it helps.

  • How to find event handler for save button in salesorders

    Hi,
    I want perform event based on save button in salesorders.Can you tell me how to find the event handler for
    save button.
    Regards,
    Brahmaji

    Brahma,
    you can find the component, view details by doing an F2.
    open the component, the view will be mostly an overview page i.e., the name ends OP etc.,
    But your method name will be mostly EH_ONSAVE, you need to find exact view.
    F2 does not come up properly for overview pages, you have to look into UI config tool preview and make sure sometimes.
    Regards,
    Masood Imrani S.

Maybe you are looking for

  • Error when starting Adobe Bridge

    Everytime I start Adobe Bridge I get a "Adobe Bridge has stopped working" error message.  I have tried uninstalling all of my Adobe apps and reinstalling them.  I have tried launching holding the ctrl key and still get the same error.  I have updated

  • Poor 10 GbE throughput/performance in Server 2008 R2

    I have an issue with proof of concept that I'm running.  I have a Server 2008 R2 backup media server running ARCserve r15 and I'm pulling data off our SAN (8 Gbps FC) and sending it to an EMC/Data Domain unit over an Intel X520 10 GbE adapter (direct

  • Preview a Crystal report prompted for the sa password

    Dear All, When our customer preview a Crystal report, we got a window prompted for the sa password. Even we type in a correct password, it still says wrong password. Only two user computer have this problem. How do I solve it? Regards, Karen

  • Problem creating web service client using WSM Policies

    Hello everyone, I'm trying to make a simple java client to a Web Service secured using a WSM 11gR1 policy (from Soa Suite 11.1.1.2.0). The policy on the server side is oracle/wss11_x509_token_with_message_protection_service_policy which I attached vi

  • Where are my purchased songs??!!

    HElP! I've been at this for a day now. I purchased a song that I liked with a gift card I just recieved. There were a few error messages during and after the purchase, but nothing seemed to be completely wrong. I noticed that 0.99 had been taken off