Alv..handling at new event in ALV

Hi,
I have a problem in ALV. In the report I have to sum up the cols displaying Sales Order and the col displaying P.O #. However while summing for the same sales order there is a one to one correspondence with the P.O
eg . SO #        PO #
     3301        1000
     3301        1000
     3301        1000
SO Total = 3    PO Total =3
However I want the PO # count to be 1. I have handeled this in a simple Abap report using the event at new vbeln po cnt = po cnt + 1.
Could you please tell me how to handle this in ALV.
Thanks..

hi arup,
  you can handle this in your itab itself..
   where you can add an additional po_count field..
data : begin of itab occurs 0.
       include structure vbap.
data : po_count type i,
       end of itab.
loop at itab.
  at new vbeln.
    itab-po_count = 1.
    modify itab .
    continue.
  endat.
    itab-po_count = 0.
     modify itab .
  endloop
this will add a one to all the new Sales orders in po_count and zero to all the repetitive ones..
something like this..
so#  po# po_count
3301 1000 1
3301 1000 0
3301 1000 0
3302 1000 1
3302 .... 0
you can then sum this field using the ALV option to get the result
i.e in the field cat use.
  do_sum = 'X'. on the po_count field
...this one worked well for me..
hope this helps you.
regards
satesh

Similar Messages

  • How create & handle a new event

    Hi guy,
    i've to create and handle a new event.
    how can I do it ? what classes or interfaces have I to extend and create to do it ?
    where can I find something usefull?
    THX

    Please do not cross-post!

  • ABAP WebDynpro: Handling the ON_ENTER Event in editable ALVs

    Sub: ABAP WebDynpro : Handling the ON_ENTER Event in editable ALVs
    Hi,
    I would like to know if there exists an event to handle TABout (i.e, when user navigates out of the cell with a TAB key-press) for a cell of an editable ALV.
    Alternatively, any help on how to handle ON_ENTER event and how it is triggered when data is entered by user into a cell of an editable ALV, would be really appreciated.
    Thanks,
    Adithya

    Hi
    I had one similar problem where user enter something into the editable cell and press enter. to handle this scenario i used WDDOBEFOREACTION  method of my view to call alv interface method check_data.
    if there is any change in the any table cell, it will fire an event on_data_check..which has paramater column name, row index and new and old value of the cell.
    you can handle this event and write your business logic in event handler method.
    hope it will help
    Regards
    Saurabh Garg

  • Handling double click event in oops alv

    I need to write a interactive alv where,can any one help me in handling double click event using oops.

    Hello,
    Demo program on interactive ALV using OOPS
    REPORT  ZALV_OOINTERACTIVE.*Class definition for handling double click
    CLASS event_class DEFINITION DEFERRED.*Internal table and work area declarations for dd02l and dd03l
    DATA : it_dd02l TYPE TABLE OF dd02l,
           wa_dd02l TYPE dd02l,
           it_dd03l TYPE TABLE OF dd03l,
           wa_dd03l TYPE dd03l.*data declarations for ALV Main list
    DATA : ty_lay1 TYPE lvc_s_layo,
           it_fieldcat TYPE lvc_t_fcat ,
           ty_fieldcat TYPE lvc_s_fcat ,
           c_alv1 TYPE REF TO cl_gui_alv_grid,
           c_cont1 TYPE REF TO cl_gui_custom_container,
           event_receiver TYPE REF TO event_class.*data declarations for ALV Interactive listDATA : ty_lay2 TYPE lvc_s_layo,
           it_fcat TYPE lvc_t_fcat ,
           ty_fcat TYPE lvc_s_fcat ,
           c_alv2 TYPE REF TO cl_gui_alv_grid,
           c_cont2 TYPE REF TO cl_gui_custom_container.
    **Select options for multiple values and NOT ranges
    SELECT-OPTIONS : s_table FOR wa_dd02l-tabname NO INTERVALS.
    Initialization event
    INITIALIZATION.*Start of selection event
    START-OF-SELECTION.*fetch data into table and field characteristics
      PERFORM fetch_data.*ALV display for output
      PERFORM alv_output.&----
    *&      Form  FETCH_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM fetch_data .*Select the table details
      SELECT * FROM dd02l INTO CORRESPONDING FIELDS OF TABLE it_dd02l 
    WHERE tabname IN s_table
      AND tabclass = 'TRANSP'.
    ENDFORM.                    " FETCH_DATA----* CLASS lcl_event_receiver DEFINITION----CLASS event_class DEFINITION.*Handling double click
      PUBLIC SECTION.    METHODS:
        handle_double_click
        FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row .ENDCLASS. "lcl_event_receiver DEFINITION
    ----* CLASS lcl_event_receiver IMPLEMENTATION
    ----CLASS event_class IMPLEMENTATION.  METHOD handle_double_click.    DATA : ls_dd02l LIKE LINE OF it_dd02l.*Reading the selected data into a variable
        READ TABLE it_dd02l INDEX e_row-index INTO ls_dd02l.*  *Select the field details of the selected table
        SELECT * FROM dd03l INTO CORRESPONDING FIELDS OF TABLE it_dd03l
        WHERE tabname EQ ls_dd02l-tabname.
    *calling the ALV containing the field values
        CALL SCREEN 101.  ENDMETHOD. "handle_double_clickENDCLASS. "lcl_event_receiver IMPLEMENTATION&----& Module pbo_100 OUTPUT&----
    *MODULE pbo_100 OUTPUT.
    *set pf-status 'XXX'.
    *set titlebar 'XXX'.
    ENDMODULE. " PBO_100 OUTPUT
    *& Module alv_100 OUTPUT
    &----MODULE alv_100 OUTPUT.*Check if there is no custom container in screen 100
      IF c_cont1 IS INITIAL.*Creating object of container
        CREATE OBJECT c_cont1
         EXPORTING
           container_name = 'CCONT'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*Creating object of alv
        CREATE OBJECT c_alv1
           EXPORTING
            i_parent = c_cont1.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*alv layout
        PERFORM alv_100_layout.*alv field catalogue
        PERFORM alv_100_fieldcat.*Displaying the ALV grid
        CALL METHOD c_alv1->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay1
          CHANGING
            it_outtab       = it_dd02l[]
            it_fieldcatalog = it_fieldcat.    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 of the event class and setting handler for double click
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_double_click FOR c_alv1.  ENDIF.ENDMODULE. " ALV_100 OUTPUT&----& Module pai_100 INPUT&----
    *MODULE pai_100 INPUT.
    ENDMODULE. " pai_100 INPUT----* MODULE PBO_101 OUTPUT----MODULE pbo_101 OUTPUT.
    SET PF-STATUS 'XXX'.
    SET TITLEBAR 'XXX'.
    ENDMODULE. " PBO_101 INPUT----* MODULE ALV_101 OUTPUT----
    MODULE alv_101 OUTPUT.
    *Check if the Custom container exists.
      IF c_cont2 IS INITIAL.*Creating container object
        CREATE OBJECT c_cont2
          EXPORTING
            container_name = 'CDCONT'.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*creating ALV grid for interactive list
        CREATE OBJECT c_alv2
          EXPORTING
           i_parent = c_cont2.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.*ALV layout
        PERFORM alv_101_layout.*ALV fieldcatalogue
        PERFORM alv_101_fieldcat.*Sorting the output by field position
        SORT it_dd03l BY position.*ALV for display field details
        CALL METHOD c_alv2->set_table_for_first_display
          EXPORTING
            is_layout       = ty_lay2
          CHANGING
            it_outtab       = it_dd03l[]
            it_fieldcatalog = it_fcat.
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.  ENDIF.ENDMODULE. " ALV_101 OUTPUT
    &----& Module PAI_101 INPUT&----
    *MODULE pai_101 INPUT.ENDMODULE. " PAI_101 INPUT
    *&      Form  ALV_OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_output .
      CALL SCREEN 100.ENDFORM.                    " ALV_OUTPUT
    *&      Form  ALV_100_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_layout .  ty_lay1-grid_title = 'TABLES'.
      ty_lay1-zebra = 'X'.
      ty_lay1-no_toolbar = 'X'.ENDFORM.                    " ALV_100_LAYOUT
    *&      Form  ALV_100_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_100_fieldcat .
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 1.
      ty_fieldcat-fieldname = 'TABNAME'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'TableName'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 2.
      ty_fieldcat-fieldname = 'TABCLASS'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'CATEGORY'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 3.
      ty_fieldcat-fieldname = 'AS4USER'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'CREATED'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 4.
      ty_fieldcat-fieldname = 'AS4DATE'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'DATE'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.
      ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 5.
      ty_fieldcat-fieldname = 'AS4TIME'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'TIME'.
      ty_fieldcat-outputlen = 10.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.  ty_fieldcat-row_pos = 1.
      ty_fieldcat-col_pos = 6.
      ty_fieldcat-fieldname = 'CONTFLAG'.
      ty_fieldcat-tabname = 'GT_DD02L'.
      ty_fieldcat-coltext = 'Delivery Class'.
      ty_fieldcat-outputlen = 15.
      APPEND ty_fieldcat TO it_fieldcat.
      CLEAR ty_fieldcat.ENDFORM.                    " ALV_100_FIELDCAT
    *&      Form  ALV_101_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_layout .  ty_lay2-grid_title = 'FIELDS'.
      ty_lay2-zebra = 'X'.
      ty_lay2-no_toolbar = 'X'.ENDFORM.                    " ALV_101_LAYOUT
    *&      Form  ALV_101_FIELDCAT
          text
    -->  p1        text
    <--  p2        text
    FORM alv_101_fieldcat .  REFRESH it_fieldcat.
      REFRESH it_fcat.
      CLEAR ty_fcat.  ty_fcat-row_pos = 1.
      ty_fcat-col_pos = 1.
      ty_fcat-fieldname = 'FIELDNAME'.
      ty_fcat-tabname = 'GT_DD03L'.
      ty_fcat-coltext = 'Fieldname'.
      ty_fcat-outputlen = 10.
      APPEND ty_fcat TO it_fcat.
      ty_fcat-row_pos = 1.
      ty_fcat-col_pos = 2.
      ty_fcat-fieldname = 'CHECKTABLE'.
      ty_fcat-tabname = 'GT_DD03L'.
      ty_fcat-coltext = 'CHECKTABLE'.
      ty_fcat-outputlen = 10.
      APPEND ty_fcat TO it_fcat.  ty_fcat-row_pos = 1.
      ty_fcat-col_pos = 3.
      ty_fcat-fieldname = 'KEYFLAG'.
      ty_fcat-tabname = 'GT_DD03L'.
      ty_fcat-coltext = 'Key Flag'.
      ty_fcat-outputlen = 10.
      APPEND ty_fcat TO it_fcat.ENDFORM.                    " ALV_101_FIELDCAT

  • Handle single click event in ALV OOPS

    Hi,
    I have to display 2 ALV grid...one above the other.
    Top ALV will contain Header info and bottom ALV witll display line item.
    I am use ALV OOPS.
    Now when user will click on the top ALV ...bottom ALV should show corresponding data.
    I don't have to use HOTSPOT or Double click event.
    How can I handle single click event.
    Please guide me..thanks in advance
    Regards,
    Prasoon

    hi,
                    for this in ALV OOPS take <b>2 custom containers( cl_gui_custom_container)</b>in the same screen and on the 1st container display the header data<b>(use set_tale_for_first_display method of class cl_gui_alv_grid)</b>.
                   On the 2nd screen item data for  this  use<b> EVENT</b> handling(you want <b>single click</b>). use<b> hotspot_click</b> or <b>button_click </b>events. 
    for this you have to register the events.   the code for that.
    <b>CLASS lcl_event_handler DEFINITION .</b>
    PUBLIC SECTION .
    METHODS:
    *--Hotspot click control
    handle_hotspot_click
    FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING e_row_id e_column_id es_row_no ,
    *--To control button clicks
    handle_button_click
    FOR EVENT button_click OF cl_gui_alv_grid
    IMPORTING e_oject e_ucomm .
    PRIVATE SECTION.
    ENDCLASS.
    <b>CLASS lcl_event_handlerIMPLEMENTATION .</b>
    *--Handle Hotspot Click
    METHOD handle_hotspot_click .
    PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
    ENDMETHOD .
    METHOD handle_button_click .
    PERFORM handle_button_click USING e_object e_ucomm .
    ENDMETHOD .
    ENDCLASS .
    DATA gr_event_handler TYPE REF TO lcl_event_handler .
    <b>*--Creating an instance for the event handler</b>
    CREATE OBJECT gr_event_handler.
    <b>*--Registering handler methods to handle ALV Grid events</b>
    SET HANDLER gr_event_handler->handle_hotspot_click FOR gr_alvgrid .
    SET HANDLER gr_event_handler->handle_button_click FOR gr_alvgrid .
    do n't forget to use<b> refresh_table_display
    </b> other wise only the record which you first you clicked will display in the 2nd container.
    <b>Reward points for useful Answers</b>

  • How to handle check box events in alv tree.

    hi,
    i am working in CL_GUI_COLUMN_TREE class.Also using Check box. Now i want to handle events for check box . I am new to ABAP Objects.
    Pls expaline in detail or send code
    thanks in advance,
    senthil kumar.r

    Hello Senthil
    Have a look at the sample report
    SAPCOLUMN_TREE_CONTROL_DEMO
    . The crucial points are:
    <b>(1) Register the required events at the control</b>
    * define the events which will be passed to the backend
      " checkbox change
      event-eventid = CL_GUI_COLUMN_TREE=>EVENTID_checkbox_change.
      event-appl_event = 'X'.
      append event to events.
      CALL METHOD G_TREE->SET_REGISTERED_EVENTS
        EXPORTING
          EVENTS = EVENTS
        EXCEPTIONS
          CNTL_ERROR                = 1
          CNTL_SYSTEM_ERROR         = 2
          ILLEGAL_EVENT_COMBINATION = 3.
      IF SY-SUBRC <> 0.
        MESSAGE A000.
      ENDIF.
    <b>(2) Set the event handler</b>
    assign event handlers in the application class to each desired event
      SET HANDLER G_APPLICATION->HANDLE_CHECKBOX_CHANGE FOR g_tree.
    <b>(3) Define and implement event handler method</b>
      METHOD  HANDLE_CHECKBOX_CHANGE.
        " this method handles the checkbox_change event of the tree
        " control instance
        " show the key of the node and the name of the item
        " of the clicked checkbox in a dynpro field
        G_EVENT = 'CHECKBOX_CHANGE'.
        G_NODE_KEY = NODE_KEY.
        G_ITEM_NAME = ITEM_NAME.
        CLEAR  G_HEADER_NAME.
      ENDMETHOD.
    Regards
      Uwe

  • Handling new Events.

    I am curious as to how to go about creating new events. For instance: say I want to create a program that will be used with seismometors (earthquake detection). Each time the little needle starts twitchin' an event is triggered. Obviously there isn't an "EarthquakeEvent" in java. How do I go about creating a new event, assigning such an event, and using it to trigger a new listener? Any suggestions?
    Any help would be greatly appreciated.
    Eric

    I guess my question was really this, how do you link the signal from the seismometor to the event? Creating the EarthquakeEvent class is a matter of extending and coding.. but how do you assign the signalled event as an EarthquakeEvent? IE: How does the computer know that the MouseEvent is triggered by the mouse and not the keyboard? More importantly, how does the programmer tell the computer to distinguish between the two? (The computer obviously must know that the MouseEvent is triggered by IO device in the "mouse-port", and a KeyEvent is triggered from the IO device in the "keyboard-port") So how is it that the programmers of the MouseEvent, and KeyEvent classes (basically) connect the hardware to the software?

  • StoreEvents always creating new event?

    Hey all,
    Our university recently upgraded to the newest version of the calendar server and so I've been going back to some old code I wrote that should now function correctly. However, I'm having an issue. The part of my program I'm currently dealing with fetches all the unconfirmed appointments from a user's oracle calendar and then asks the user if they would like to accept/decline/ignore those events. It then writes the events back to the server accordingly. However, despite my best efforts, a new appointment is always created rather than the old one being updated to reflect the new participation status.
    Here is an example of an event received from the server:
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ORACLE//NONSGML CSDK 9.0.4.2//EN
    BEGIN:VEVENT
    X-ORACLE-IMEETING-SENDEMAILNOTIFICATION:TRUE
    X-ORACLE-EVENTINSTANCE-GUID:I1+611984+101+1+445722372
    X-ORACLE-EVENT-GUID:E1+611984+101+445722372
    X-ORACLE-EVENTTYPE:APPOINTMENT
    UID:20050214T194612Z-95690-65-589f-Oracle
    TRANSP:OPAQUE
    SUMMARY:Unconfirmed Number 1
    STATUS:CONFIRMED
    SEQUENCE:0
    PRIORITY:5
    ORGANIZER;CN=Derek Miller:mailto:[email protected]
    DTSTART:20050214T170000Z
    DTSTAMP:20050221T192636Z
    DTEND:20050214T173000Z
    CREATED:20050214T194612Z
    CLASS:PUBLIC
    ATTENDEE;CUTYPE=INDIVIDUAL;RSVP=FALSE;CN=Derek Miller;PARTSTAT=NEEDS-ACTIO
    N:mailto:[email protected]
    END:VEVENT
    END:VCALENDAR
    And here is what I send back to the server:
    Content-Class: urn:content-classes:calendarmessage
    Content-Type:text/calendar;
    method=REQUEST;
    charset="utf-8"
    Content-Transfer-Encoding: 7bit
    BEGIN:VCALENDAR
    VERSION:2.0
    PRODID:-//ORACLE//NONSGML CSDK 9.0.4.2//EN
    BEGIN:VEVENT
    X-ORACLE-IMEETING-SENDEMAILNOTIFICATION:TRUE
    X-ORACLE-EVENTINSTANCE-GUID:I1+611984+101+1+445722372
    X-ORACLE-EVENT-GUID:E1+611984+101+445722372
    X-ORACLE-EVENTTYPE:APPOINTMENT
    UID:20050214T194612Z-95690-65-589f-Oracle
    TRANSP:OPAQUE
    SUMMARY:Unconfirmed Number 1
    STATUS:CONFIRMED
    SEQUENCE:0
    PRIORITY:5
    ORGANIZER;CN=Derek Miller:mailto:[email protected]
    DTSTART:20050214T170000Z
    DTSTAMP:20050221T192636Z
    DTEND:20050214T173000Z
    CREATED:20050214T194612Z
    CLASS:PUBLIC
    ATTENDEE;CUTYPE=INDIVIDUAL;RSVP=FALSE;CN=Derek Miller;PARTSTAT=ACCEPTED:mailto:[email protected]
    END:VEVENT
    END:VCALENDAR
    The only thing that I see that could be different is that when I fetch the event from the server, there are some strange line breaks in the attendee property which somehow magically disappear in my processing of the string (my function only swaps the NEEDS-ACTION with ACCEPTED so I don't know how those other line breaks go away). But the fact that a new event is created and all the properties are set correctly, I have my doubts as to this being the cause.
    Also, I have tried both the CAPI_FLAG_STORE_MODPROPS and CSDK_FLAG_STORE_MODIFY flags but neither seem to change what happens.
    Anyone see any obvious mistakes that I'm making?
    Thanks in advance!

    Glad to be of help! I wouldn't have known either except for a forum thread a few pages back titled "jni source code available" (or something like that) where one of the replies stated that the CSDK and CAPI handled the UIDs differently. Then I compiled the C example and noticed the UIDs looked very different from the ones I was getting from the Java SDK. Then I used your original post to help figure out what I needed to send back to the server (other than the UID) to get my code to work... so we kind of helped each other! Thanks!
    --Ron D.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Publishing News & Events to business catalyst news and a newsletter

    Hi
    I have a problem that I hope you can advise on.
    We have a school website hosted in business catalyst with news & events, seperate to that we have a weekly newsletter created using word and published as a pdf.  Since going live with the web site I've found that the website news & events are duplicates of information in the weekly newsletter.
    My question is this.  In an effort to stop double handling news & events, is there a simple way of creating news & events once and publishing to both a newsletter and a news item in business catalyst.  I have a creative cloud subscription and hope that one of the many tools in the creative cloud suite will allow this.
    Thanks
    Amanda

    Ok, I can't seem to find a straight answer for this question anywhere online without something else I find contradicting it.
    PLEASE can someone tell me if my clients can edit text and images on Muse sites within Business catalyst, admin?
    Ido not care if it does not revert the changes to the muse application on my mac. I just want my clients to be able to maintain there text and images without contacting me.
    If and when the design needs to be changed on the original muse file, I will simply update the Muse file to correspond with the site online then make the further changes after that.
    I REALLY want to use Muse to create websites for my clients but if they can't update image/text content remotely then It's not going to work for me and 90% of freelance designers.
    Please can someone clear this up for me.
    Nathan

  • HOWTO: Handle a click event on a DAC TreeControl

    HOWTO: Handle a click event on a DAC TreeControl
    Goal: Handle the event that occurs when a user clicks on a new node of a DAC TreeControl. In this example the handler is simple - it just prints out the current node. You can try this example on the DACTree.jpr project in the 3.2 tutorial, described in the online help under
    Tutorials and Sample Applications
    -> Tutorials
    -> Building Enterprise Applications with Business Components for Java
    -> Enhancing the Online Orders Application
    -> Creating a DAC Client
    The problem: The usual procedure for adding an event to a DAC component does not work: if you select your TreeControl in the designer, then select the Events tab of the property inspector, none of the events listed does what we want.
    Solution: Get the underlying JTree and add your listener to it. Although the TreeControl is not a subclass of javax.swing.JTree, it does have an underlying JTree which you can get by calling TreeControl.getTree().
    Add the following code to your frame's .java file (Hint: Add any event, from the Events tab of the property inspector, then use the generated code as your template, changing it to match this example):
    1. Declare a JTree:
    JTree tree = new JTree();2. In jbInit(), add the event listener after the code that sets up your TreeControl:
    tree = treeControl1.getTree();
    tree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener() {
    public void valueChanged(javax.swing.event.TreeSelectionEvent e) {
    tree_valueChanged(e);
    });3. Add the event handler method:
    void tree_valueChanged(javax.swing.event.TreeSelectionEvent e) {
    System.out.println("Current node: " + tree.getLastSelectedPathComponent());
    }

    could you add a mouselistener to the pane or whatever container the pie chart is drawn on? Then override the mouseClicked method to do whatever you want?
    Message was edited by:
    petes1234

  • Why is every new event I create automatically made into an all day event?

    Why is every new event I create on iCal automatically made into an all day event?

    Thank you for proving my point brilliantly. For the moment, I shall keep my rantings and the difficulties to myself because you obviously can not handle a bit of user's frustration. Too bad really, that you can not see it as an opportunity to make improvements and be a Hero in the process. I did say that Firefox works much faster, why did you not take that personally as well? ............. Another day, Slick ! ...........

  • How to create a New Event Window Pop up

    The program I want to develop has many layers.  I want to have a menu page, after clicking on one of the buttons, I would like to see data display on the new event pop-up.  I have checked the example : New Event Handler.vi however, it does not work when I put my own subvi into the Event Structure.  Can you tell me what is the property of the subvi that I need to set in order to have it as a pop-up window? 
    Thanks. 
    Ellynn

    Go to the File Menu - VI Properties.  Select Window Appearance in the Category box.  Then click on the Custom radio button and then click the Customize button.  Click on the Show front panel when called checkbox and the Close afterwards if originally closed checkbox.  Click OK.  Now when you call your subvi, it will be displayed and will close when the vi is done.
    - tbob
    Inventor of the WORM Global

  • Handling standard iview event from web dynpro

    Hi all,
    I hav w a search iView which is SAP standard, when you click an element on the result list it triggers an event. The link contains the following:
    javascript:{jsCode="
    EPCM.storeClientData('urn:com.sap.bor:BUS1001','objid','12002');
    EPCM.storeClientData('urn:com.sap.bor:BUS1001','AllKeys','objid');
    EPCM.raiseEvent('urn:com.sap.bor:BUS1001','select','','a very long url');"};if(opener!=null&&self!=opener){opener.execJS(jsCode);}else{execJS(jsCode);};
    On the other side I'm developing a custom WebDynpro iView whick needs to handle this event. By adding to wdInit() the line WDPortalEventing.subscribe("urn:com.sap.bor:BUS1001", "select", wdThis.wdGetGetReportsListForMaterialAction());  I was able to catch the event. But I can't get the parameters from the event.
    For what i've learned browsing the forum the javascript code above stores the parameters in the "client data bag", and are not directly passed in the event.
    Is there any way to retrieve these parameters from the Web Dynpro iView ?
    Thanks in advance,
    Diego.

    Hi all,
    As a workaround I made a Portal Component application which receives the event and parameters from the standard iView and lanuchs a new event setting the aprameters in the event as Web Dynpro expects them (without using the client databag). Then I inserted this Iview in the same page as the others, but hidden. It's not elegant but is working.

  • How to handle the drop event

    Hi everyone,
    Now I'm developing the function about drag-drop source(image & text) from Panel Tree to the document.
    I also have a look at the basic drag/drop & Panel Treeview, but all of them is not the source code mentions to how to handle the drop event, almost about drag event only.
    Now when user Drags(image, text) from PanelTreeView(example) and drops them to document and then new page Item contains source(image, text) created, so I want to get the page item after drop event.
    so anyone know about this please give me suggestion
    thanks so much.

    i dont think you can.
    ~~~~~~~~~~~~~~~~
    --> Adobe Certified Expert
    --> www.mudbubble.com
    --> www.keyframer.com
    ~~~~~~~~~~~~~~~~
    keyoke_za wrote:
    > Hi,
    > How can I get my flash movie to handle the drop event
    when dropping objects from outside the flash window.
    > Thanks for your help..

  • Event registrati​on refnum breaks when new event added

    I am using dynamic event registration to handle events from my UI in another VI.  Whenever I add a new event, the event registration refnum breaks and I have to recursively go through the code and replace all instances.  Is there a method of passing event registration refnums so that this does not happen?  Should these be made a strict type def?
    Solved!
    Go to Solution.

    Hello,
    I have the same problem, but i have no solution...
    Why it don't works? I added an examble...
    I created a Cluster with an enum an variant. I edit the enum with a second item, then the wire brakes.
    But it is a type def.
    Can anyone help me?
    Attachments:
    Event_Reg_Refnum_main.vi ‏6 KB
    Event_Reg_Refnum_subvi.vi ‏6 KB
    Control 2.ctl ‏4 KB

Maybe you are looking for

  • Exporting to iTunes results in a very large file

    I have been making music on Garageband and when I export it to itunes, it becomes a very large file. This makes disables me from being able to post my music on my website or email it. What can I do to make the file smaller? imac G5   Mac OS X (10.4.5

  • CP5 and Print output

    I'm packaging some PPTs used for ILT using Captivate.  The package is going to include an .exe version and two handout versions.  One for students and one for instructors.  Has anyone attempted to add or modify the templates for the print output? I'v

  • Developer Mode Exception

    I am not able to understand what the below exception means,I would like to fix this in the Development environment.Can somebody help me in deciphering the exception. Developer Mode Exception encountered in item CacNtsCreateNotes Error: The item CacNt

  • How I can append new node in existing  XML file

    I've just begun learning DOM XML , so I'm currently at a very beginner level. I have an existing XML file that I would like to add an additional node to before saving it to another variable. how I can append new node in this file. now this code is ov

  • Problem display item

    I'm populating a display item using a from a post_query trigger using the following statement. It works if there is an item. However if there is not i get the following error FRM-40735: POST-QUERY trigger raised unhandled exception ORA-0403. Can anyo