Event Handling for free programmed search help bond dynamically in SO

Dear Expert,
I met a problem of how to handle an event raised by a free programmed search help - (F4), and this F4 is invoked
by a field defined in a Selection Option component (WDR_SELECT_OPTIONS) - SO. 
The scenario is that I would like to update the SO after the user multiple select some entries in the F4. I could tranfer
back all the value chosen in the F4 to the consumer SO, but I can not update the icon in the SO(e.g  in SO, multiple values will be
displayed with a green arrow icon), because I could not define a handler in SAP standard component SO, and it looks like there is no chance to catch the event triggered at the end of selection in F4.  (this event belonged to this F4)
Welcome any suggestions or ideas, Thanks very very much. 
In Addition, I use this way to enable the F4 for SO
lo_so_component->create_cmp_usage_group(
     name = 'F4_TRANSPORT'
     used_component = 'ZTRANSPORT').

thanks all

Similar Messages

  • Free Programmed Search Help Question

    I want to use the free programmed search help interface to make
    my own search help.
        But the problem is, I want to embed SAP's search help into my own
    search help.How can I do that?
        Thank you.

    Hi,
    I had the same requirement and so I used Dictionary search help.
    In this you have to attach dictionary search help as inpute mode for paricular
    context node.
    e.g. If you want to attach a F4 help for vendor number, then goto attribute of that particular node and search for your attribute. Now click on vendor and change the properties of the same attribute as input help mode will be changed as
    'Dictionary search help' and put your own created search help name in the
    'Dictionary search help' tab. Also you can use standard search help name if you know as 'Dictionary search help '.
    Also there is another way to handle the same.
    In this blog you can find a solution with select options and custom F4
    /people/koen.labie2/blog/2006/11/17/custom-f4-functionality-in-webdynpro-for-abap
    Hope I have solved your problem.
    Cheers,
    Darshna.

  • Event Handler is not getting trigger for Freely Programmed search help

    Hi All,
       I am having a component comp1 defined for value help with one event. In component comp2 i want to call the comp1 but the event handler which i have created is not getting triggered. Any reasons for it.
    Thanks
    Raghavendra

    Hi Kumar,
    Please check these forum threads.
    Re: Help required on Freely Programmed Input help
    Re: Custom search help

  • Freely Programmed search help - Accessing Alternative node

    Hi Experts,
    I am trying to use Freely Programmed search help for calling a custom WD component on pressing of F4 of an input field.
    I have done everything required and the component is being called properly as well.
    The issue here is that i need to pass two values to the the custom WD component on F4. As suggested in one of the threads I used F4_CONTEXT_ELEMENT to get the reference of the source context node and attributes. But the problem is that this gives reference to only that node which has the input field with F4 help (which is being used to call the custom component). The values which i need to pass are present in some other node.
    Can you please suggest a way of accessing the other node to retrieve and use the values in the custom component called?
    Regards,
    Ritvik
    Edited by: Ritvik Prasad on Mar 31, 2010 5:16 AM

    Hi Manas,
    Thanks for the suggestion. I had thought about it too. But the problem that i faced was that no event is triggered/Method called on pressing of F4 on that input field (its internally handled in the framework). In that case what should be the method/event where i should copy the values from the other node to the new attributes created so that it reflects in the Custom component?.
    If you could just elaborate on that it would be really helpful.
    Hi Chris,
    Thanks a lot for this. That actually sounds like fun. I tried looking for options to do that. Although i can get to the node from the element using "GET_NODE" but there I could not find the method "GET_PARENT_ELEMENT" to get the parent element (context as you said). Is there any other method which could possibly return the parent element which i could eventually use to get to the other node.
    It would be great if you could help out with this.
    Thanks ,
    Ritvik

  • Unable to get automatic event handling for OK button.

    Hello,
    I have created a form using creatobject. This form contains an edit control and Search, Cancel buttons. I have set the Search buttons UID to "1" so it can handle the Enter key hit event. Instead its caption changes to Update when i start typing in the edit control and it does not respond to the Enter key hit. Cancel happens when Esc is hit.
    My code looks like this -
    Dim oCreationParams As SAPbouiCOM.FormCreationParams
            oCreationParams = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)
            oCreationParams.UniqueID = "MySearchForm"
            oCreationParams.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable
                    Dim oForm As SAPbouiCOM.Form = SBO_Application.Forms.AddEx(oCreationParams)
    oForm.Visible = True
    '// set the form properties
            oForm.Title = "Search Form"
            oForm.Left = 300
            oForm.ClientWidth = 500
            oForm.Top = 100
            oForm.ClientHeight = 240
            '// Adding Items to the form
            '// and setting their properties
            '// Adding an Ok button
            '// We get automatic event handling for
            '// the Ok and Cancel Buttons by setting
            '// their UIDs to 1 and 2 respectively
            oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Search"
            '// Adding a Cancel button
            oItem = oForm.Items.Add("2", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 75
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
            oButton = oItem.Specific
            oButton.Caption = "Cancel"
    oItem = oForm.Items.Add("NUM", SAPbouiCOM.BoFormItemTypes.it_EDIT)
            oItem.Left = 105
            oItem.Width = 140
            oItem.Top = 20
            oItem.Height = 16
            Dim oEditText As SAPbouiCOM.EditText = oItem.Specific
    What changes do i have to make to get the enter key to work?
    Thanks for your help.
    Regards,
    Sheetal

    Hello Felipe,
    Thanks for pointing me to the correct direction.
    So on refering to the documentation i tried out a few things. But I am still missing something here.
    I made the following changes to my code -
    oForm.AutoManaged = True
    oForm.SupportedModes = 1 ' afm_Ok
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.SetAutoManagedAttribute(SAPbouiCOM.BoAutoManagedAttr.ama_Visible, 1, SAPbouiCOM.BoModeVisualBehavior.mvb_Default)
            oButton = oItem.Specific
            oButton.Caption = "OK"
    AND
    oForm.Mode = SAPbouiCOM.BoFormMode.fm_OK_MODE
    oItem = oForm.Items.Add("1", SAPbouiCOM.BoFormItemTypes.it_BUTTON)
            oItem.Left = 5
            oItem.Width = 65
            oItem.Top = oForm.ClientHeight - 30
            oItem.Height = 19
    oItem.AffectsFormMode = False
    I get the same behaviour OK button changes to update and enter key does not work.
    Could you please tell me find what is it that i am doing wrong?
    Regards,
    Sheetal

  • Event handler for STDIN input?

    Hi,
    This question will probably require a bit of context - I'm attempting to re-implement in java an application that's currently written in perl. The application is a server helper app that rewriters urls; it receives a request ID and a URL on stdin, does the necessary munging (which can require an external SOAP query), then returns the resulting rewritten URL.
    Since the results can be asynchronous due to the need for external queries to build the result, this is currently a multithreaded perl app implemented using perl's POE framework to register an event handler for stdin. That handler fires each time a line of input is received, then feeds the query to a thread pool manager (POE::Component::Pool::Thread, which is conceptually similar to the Executor frameworks). The thread returns the result as a callback registered to another function in the main thread, which then populates the query/result to a cache then outputs the result (with the original query ID) on stdout. Since stdin input and the result callbacks are event-driven, there's no while(true) main loop or other blocking mechanism in the main thread. Unfortunately, it's perl-ness is causing problems due to perl's threading implementation (three words: "copy on init"), so we need to reimplement in a language with a more robust threading implementation (preferably one with copy-on-write for shared objects). So, Java it is.
    So far everything's been good - Executor, Callables, and Futures work as I hoped they would for proper thread management, and the internal worker thread logic (XML processing, SOAP, regular expressions, etc) is proving rather simple to adapt. However, the main roadblock I'm hitting is that so far, I have not found a way to register any sort of event handler for STDIN input (or more specifically, InputStreamReader/BufferedStreamReader events). This could be due to search engine pollution - everything I see when I search for documentation on event listeners appears to be GUI-specific (buttons, menus, text areas/forms, etc). I'm just looking for a way to handle a line of STDIN, not a text area on a form.
    Any pointers in the right direction will be much appreciated!

    rekoil wrote:
    Maybe I need to rethink the design here...
    The main reason I used a callback in the original perl is that there's a large cache structure that gets checked before the thread dispatch, and only cache misses get pushed to a thread for processing. Callbacks from the threads will then add its results to the cache. Thanks to perl's thread model, when I attempted to make the cache a shared structure - in perl, you have to explicitly mark as "shared" variables that you want visible to all threads - the structure wound up getting copied to every thread, and this gave the app an unacceptable memory footprint. So the solution was to use a callback in the main thread to update the cache.
    I'm now thinking that if Java's thread model is a bit saner (i.e. a shared object doesn't get copied into every thread), then I could just have each thread update the cache, print its output to STDOUT directly, and avoid the need for the callback. I can then make my input loop simply a while() loop, waiting for the next input to dispatch. Sound sane?Yes I think so.
    There is some of this I still don't entirely understand. Your loop sounds better now but it sounds to me like the process is this.
    1) read from in
    2) call some stuff on the basis of what came in
    3) do work
    4) workers produce things
    5) things written back out
    6) read back in??
    If you're just going in/out then great. If you are going in/out/in then maybe some sort of PipedInput/Output Streams? It may well be that I got lost in your explanation in which case never mind.

  • EmailRecieved Event handler for incoming email in Sharepoint 2013

    Hi,
    I am developing custom event handler to enable incoming email for custom document library.  i have couple of questions.
    1. Once i attached the event handler, i could see incoming email settings for the custom document library, but it displays only 2 options as below :
                  1.   Allow this document library to recieve email
                                 Yes       No
                    2. E-mail address
    All other properties are not displaying. Is this normal behaviour on custom event handler for custom document library or any issue anywhere?
    2. So i have given other properties using powershell as below:
    $list = $web.lists["invoice Documents"]
    $list.EmailAlias ="TestDocument"
    $list.EnableAssignToEmail = $true
    $list.rootFolder.Properties["vti_emailusesecurity"] = 1
    $list.rootFolder.Properties["vti_emailsaveattachments"] = 1
    $list.rootFolder.Properties["vti_emailattachmentfolders"] = "root"
    $list.rootFolder.Properties["vti_emailoverwrite"] = 0
    $list.rootFolder.Properties["vti_emailsavemeetings"] = 0
    $list.rootFolder.Properties["vti_emailsaveoriginal"] = 0
    $List.RootFolder.Update();
    $list.Update();
    here i have given vti_emailusesecurity as 1, so it should allow incoming email for the user who has permission for the list.
    But any user from the domain is sending mail to this list, the Emailrecieved event handler is triggered. I am expecting that this event handler should not be triggered and expecting access denied error in the ULS Log. But that is not happening, and emailrecived
    is triggered and email is delivering to this address successfully.
    Can you please anyone help if experience on this?
    Thanks
    Sathya

    http://www.coretekservices.com/2012/01/26/sharepoint-content-organizer-%25e2%2580%2593-emailing-your-drop-off-library-and-getting-it-to-work
    Central Administration > Monitoring > Review Job Definitions (under Timer Jobs) > Content Organizer Processing
    Also check below:
    http://tutorial.programming4.us/windows_server/SharePoint-2010---Content-Organizer-as-a-Document-Routing-Tool.aspx
    If this helped you resolve your issue, please mark it Answered

  • Button Event Handler in a JList, Please help.

    Hi everyone,
    I have created a small Java application which has a JList. The JList uses a custom cell renderer I named SmartCellRenderer. The SmartCellRenderer extends JPanel and implements the ListCellRenderer. I have added two buttons on the right side inside the JPanel of the SmartCellRenderer, since I want to buttons for each list item, and I have added mouse/action listeners for both buttons. However, they don't respond. It seems that the JList property overcomes the buttons underneath it. So the buttons never really get clicked because before that happens the JList item is being selected beforehand. I've tried everything. I've put listeners in the Main class, called Editor, which has the JList and also have listeners in the SmartCellRenderer itself and none of them get invoked.
    I also tried a manual solution. Every time the event handler for the JList was invoked (this is the handler for the JList itself and not the buttons), I sent the mouse event object to the SmartCellRenderer to manually check if the point the click happened was on one of the buttons in order to handle it.
    I used:
    // Inside SmartCellRenderer.java
    // e is the mouse event object being passed from the Editor whenever
    // a JList item is selected or clicked on
    Component comp = this.getComponent (e.getX(), e.getY())
    if(!(comp instanceof JButton)) {
              System.out.println("Recoqnized Event, but not a button click...");
              //return;
    } else {
              System.out.println("Recognized Event, IT IS A MOUSE CLICK, PROCESSING...");
              System.out.println("VALUE: "+comp.toString());
    What I realized is that not only this still doesn't work (it never realizes the component as a JButton) it also throws an exception for the last line saying comp is null. Meaning with the passed x,y position the getComponent() returns a null which happens when the coordinates passed to it are outside the range of the Panel. Which is a whole other problem?
    I have yet to find an example on the web, using Google, that demonstrated using buttons inside a JList.
    Can anyone help me with this. Thanks.

    A renderer is not a component, so you can't click on it. A renderer is just used to paint a representation of a component at a certain position in your JList.
    I have yet to find an example on the web, using Google, that demonstrated using buttons inside a JList.Thats probably because this is not a common design. The following two designs are more common:
    a) Create a separate panel for your JButtons. Then when you click on the button it would act on each selected row in the JList
    b) Or maybe like windows explorer. Select the items in the list and then use a JPopupMenu to perform the desired functionality.
    I've never tried to add a clickable button to a panel, but this [url http://forum.java.sun.com/thread.jspa?threadID=573721]posting shows one way to add a clickable JButton as a column in a JTable. You might be able to use some of the concepts to add 2 button to the JPanel or maybe you could use a JTable with 3 columns, one for your data and the last two for your buttons.

  • Freely Programmed Search Help

    Hi there,
    I have a WebDynpro application with two fields.  The first field has Dictionary search Help on it.
    The second field has a Freely Programmed input help.  The problem I am faced with is that the freely programmed search relies on the value of the first field to determine it's own values - i.e The first field is a contract, and the second field is an item on the contract.  So if the contract changes, so should the list of items provided in the Help.
    Now the way that this works is that the user selects a contract, then selects an item, then completes the fields in a PDF document.
    They press the button Save and Clear which saves the data, clears all the fields, and is then ready for the next lot of data.
    Although I can clear out all the fields, I don't know how to trigger the refresh of the Freely Programmed help.  The first time it is used it gets the right data, and after that it always shows the same data, - I just don't know how to trigger a refresh.  Basically I want it to refresh every time it is used!!
    Many thanks
    Jack

    Hello Jack,
    hmm... it should refresh itself, because you determine what goes in and out. Probably, you need to clean up some nodes in your freely programmed search help component as well i.e. upon leaving.
    Best regards,
    Thomas

  • Freely programmed search help with external mapping

    Hi all.
    I have a freely programmed search help to search for physical inventory items.
    I map some data from the component where i use this search help to this search help via external mapping. This works fine.
    But in the search help I want to be able to change the mapped data to perform a new serach. When I change the data and start the action to search again (in the serach help component)  I still get the old field value from context so that the search returns the same result. When I close the search help afterwards the changes are suddenly visible in the using component. So my entered data are somehow transfered to the original context but not to the context of the used component.
    Any ideas?
    Thanks
    Sascha
    Message was edited by:
            Sascha Dingeldey

    Hi Sascha,
    I would suggest, that you do not work with the externally mapped attribute.
    Try to copy the value to a "local" attribute in the searchhelp context while WDDOINIT of the component.
    This is the attribute you should use for the search.
    When you change the searchvalue, it is only changed in the comnponent.
    To get the values back to the calling component you need to copy it back while you call the action submit or exit.
    Hope this helps
    Best regards, Matthias

  • Override event handler for document events in LiveCycle

    I would like to have an email notification when a user opens a policy-protected DRM pdf. Is there a way to override the event handler for Document Open events?
    Or perhaps there is a way to access the event database- where can I find this information?

    Thank you so much for your reply. I have created an external authorization and am following the steps outlined here: http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=001479.html
    I have deployed my jar and restarted JBoss. However, now when I try to create a new policy using my external authorization, I do not see an option to add it on the create new policy page. I see only sections for Users and Groups, General Settings, Advanced Settings, and Unchangeable Advanced Settings. Could you please tell me how to add the external authorization?
    Also, in the component.xml file, I followed the sample and kept this line: <component-id>com.adobe.livecycle.samples.externalauthorization</component-id>
    Should that be changed? If so, to what?
    Thanks.

  • Sleutel Bind, fancy key events handler for standalone window managers

    I began using Openbox in my laptop a while ago, and I was amazed by the speed, customization and simplicity it provides. After I started customizing my desktop I noticed that some of the special keys (TouchpadToggle, Volume, PrintScreen, etc) didn't worked at all. There are some applications for the Volume keys to work, but not for keys like touchpad-toggle and print-screen. Of course, there's a workaround for each case using simple scripts, but I wanted something a little more fancy, so I made:
    Sleutel Bind
    It's made in C and provides key events handling for:
    XF86TouchpadToggle
    Print (prtsc key)
    It makes use of libnotify to display states ( touchpad enabled/disabled, screenshot taken, etc) and imlib2 (a very popular library, probably already installed in your system) to grab the screenshots. Almost all other keys are covered already by another application, but if needed, more key events will be added in the future.
    Feel free to post your thoughts about Sleutel Bind, it's my first contribution to the community.
    How to use
    Once installed just run the command as a normal user.
    If using openbox, place the following command in the "~/.config/openbox/autostart" file:
    sleutelb &
    Links
    AUR
    github
    Last edited by DanielRS (2013-03-01 21:58:35)

    mgmillani wrote:
    I believe it must have been a bug and it was fixed, since print screen now works as expected. I'm using xmonad version 0.11-9, with ghc version 7.8.3.
    davama wrote:
    Note: for my print key to be recognized by xev i had to hold the ctrl key. that way it was not registered by xmonad. Also for xev command i use
    xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
    Nice, that seems to be useful. Thanks!
    @LQYMGT
    Do you still have issues with the latest version? Otherwise I will mark this thread as solved.
    well, still do not work... But I do not want to try it any more...So you can mark.

  • Event Handling for messages

    I would like to know how to handle events for messages i maintained in zmesg01.
    messages are follow:    when gv_spfli is initial
                                 "No such flight available.
                                when  gv_scarr is initial.
                                  "Flight name not available          with help of raise event ?
    pls suggest.
    *       CLASS lcl_mytestclass DEFINITION
    class lcl_mytestclass definition.
    public section.
       data: gt_spfli type table of spfli initial size 20,
               gt_scarr type table of scarr initial size 20.
       methods: get_data.
       events: data_not_found.
    endclass.                    "lcl_mytestclass DEFINITION
    *       CLASS lcl_mytestclass IMPLEMENTATION
    class lcl_mytestclass implementation.
    method: get_data.
       select * from spfli into table gt_spfli.
       if ( sy-subrc <> 0 ).
         raise event data_not_found.
         endif.
    select * from scarr into gt_scarr
    for all entries in gt_flight where  carrname = gt_spfli-carrname.
    if sy-subrc  <> 0.
    " How to call event for flight_name_not_found ?"
    raise event flight_name_not_found.
      endmethod.                    "get_data
      endclass.                    "lcl_mytestclass IMPLEMENTATION
    *       CLASS handler DEFINITION
    class handler definition.
    public section.
       methods handle_event
               for event data_not_found of lcl_mytestclass.
    endclass.                    "handler DEFINITION
    *       CLASS handler IMPLEMENTATION
    class handler implementation.
    method handle_event.
       write: / 'Data not found'.
    endmethod.                    "handle_excess
    endclass.                    "handler IMPLEMENTATION
    data: oref type ref to lcl_mytestclass,
         h1   type ref to handler.
    start-of-selection.
    create object: oref, h1.
    set handler h1->handle_event for all instances.
    call method oref->get_data.
    Thanks in advance.
    Anee.

    Hello Anee
    Events are not used for this kind of message handling.
    If you want to collect all messages then use a message handler (see sample report ZUS_SDN_ABAP_OO_MSG_HANDLING ).
    Alternatively, you may define an exception class and raise a class-based exception which contains the detailed error message.
    The following sample report is based on the more elaborate Wiki posting
    [Message Handling - Finding the Needle in the Haystack|https://wiki.sdn.sap.com/wiki/display/profile/2007/07/09/MessageHandling-FindingtheNeedleintheHaystack]
    *& Report  ZUS_SDN_ABAP_OO_MSG_HANDLING
    *& Thread: Event Handling for messages
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1052131"></a>
    REPORT  zus_sdn_abap_oo_msg_handling.
    TYPE-POOLS: abap.
    *       CLASS lcl_mytestclass DEFINITION
    CLASS lcl_mytestclass DEFINITION.
      PUBLIC SECTION.
        DATA: gt_spfli TYPE TABLE OF spfli INITIAL SIZE 20,
                gt_scarr TYPE TABLE OF scarr INITIAL SIZE 20.
        METHODS: constructor.
        METHODS: get_data
                       IMPORTING
                     value(id_carrid) TYPE s_carr_id.
        METHODS: has_messages
                   RETURNING value(rd_result)  TYPE abap_bool.
        METHODS: display_messages.
        EVENTS: data_not_found.
      PROTECTED SECTION.
        DATA: mo_msglist    TYPE REF TO if_reca_message_list.
    ENDCLASS.                    "lcl_mytestclass DEFINITION
    *       CLASS lcl_mytestclass IMPLEMENTATION
    CLASS lcl_mytestclass IMPLEMENTATION.
      METHOD constructor.
        me->mo_msglist = cf_reca_message_list=>create( ).
      ENDMETHOD.                    "constructor
      METHOD has_messages.
        IF ( me->mo_msglist->is_empty( ) = abap_false ).
          rd_result = abap_true.
        ENDIF.
      ENDMETHOD.                    "has_messages
      METHOD display_messages.
    * define local data
        DATA:
          ld_handle           TYPE balloghndl,
          lt_log_handles      TYPE bal_t_logh,
          ls_profile          TYPE bal_s_prof.
        " Get log handle of collected message list
        ld_handle = me->mo_msglist->get_handle( ).
        APPEND ld_handle TO lt_log_handles.
    *   get a display profile which describes how to display messages
        CALL FUNCTION 'BAL_DSP_PROFILE_DETLEVEL_GET'
          IMPORTING
            e_s_display_profile = ls_profile.  " tree & ALV List
    *   set report to allow saving of variants
        ls_profile-disvariant-report = sy-repid.
    *     when you use also other ALV lists in your report,
    *     please specify a handle to distinguish between the display
    *     variants of these different lists, e.g:
        ls_profile-disvariant-handle = 'LOG'.
        CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
          EXPORTING
            i_s_display_profile          = ls_profile
            i_t_log_handle               = lt_log_handles
    *       I_T_MSG_HANDLE               =
    *       I_S_LOG_FILTER               =
    *       I_S_MSG_FILTER               =
    *       I_T_LOG_CONTEXT_FILTER       =
    *       I_T_MSG_CONTEXT_FILTER       =
    *       I_AMODAL                     = ' '
    *     IMPORTING
    *       E_S_EXIT_COMMAND             =
          EXCEPTIONS
            profile_inconsistent         = 1
            internal_error               = 2
            no_data_available            = 3
            no_authority                 = 4
            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.
      ENDMETHOD.                    "display_messages
      METHOD: get_data.
        SELECT * FROM spfli INTO TABLE gt_spfli
          WHERE ( carrid = id_carrid ).
        IF ( sy-subrc NE 0 ).
    **      RAISE EVENT data_not_found.
          IF 1 = 2. MESSAGE e154(bc_datamodel_service). ENDIF.
    *   Flight not found (table SFLIGHT)
          CALL METHOD me->mo_msglist->add
            EXPORTING
    *          is_message   =
              id_msgty     = 'E'
              id_msgid     = 'BC_DATAMODEL_SERVICE'
              id_msgno     = '154'
    *          id_msgv1     =
    *          id_msgv2     =
    *          id_msgv3     =
    *          id_msgv4     =
              id_detlevel  = '1'
    *        IMPORTING
    *          es_message   =
        ENDIF.
        IF ( gt_spfli IS INITIAL ).
        ELSE.
          SELECT * FROM scarr INTO TABLE gt_scarr
          FOR ALL ENTRIES IN gt_spfli
            WHERE  carrid = gt_spfli-carrid.
        ENDIF.
        IF ( gt_scarr is initial ).
          " How to call event for flight_name_not_found ?"
    **        RAISE EVENT flight_name_not_found.
          IF 1 = 2. MESSAGE e159(bc_datamodel_service) WITH '&all'. ENDIF.
    *   Airline & not found
          CALL METHOD me->mo_msglist->add
      EXPORTING
    *          is_message   =
        id_msgty     = 'E'
        id_msgid     = 'BC_DATAMODEL_SERVICE'
        id_msgno     = '159'
        id_msgv1     = '&all'
    *          id_msgv2     =
    *          id_msgv3     =
    *          id_msgv4     =
        id_detlevel  = '2'
    *        IMPORTING
    *          es_message   =
        ENDIF.
      ENDMETHOD.                    "get_data
    ENDCLASS.                    "lcl_mytestclass IMPLEMENTATION
    *       CLASS handler DEFINITION
    CLASS handler DEFINITION.
      PUBLIC SECTION.
        METHODS handle_event
                FOR EVENT data_not_found OF lcl_mytestclass.
    ENDCLASS.                    "handler DEFINITION
    *       CLASS handler IMPLEMENTATION
    CLASS handler IMPLEMENTATION.
      METHOD handle_event.
        WRITE: / 'Data not found'.
      ENDMETHOD.                    "handle_excess
    ENDCLASS.                    "handler IMPLEMENTATION
    DATA: oref TYPE REF TO lcl_mytestclass,
         h1   TYPE REF TO handler.
    PARAMETER:
      p_carrid    TYPE s_carr_id DEFAULT 'AA'.
    START-OF-SELECTION.
    START-OF-SELECTION.
      CREATE OBJECT: oref, h1.
    **  SET HANDLER h1->handle_event FOR ALL INSTANCES.
      CALL METHOD oref->get_data( p_carrid ).
      IF ( oref->has_messages( ) = abap_true ).
        oref->display_messages( ).
      ENDIF.
    END-OF-SELECTION.
    Regards
      Uwe

  • 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();
    }

  • Freely Programmed Search help in Std Comp

    hi,
    Is it possible to add freely programmed searh help in standard SAP Component.
    I have dynamically assigned Freely search help to Context attribute using  set_attribute_value_help method.
    Now new component to be used in seach help is made in different package and this component is used as Used Comp
    in Std Component.
    When I click on search help it gives error : Comp usage ZHelp doesnt exist.
    zhelp- My component name.

    You have to add the component usage to the Standard Component, just like you would add the Freely Programmed Search help component usage to any component that wanted to call the search help.
    Component usages can be added using the Enhancement Framework:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/46/233f2189f74f08e10000000a114a6b/frameset.htm

Maybe you are looking for

  • Remote Printing on 2012 from Mac

    Hi all, I'm having an issue trying to setup remote printing from a Mac running OS X 10.6.8 using the 'Remote Desktop Connection' app and connecting to my Windows Server 2012 Remote Desktop Services server I have configured. The Mac is sitting on a co

  • Encountered an error while updating iTunes

    Yesterrday I have updated my iMac to Lion. Then I did a software update and there are two updates one of them is iTunes 10.4. But it gives me an error: installer encountered an error that caused the installation to fail I have also tried to download

  • How to change condition type of Markdown price?

    Dear Expert, When I active markdown price, the system create price with condition type VKP0 (same as article regular retail price). Now I want system create price with other condition type, for example ZXXX. Could you give any help or tips? Thank you

  • Problem in Combo Box Values

    Hi Members, I have an combo box in a user designed screen. I have to list the sales order number for an chosen customer in the combo box. My problem is that all the values are not listing for that customer. Sample coding is as follows: strSQL = "sele

  • Employee Mass Photo upload

    Hi All, Employee Mass Photo  upload: Is there any functional way for doing same like Tcode: OAAD/ We dont need any technical team to involve in this photo load Please let me know any thread related to this. Appreciating immediate response SD