Enhance standard class with event handler method

In trying to enhance a standard class with a new event handler class, I find that the ECC 6.0 EHP4 system does not appear to recognise the fact the method is an event handler method.  The specific example is a new method to handle the event CL_GUI_ALV_GRID->USER_COMMAND. 
I notice that the flag called Active has not been ticked - see image below.  Perhaps this is the reason why the event handler is not being triggered.
Note that there is an event handler for the same event in the standard class which obviously is executed as expected.  Any ideas on limitations in the system or I am missing a step?
Thanks
John

Thank you for your replies.
There is a bug in the ALV handler of a standard SAP class (when executed in ITS WebGUI) and I was hoping to create a custom event handler as an Enhancement to execute some custom code to sort of "handle the bug". 
I agree - ideally it should be done in a Z class but that will not give me access to the object methods and attributes of the enhanced class.
Cheers,
John

Similar Messages

  • View not copied or enhanced with wizard Error while creating Event Handler method in Z Component

    Hello Friends,
    In one Z Component (Custom Component), in one of the views, while creating event handler, it gave me error message that view not copied or enhanced with wizard.
    I am aware that in Standard Component, if we want to create the event handler method then we need to first Enhance the Component and then we need to enhance the view.
    But, in the Z Component (Custom Component), how to create event handler method in one of the views as while creating event handler method i am getting view not copied or enhanced with wizard error.

    Hi,
    Add a method in views impl class with naming convention eh_on__* with htmt and html_ex parameters.  I dont have have the system right now. Please check any existing event import export parameters.
    Check out do handle event method in the same class.
    Redefine that method.  Call that event method in this handle method. See existing code for reference.
    Attach that event to the button on click event in .htm page.
    Regards,
    Bhushan

  • Enhanced SAP class with new methods - Not showing these from standard task

    Dear Gurus,
    I have enhanced SAP standard class with new methods. After I have activated my new methods and would like to create a workflow task using these new methods. when I create a task and input object category as "ABAP Class" and object type is SAP enhanced class. When I try to drop down for methods SAP is not showing my new methods. I do not know why. Am I missing any? Any help would be appreciated.
    Note: Remember I am trying to use SAP ABAP class custom methods.
    Thanks,
    GSM

    Hi,
    Your thread has had no response since it's creation over
    2 weeks ago, therefore, I recommend that you either:
    - Rephrase the question.
    - Provide additional Information to prompt a response.
    - Close the thread if the answer is already known.
    Thank you for your compliance in this regard.
    Kind regards,
    Siobhan

  • JDEV 10.1.3: Issue with Inherited public event handler methods in beans

    I have a bean validator method which it inherits from another base class.
    I am able to pick this method using the property inspector and it works fine.
    But in the jspx source view, i see a red wiggly line under the expression. Is this a bug or some bizzare way of enforcing some best practice (if using inherited event handler methods in beans is NOT a best practice)?
    The same is true for value change listeners.

    I started from scratch and the problem remains. Only one commandButton can fire an event which sets a variable that controls a af:switcher. The effect is similar to what the "blocking" attribute does but it is set to false on my components. Any ideas, time has already run out.

  • Repetitive call of event handler method

    hi,
           i ve some 8 screens with alv grid controls on each...i'm using
    same subroutine for event handling for all the controls...the problem
    is whenever i navigate from 1 to the other and return back to the same,
    after data change, the event handler method is getting called as many times
    i ve navigated....for toolbar actions i used befor user command event and
    overcame but for data changed i got struck... Plz tel me the reason and how can we avoid.....
    Thanks
    Swaminathan.

    Hello Swami
    The following sample report shows how to handle the same event for different control instances. The crucial point is to check for the sending control.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender.       " sending control !!!
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    *   define local data
        DATA:
          ls_knb1     TYPE knb1,
          ls_col_id   TYPE lvc_s_col.
        CASE sender.  " check for the sending control (this is known!!!)
          WHEN go_grid1.
            READ TABLE gt_customer1 INTO ls_knb1 INDEX e_row_id-index.
            MESSAGE 'Do event handling for 1st ALV grid!' TYPE 'I'.
          WHEN go_grid2.
            READ TABLE gt_customer2 INTO ls_knb1 INDEX e_row_id-index.
            MESSAGE 'Do event handling for 2nd ALV grid!' TYPE 'I'.
          WHEN OTHERS.
            RETURN.
        ENDCASE.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    The sample report contains two screens showing two parts of the selected data (just for demonstration). Please do note that it does not matter at all whether the ALV lists are on the same screen or on different screens or whether they are displayed in subscreens of the same dynpro.
    *& Report  ZUS_SDN_ALVGRID_EVENTS_4
    * Both screens have the same flow logic and do not contain any elements:
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    REPORT  ZUS_SDN_ALVGRID_EVENTS_4.
    DATA:
      gd_okcode        TYPE ui_func,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking1      TYPE REF TO cl_gui_docking_container,
      go_docking2      TYPE REF TO cl_gui_docking_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_customer1     TYPE STANDARD TABLE OF knb1,
      gt_customer2     TYPE STANDARD TABLE OF knb1.
    PARAMETERS:
      p_bukrs      TYPE bukrs  DEFAULT '2000'  OBLIGATORY.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid
            IMPORTING
              e_row_id
              e_column_id
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_hotspot_click.
    *   define local data
        DATA:
          ls_knb1     TYPE knb1,
          ls_col_id   TYPE lvc_s_col.
        CASE sender.
          WHEN go_grid1.
            READ TABLE gt_customer1 INTO ls_knb1 INDEX e_row_id-index.
            MESSAGE 'Do event handling for 1st ALV grid!' TYPE 'I'.
          WHEN go_grid2.
            READ TABLE gt_customer2 INTO ls_knb1 INDEX e_row_id-index.
            MESSAGE 'Do event handling for 2nd ALV grid!' TYPE 'I'.
          WHEN OTHERS.
            RETURN.
        ENDCASE.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        CASE e_column_id-fieldname.
          WHEN 'KUNNR'.
            SET PARAMETER ID 'KUN' FIELD ls_knb1-kunnr.
            SET PARAMETER ID 'BUK' FIELD ls_knb1-bukrs.
            CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
          WHEN 'ERNAM'.
    *        SET PARAMETER ID 'USR' FIELD ls_knb1-ernam.
    *        NOTE: no parameter id available, yet simply show the priciple
            CALL TRANSACTION 'SU01' AND SKIP FIRST SCREEN.
          WHEN OTHERS.
    *       do nothing
        ENDCASE.
    *   Set active cell to field BUKRS otherwise the focus is still on
    *   field KUNNR which will always raise event HOTSPOT_CLICK
        ls_col_id-fieldname = 'BUKRS'.
        CALL METHOD go_grid1->set_current_cell_via_id
          EXPORTING
            is_row_id    = e_row_id
            is_column_id = ls_col_id.
      ENDMETHOD.                    "handle_hotspot_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT * FROM  knb1 INTO TABLE gt_customer1
             WHERE  bukrs  = p_bukrs
             AND    kunnr  <= '0000300000'.
      SELECT * FROM  knb1 INTO TABLE gt_customer2
             WHERE  bukrs  = p_bukrs
             AND    kunnr  > '0000300000'.
    * Create docking container
      CREATE OBJECT go_docking1
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_docking2
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_docking1
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent          = go_docking2
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_hotspot_click FOR ALL INSTANCES.
    * Build fieldcatalog and set hotspot for field KUNNR
      PERFORM build_fieldcatalog_knb1.
    * Display data
      CALL METHOD go_grid1->set_table_for_first_display
        CHANGING
          it_outtab       = gt_customer1
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL METHOD go_grid2->set_table_for_first_display
        CHANGING
          it_outtab       = gt_customer2
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking1->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL METHOD go_docking2->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0200'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          CASE syst-dynnr.
            WHEN '0100'.
              SET SCREEN 0. LEAVE SCREEN.
            WHEN '0200'.
              SET SCREEN 100. LEAVE SCREEN.
          ENDCASE.
        WHEN 'NEXT'.
          SET SCREEN 200. LEAVE SCREEN.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG_KNB1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog_knb1 .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNB1'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT gt_fcat INTO ls_fcat
              WHERE ( fieldname = 'KUNNR'  OR
                      fieldname = 'ERNAM' ).
        ls_fcat-hotspot = abap_true.
        MODIFY gt_fcat FROM ls_fcat.
      ENDLOOP.
    ENDFORM.                    " BUILD_FIELDCATALOG_KNB1
    Regards
      Uwe

  • Problem with event handling

    Hello all,
    I have a problem with event handling. I have two buttons in my GUI application with the same name.They are instance variables of two different objects of the same class and are put together in the one GUI.And their actionlisteners are registered with the same GUI. How can I differentiate between these two buttons?
    To be more eloborate here is a basic definition of my classes
    class SystemPanel{
             SystemPanel(FTP ftp){ app = ftp};
             FTP app;
             private JButton b = new JButton("ChgDir");
            b.addActionListener(app);
    class FTP extends JFrame implements ActionListener{
               SystemPanel rem = new SystemPanel(this);
               SystemPanel loc = new SystemPanel(this);
               FTP(){
                       add(rem);
                       add(loc);
                       pack();
                       show();
           void actionPerformed(ActionEvent evt){
            /*HOW WILL I BE ABLE TO KNOW WHICH BUTTON WAS PRESSED AS THEY
               BOTH HAVE SAME ID AND getSouce() ?
               In this case..it if was from rem or loc ?
    }  It would be really helpful if anyone could help me in this regard..
    Thanks
    Hari Vigensh

    Hi levi,
    Thankx..
    I solved the problem ..using same concept but in a different way..
    One thing i wanted to make clear is that the two buttons are in the SAME CLASS and i am forming 2 different objects of the SAME class and then putting them in a GUI.THERE IS NO b and C. there is just two instances of b which belong to the SAME CLASS..
    So the code
    private JButton b = new JButton("ChgDir");
    b.setActionCommand ("1");
    wont work as both the instances would have the label "ChgDir" and have setActionCommand set to 1!!!!
    Actually I have an array of buttons..So I solved the prob by writting a function caled setActionCmdRemote that would just set the action commands of one object of the class differently ..here is the code
    public void setActionCommandsRemote()
         for(int i = 0 ; i <cmdButtons.length ; i++)
         cmdButtons.setActionCommand((cmdButtons[i].getText())+"Rem");
    This just adds "rem" to the existing Actioncommand and i check it as folows in my actionperformed method
         if(button.getActionCommand().equals("DeleteRem") )          
                        deleteFileRemote();
          else if(button.getActionCommand().equals("Delete") )
                     deleteFileLocal();Anyway thanx a milion for your help..this was my first posting and I was glad to get a prompt reply!!!

  • 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

  • Which are the standard classes for events in ALV and explain each class pls

    which are the standard classes for events in ALV and explain each class pls
    POINTS WILL BE AWARDED,
    REGARDS,
    jagrut bharatkumar Shukla

    hi,
    some links.
    www.sapgenie.com
    www.abap4u.com
    http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
    download the PDF from following link.
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    The ALV object Grid methods allow the same functionality as ALV grid report function modules but are displayed within
    a screen (dialog program). SAP has provided a suit of programs which demonstrate how to For examples see standard SAP
    programs as detailed below:
    BCALV_EDIT_01 This report illustrates the simplest case of using an editable/noneditable ALV Grid Control.
    BCALV_EDIT_02 This report illustrates how to set chosen cells of an ALV Grid Control editable.
    BCALV_EDIT_03 In this example the user may change values of fields SEATSOCC (occupied seats) and/or PLANETYPE.
    The report checks the input value(s) semantically and provides protocol messages in case of error
    BCALV_EDIT_04 This report illustrates how to add and remove lines to a table using the ALV Grid Control and how to
    implement the saving of the new data.
    BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:
         (1) how to define a column for editable checkboxes for an attribute of your list
         (2) how to evaluate the checked checkboxes
         (3) how to switch between editable and non-editable checkboxes
    BCALV_EDIT_06 This example shows how to define a dropdown listbox for all cells of one column in an editable ALV
    Grid Control.
    BCALV_EDIT_07 This example shows how to define dropdown listboxes for particular cells of your output table.
    BCALV_EDIT_08 This report implements an ALV Grid Control with an application specific F4 help. The following aspects
    are dealt with:
         (1) how to replace the standard f4 help
         (2) how to pass the selected value to the ALV Grid Control
         (3) how to build an f4 help, whose value range depend on a value of another cell.
    Rgds
    Anversha

  • Event handler method

    Hi all,
    I want to know the significance of creating event handler method in Class builder.
    and how it can be used at the time of event trigger.( Is it called automatically or programmer need to call it explicitly in the program.)
    Thanks,
    Sushant singh

    Hi Sushant,
    1. In ABAP Objects, triggering and handling an event means that certain methods act as triggers and trigger events, to which other methods - the handlers - react. This means that the handler methods are executed when the event occurs.
    2.To trigger an event, a class must
      Declare the event in its declaration part
      Trigger the event in one of its methods
    3.You declare events in the declaration part of a class or in an interface. To declare instance events, use the following statement:
    EVENTS evt EXPORTING... VALUE(e1 e2 ...) TYPE type [OPTIONAL]..
    4. An instance event in a class can be triggered by any instance method in the class. Static events can be triggered by any method. However, static methods can only trigger static events. To trigger an event in a method, use the following statement:
    RAISE EVENT evt EXPORTING e1 = f1  e2 = f2 ...
    5. Events are handled using special methods. To handle an event, a method must
          be defined as an event handler method for that event
          be registered at runtime for the event.
    Declaring Event Handler Methods
    Any class can contain event handler methods for events from other classes. You can, of course, also define event handler methods in the same class as the event itself. To declare an event handler method, use the following statement:
    METHODS meth FOR EVENT evt OF cif IMPORTING e1 e2 ...
    6. Registering Event Handler Methods
    To allow an event handler method to react to an event, you must determine at runtime the trigger to which it is to react. You can do this with the following statement:
    SET HANDLER h1 h2 ... [FOR]...
    It links a list of handler methods with corresponding trigger methods. There are four different types of event.
    7. Timing of Event Handling
    After the RAISE EVENTstatement, all registered handler methods are executed before the next statement is processed (synchronous event handling). If a handler method itself triggers events, its handler methods are executed before the original handler method continues. To avoid the possibility of endless recursion, events may currently only be nested 64 deep.
    Handler methods are executed in the order in which they were registered. Since event handlers are registered dynamically, you should not assume that they will be processed in a particular order. Instead, you should program as though all event handlers will be executed simultaneously.
    Reward if useful.

  • Accessing exception information in an event handler method

    Hi,
    I am trying to handle an event thrown by a fatal exception. I am able to capture the event in this event handler method. However, I need to access the PREVIOUS of the exception in this event handler method and am not sure how to do it.
    Can some one please help with this?
    Thanks
    Saravanan.

    Hi,
    Look at this code end check if your program works in the similar way.
    Here, i'm changing an atribute from one class from other class.
    If it doesn't works and you can't change an atribute directelly,  i  really don't know other way to do this.
          CLASS main DEFINITION
    CLASS main DEFINITION.
      PUBLIC SECTION.
        EVENTS evt EXPORTING value(e_data) TYPE char01.
        METHODS event_trigger.
        METHODS set_data IMPORTING i_data TYPE char01.
      PRIVATE SECTION.
        DATA v_data TYPE char01 VALUE 'X'.
    ENDCLASS.
          CLASS main IMPLEMENTATION
    CLASS main IMPLEMENTATION.
      METHOD event_trigger.
        RAISE EVENT evt EXPORTING e_data = v_data.
      ENDMETHOD.
      METHOD set_data.
        MOVE i_data TO v_data.
        WRITE: / 'New v_data value ->', v_data.
      ENDMETHOD.
    ENDCLASS.
          CLASS second DEFINITION
    CLASS second DEFINITION.
      PUBLIC SECTION.
        METHODS event_handler FOR EVENT evt OF main IMPORTING e_data sender.
    ENDCLASS.
          CLASS second IMPLEMENTATION
    CLASS second  IMPLEMENTATION.
      METHOD event_handler.
        WRITE: 'v_data value ->', e_data.
        CALL METHOD sender->set_data( i_data = 'Y' ).
      ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
      DATA: obj_main   TYPE REF TO main.
      DATA: obj_second TYPE REF TO second.
      CREATE OBJECT: obj_main, obj_second.
      SET HANDLER obj_second->event_handler FOR obj_main.
      call method obj_main->event_trigger( ).
    Regards.
    Marcelo Ramos

  • Handling exceptions for a event handler method.

    Hi Mates,
                    I have two custom container in which i am displaying an alv grid usind objects. when a double click event is performed in one of the alv the other alv should be displayed. I now have to handle exceptions of the class  CX_SY_DYN_CALL_ILLEGAL_TYPE. This is raised for an invalid parameter type when calling a method dynamically. I cannot use the keyword "RAISING" in the definition of the event handler method. i checked with the syntax of the method definition in abap dictionary, there were no addition "RAISING" for an event handler method. please provide me with the solution (a sample code would do.)

    Hello,
    May be you should read about the TRY ... CATCH block which is used for handling exceptions.
    Basic construct of your code should look like this:
    TRY.
    " Your Dynamic Method call
      CATCH CX_SY_DYN_CALL_ILLEGAL_TYPE.
    ENDTRY.
    If you want to get the error message text:
    DATA:
    lcx_excp TYPE REF TO CX_SY_DYN_CALL_ILLEGAL_TYPE,
    v_err_msg TYPE string.
    TRY.
    " Your Dynamic Method call
      CATCH CX_SY_DYN_CALL_ILLEGAL_TYPE INTO lcx_excp.
      v_err_msg = lcx_excp->get_text( ).
    ENDTRY.

  • Is there any way to send value to my attribute through event handler method

    While I give value to the img array it does not print while I call object for this class. Is there any way that I could give value for img attribute
    // Attribute
    public var img:Array;
    // Constructor
    public function ReadXML(myfile:String) {
                img=new Array();
                xmlFile=myfile;
                var loader:URLLoader=new URLLoader;
                var url:URLRequest=new URLRequest(xmlFile);
                loader.addEventListener(Event.COMPLETE,onXMLLoad);
                loader.load(url);
    // Event handling Method
            function onXMLLoad(event:Event):Array {
                var xml:XML=new XML(event.target.data);
                //trace(xml);
                //trace("Number of Contacts : " + xml..person.length());
                //trace("First contact’s favorite food : " + xml.contacts.person[0].@favoriteFood);
                img["height"]=100;
                img["width"]=200;
                return img;

    what are you trying to do?
    if img has anything to do with an image, explain.
    if img is supposed to be an associate array, use:
    var img:Object;
    img=new Object();
    etc

  • Populating database tables in event handler method - error

    Friends,
    I am trying to insert values into ztable in an event handler method in a WDA application.
    This is the code. ZDATA1 is a ztable with two fields: MANDT and ZKTOKD of data element char01.
    types: begin of zs,
    zktokd type char01,
    end of zs.
    data: zitab type table of zs,
    zstruct like line of zitab.
    zstruct-zktokd =  's'.
    append zstruct to zitab.
    INSERT zdata1 FROM TABLE zitab.
    I am getting the error: "The Work area "ZITAB" is not long enough...
    Please let me know what is missing.
    Thanks and Regards.

    Hi,
    The error is here
    types: begin of zs,
    zktokd type char01,
    end of zs.
    data: zitab type table of zs ,
    zstruct like line of zitab.
    "passed the Internal table name which is wrong
    Correct one
    data:
    zitab type table of zs,
    zstruct like line of ZS. " Here we have to give the type you have declared above.
                                    " Zstruct acts like a workarea.
    Regards
    Lekha

  • Migration from Serial polling to Serial queue with event handler

    Hi, I am trying to migrate from classical serial polling communications to serial queue with "event handler" for the buttons pressed by the user. I have placed four while loops, one for the event handler, a second one for serial reading, a third one for serial writing (depending on what button was pressed) and the last one for processing what was read from the serial reading while loop, via a queue.
    My attached device reads the signals from 8 sensor ( 4 temperature and another 4 temperature plus humidity in the same sensor ) and send them via serial to Lavbiew.
    First of all, only once just after running the LV program, I must turn on my attached device with an ON command plus a carriage return after that the device will respond with the number of sensors plugged to it, disabling the corresponding buttons in the front panel. Then labview must wait until I pressed Acquire Button (event handler) and send a CF command plus what sensors to acquire plus a carriage return, then the device will respond continuously to labview with the sensor readings until I press the stop button (event handler), there is also another button to exit the program, also with event handler.
    I am having problems using the event handler and the queues because I am new using these structures, I have looked at  the LV examples but there is nothing concrete on using serial with event handler and queue.
    Take a look at my VI and you will soon notice what kind of problems I am having, any suggestions will welcome.
    Thank's in advance.
    Regards.
    Attachments:
    serial queue.zip ‏76 KB

    Hi Luisete,
    Maybe the problem arise because you are En- and DeQueue in parallel. You do a lot of things in parallel, that is nice if you are sure that one loop doesn't have to wait for another loop. Make sure you don't dequeue before enqueue.
    Hope this helps
    I never knew that the standard error cluster output could be wired directly to the loop control of a while loop.
    First time I see this

  • Need Help with Event Handler Code - Doesnt come up in Event Handler Manager

    Hello there,
    Below is the code snippet that I am using to create a event handler:
    package com.oracle.events;
    import com.thortech.util.logging.Logger;
    import com.thortech.xl.client.events.tcBaseEvent;
    import com.thortech.xl.dataobj.tcDataObj;
    import com.thortech.xl.util.logging.LoggerModules;
    public class tcCheckOvrallProvStatusUDFs extends tcBaseEvent
         private static Logger logger = Logger.getLogger(LoggerModules.XL_JAVA_CLIENT);
         public tcCheckOvrallProvStatusUDFs()
              setEventName("Generating tcCheckOvrallProvStatusUDFs");
    * @Override
    * @throws Exception
         protected void implementation() throws Exception {
              tcDataObj data = getDataObject();
              String OIDProvStatus = data.getString("usr_udf_oidusrprovstatus");
    String EBSProvStatus = data.getString("usr_udf_ebstcausrprovstatus");
              if (OIDProvStatus.equals("Provisioned") && EBSProvStatus.equals("Provisioned")) {
                   setOverAllProvStatus(data);
         * @param data
         * @throws Exception
         private void setOverAllProvStatus(tcDataObj data) throws Exception
              data.setString("usr_udf_ovrrscprovstatus", "Provisioned");
    Its a simple code that I am using to populate value of a UDF field depending on the value of other 2 fields. I want to trigger it on Post-Insert and Post-Update events.
    But even if I restart the OIM server after placing the successfully compiled file (0 errors, 0 warnings) into the EventHandlers folder of OIM_HOME; it doesnt show up in the Design Console -> Development Tools -> Business Rule Definition -> Event Handler Manager. :( In order to create a event handler i need that file to show up in the lookup of event handlers/adapters. This JAR file doesnt come up over there.
    Is there anything missing within the code ?
    What else needs to be specified?
    Please provide some guidance.
    Thanks,
    - jhb.

    Now I have placed this JAR file in JAVATasks folder - made an entity adapter - in the event handler manager - i gave the class name/event handler name as 'setUDFValue' and the package as 'project5'. But now im getting it 'DOBJ.EVT_NOT_FOUND - Event Handler not found' error.
    package project5;
    import java.util.Hashtable;
    import Thor.API.Exceptions.tcAPIException;
    import java.util.Hashtable;
    import java.util.HashMap;
    import com.thortech.xl.util.config.ConfigurationClient;
    import Thor.API.tcResultSet;
    import Thor.API.tcUtilityFactory;
    import Thor.API.Operations.tcUserOperationsIntf;
    import java.lang.System;
    import Thor.API.Exceptions.tcUserNotFoundException;
    import java.util.Properties;
    import javax.mail.Message;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
    public class setUDFValue {
    private static final String SMTP_HOST_NAME="mail.smtp.host";
    public setUDFValue() {
    // public static void main(String[] args) {
    // setUDFValue.setvalue("jatinbhatt");
    // setUDFValue.sendemail("[email protected]","[email protected]");
    public static void setvalue(String UserID) {   
    try
    System.setProperty("XL.HomeDir", "F:/oim/oimserver/xellerate");
    System.setProperty("log4j.configuration",
    "F:/oim/oimserver/xellerate/config/log.properties");
    System.setProperty("java.security.policy",
    "F:/oim/oimserver/xellerate/config/xl.policy");
    System.setProperty("java.security.auth.login.config",
    "F:/oim/oimserver/xellerate/config/auth.conf");
    System.out.println("Startup...");
    System.out.println("Getting configuration...");
    ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    System.out.println("Login...");
    Hashtable env = config.getAllSettings();
    tcUtilityFactory ioUtilityFactory = new tcUtilityFactory(env,"xelsysadm","oimadmin1");
    System.out.println("Getting utility interfaces...");
    tcUserOperationsIntf moUserUtility = (tcUserOperationsIntf)ioUtilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
    HashMap userMap = new HashMap();
    String str1 = null;
    String str2 = null;
    userMap.put("Users.User ID",UserID);
    userMap.put("Users.Status", "Active");
    tcResultSet userResultSet = null;
    try {
    userResultSet = moUserUtility.findAllUsers(userMap);
    } catch (tcAPIException e2) {
    // TODO Auto-generated catch block
    e2.printStackTrace();
    for (int i=0; i<userResultSet.getRowCount(); i++)
    userResultSet.goToRow(i);
    str1 = userResultSet.getStringValue("USR_UDF_OIDUSERPROV");
    str2 = userResultSet.getStringValue("USR_UDF_EBSUSERPROV");
    // System.out.println(userResultSet.getStringValue("USR_UDF_OIDUSERPROV"));
    // System.out.println(userResultSet.getStringValue("USR_UDF_EBSUSERPROV"));
    if (str1.equals("Provisioned") && (str2.equals("Provisioned") || str2.equals("NA")))
    userMap.put("USR_UDF_OVRRSCPROVSTATUS","Provisioned");
    moUserUtility.updateUser(userResultSet,userMap);
    moUserUtility.close();
    }catch (Exception e){
    e.printStackTrace();
    ERROR:
    ERROR RMICallHandler-63 XELLERATE.SERVER - Class/Method: tcDataObj/ runEvent encounter some problems: project5.setUDFValue
    java.lang.ClassCastException: project5.setUDFValue
         at com.thortech.xl.dataobj.tcDataObj.runEvent(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.eventPostUpdate(Unknown Source)
         at com.thortech.xl.dataobj.tcUSR.eventPostUpdate(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.update(Unknown Source)
         at com.thortech.xl.dataobj.tcDataObj.save(Unknown Source)
         at com.thortech.xl.dataobj.tcTableDataObj.save(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUserData(Unknown Source)
         at com.thortech.xl.ejb.beansimpl.tcUserOperationsBean.updateUser(Unknown Source)
         at com.thortech.xl.ejb.beans.tcUserOperationsSession.updateUser(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.SecurityRoleInterceptor.invoke(SecurityRoleInterceptor.java:47)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
         at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
         at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
         at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:87)
         at tcUserOperations_RemoteProxy_6ocop18.updateUser(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.evermind.server.rmi.RmiMethodCall.run(RmiMethodCall.java:53)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    Thanks,
    - jhb.

Maybe you are looking for

  • Dual Boot Predicament

    Hello all. I have found myself in a pickle. I have a 2011 MacBook Air, 64GB Flash Storage, 2GB Ram, running OS X 10.8.3 Mountain Lion. I would really like to be able to have windows on my mac for certain things (Trust me,OS X is 1000000% better than

  • Questions and email

    Why am I getting email with questions that I have not the slightest idea about what they are. I have no idea how my email is being used for questions. I dont know who to address this to so I randomly picked this. PLease help me with this problem. I a

  • How to Stop Dreamweaver CC Obtrusive Dialogs

    Issue: Dreamweaver dialogs (e.g. search, background activity, search) always remain on top of the GUI stack on Mac. Description: While I'm waiting for files to upload/download, I often wish to browse the Internet or work in another application. Unfor

  • Oracle VM VirtualBox

    Hi everyone........ I am trying to do a little bit of mac testing on my mac. I want to set up a virtual mac on my mac. Does anybody know how to do it? I have the install dvd. Thanks. Chris

  • DVD player starts up when no disc inserted

    Hi, this might be an easy to fix problem but i'm clueless as how to fix it. When I boot up my Macbook Pro, the DVD player loads up whether there is a disc in or not. This has never happened before and has only started since I lent out the laptop to a