Call Menu Event from code

Good Day
Experts:
I would like to call a MenuEvent from code in one of my forms.  A Sub in my Main.vb class called MenuEvent handles which form to open:
MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
I cannot figure out how to call that MenuEvent from in my form code.  So far I have:
<b>Project.Class.MenuEvent(test, True)</b>
test is defined as:
<b>Dim test As SAPbouiCOM.MenuItem
test = "AddOper"</b>
When I run the code to try and call this MenuEvent, I get an error "Unable to cast object System.String to type SAPbouiCOM.MenuItem"
Does anyone have an feedback that might help me call a MenuEvent from my form code?
Thanks,
EJD

Thanks for the Response Ad
I did not explain well.  The MenuEvent Sub I have here refers to a Menu that I am loading as an AddOn.  From that menu I am loading forms/screens that were written in VB.Net.  Here is the code for a few of the forms/screen calls in my MenuEvent sub:
Public Shared Sub MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
        Try
            Select Case pVal.MenuUID.ToUpper
                Case "Test_WO"
                    Dim WOForm As New Test_WO
                    BubbleEvent = False
                Case "Test_AddOper"
                    Dim WOAddOperForm As New Test_AddOper
                    BubbleEvent = False
             End Select
        Catch ex As Exception
            HandleException("Event Handler - Menu Event Handler", ex, False)
        End Try
    End Sub
I want to make a call from this MenuEvent while inside a form/sceen.  This way the User does not have to go back to the Menu list and click on it.  So, I need to call <b>Public Shared Sub MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)</b> from inside a form/screen.  I canot figure out the syntax to make the Case "Test_WO" fire from inside my form.
Can you help?
Thanks,
EJD

Similar Messages

  • Calling Portal event from ABAP class

    Hi Experts,
    I need a following clarificatrion, Please help,
    1. Is it possible to call a webdynpro method from a normal ABAP class?
    2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    3. Is there any ways with which we can call portal event from ABAP class?
    Thanks,
    Shabir

    >1. Is it possible to call a webdynpro method from a normal ABAP class?
    I wouldn't necessarily recommend this approach. You shouldn't try to trigger events or any of the standard WDDO* methods from outside the WD Component itself.  That said, you can pass the object reference (like the WD_COMP_CONTROLLER object reference or the View Object Reference) into methods of normal classes.  Be careful if you are finding yourself calling a lot of your added methods from outside WD.  This is probably a sign that these methods should be in the Assistance Class or some other Class functioning as a Model Object.
    >2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    What exactly do you want to do here?  Do you just want to get the relaxation script?  For what purpose?  You should never need to inject the relaxation script into WDA. 
    >3. Is there any ways with which we can call portal event from ABAP class?
    To what purpose.  Do you just want to delegate the triggering of the event that is inside WD Component to be called from a class?  If so you can pass the portal API object reference into a class from the WD Component.  However this only works while running within WD.
    How is this class used?  Are you running in WD?  Are you trying to generate some HTML code that runs in the portal independent of WD?

  • Call business event from oracle workflow

    Hi,
    how to call business event from oracle workflow ?
    if possible, could you give any sample code.
    Thanks.

    In short terms: assign values to the attributes that compose the payload of the event. Then raise it. Here a simple example of raising the Flex Field compilation event:
    declare
    l_application_id fnd_application.application_id%TYPE := &1;
    l_descriptive_flexfield_name varchar2(200) := '&2';
    l_application_short_name fnd_application.application_short_name%TYPE;
    l_parameters wf_parameter_list_t := wf_parameter_list_t();
    begin
    SELECT application_short_name
    INTO l_application_short_name
    FROM fnd_application
    WHERE application_id = l_application_id;
    wf_event.addparametertolist(p_name => 'APPLICATION_SHORT_NAME',
    p_value => l_application_short_name,
    p_parameterlist => l_parameters);
    wf_event.addparametertolist(p_name => 'APPLICATION_ID',
    p_value => l_application_id,
    p_parameterlist => l_parameters);
    wf_event.addparametertolist(p_name => 'DESCRIPTIVE_FLEXFIELD_NAME',
    p_value => l_descriptive_flexfield_name,
    p_parameterlist => l_parameters);
    wf_event.raise(p_event_name => 'oracle.apps.fnd.flex.dff.compiled',
    p_event_key => (l_application_short_name || '.' ||l_descriptive_flexfield_name),
    p_event_data => NULL,
    p_parameters => l_parameters,
    p_send_date => Sysdate);
    end;
    Regards.

  • Getting ie error when calling event from code.

    Hi all!
    I've got an application (running on 6.40 sp8, ep6 sp2) that is pretty basic by all means. Since I want to implement some way to tell the user when he/she has made an error or just to inform him/her about something, I decided to use the ConfirmationDialog.
    I've created an action called onActionShowErrorMessage in my view. This action is tied to my controller and an event defined in the controller.
    Hence, when I want to show the ConfirmationDialog to show the user an error message, I call the controller method and in the method I fire the event that my view method is looking for.
    So far so good..
    When I call my controller method from a button action in the view everything works nicely, but when I try to call it from the wdInit method it fails?! I do get the ConfirmationDialog up but I also get an IE error window telling me that IE is trying to open a page it cannot find. I have no idea why it tries to open any page at all, since there is no navigation defined for this action.
    Anyone got an idea? I couldn't find any good stuff in the system logs either
    Best regards,
    Andreas

    Hello Sam!
    Thanks for your answer! I would like to use something more of a pop thing, since i want to make sure the user sees it. The MessageManager does not work as good as it used to anymore, since it puts all messages in the bottom of the page. This page needs to be scrolled in order to see the error message..
    Anyone got an idea of a workaround? I'm reading a propsfile, and in case I'm not able to read it I want to display this to the user.
    B.R
    Andreas

  • How to call an event from simple tree menu

    I have a simple tree menu that when I click on a menu item,
    id like a picture or other data to appear on the right side of the
    page.
    Thank you in advance,
    Jim

    The reason why it becomes zero when you press stop is that you selected the control to get the default value in the event structure if it's not connected. You can fix it by connecting it like I did in the first picture.
    To make it stop when you press the stop button you have to connect one stop button to the loop exit terminal. The reason for the sequence structure that I added is to make sure that the loop exits the first time you press the stop button, try removing it and you'll see what I mean.
    You have one additional problem. You rely on the x+1 output of the sub vi as an input for the next iteration. However, that is not reliable since if you can the subvi from somewhere else it might mess up the count. You're better of using a shift register and passing in the last value to the subvi in each iteration.
    Attachments:
    1.png ‏9 KB
    2.png ‏10 KB

  • Call event from another event

    I have a button where i need to call one event from another... does anyone have any ideas on what the syntax would be?
    public class PushButton extends Button
    public PushButton()
    * Mouse Pressed Event
    this.addEventHandler(MouseEvent.MOUSE_PRESSED,
    new EventHandler<MouseEvent>() {
    @Override
    public void handle(MouseEvent e) {
    System.out.println("MousePressed");
    * Mouse Released Event
    this.addEventHandler(MouseEvent.MOUSE_RELEASED,
    new EventHandler<MouseEvent>() {
    @Override
    public void handle(MouseEvent e) {
    System.out.println("MouseReleased");
              *// Make a call to the mouse pressed event????*
    }

    Hi,
    As per your requirement, i hope the below code should work. :)
    public class PushButton extends Button
         public PushButton()
               * Mouse Pressed Event
              final EventHandler<MouseEvent> mousePressedEvent = new EventHandler<MouseEvent>() {
                   @Override
                   public void handle(MouseEvent e) {
                        System.out.println("MousePressed");
              this.addEventHandler(MouseEvent.MOUSE_PRESSED, mousePressedEvent);
               * Mouse Released Event
              this.addEventHandler(MouseEvent.MOUSE_RELEASED,
                        new EventHandler<MouseEvent>() {
                   @Override
                   public void handle(MouseEvent e) {
                        System.out.println("MouseReleased");
                        // Make a call to the mouse pressed event
                        mousePressedEvent.handle(e);
    }Happy Coding !! :)
    Regards,
    Sai Pradeep Dandem.

  • Call event from other event or other vi

    I have LabVIEW 6.1.
    1. Can I call an event or a serious of events from another event? How can I do that? It doesn't matter if the events are executed after the event that called them is completed.
    2. Can I call an event from another vi? Let's say I have an event structure in a subvi. Can I trigger an event in the subvi calling it from the main vi? How would I do that?
    Thanks for your help.
    Jerome.

    Salutations,
    In reality, a program should only have 1 event structure. Or so someone much more knowledgable with labview has told me in the past.
    It's an important note to make that when running events or SubVi's, they will run until they are accomplished and then allow the next event or subvi to take place. So if you have multiple event structures, you must wait until one finished before the next one is run (This might...no guarantees, be avoided by multiple while loops and not locking the front panel on the execution of an event). Now, since you don't care, you can handle such a case. Just make multiple events in your one main event structure. I'm not sure what exactly you want to do, just make sure you "unfreeze" the front panel when you're messing with what handles what events.
    Hence, you could have a "run" button that's pressed and it goes about it's business. Then you could have a mouse down response, that you hit while your "run" process is still going, this will be, in a sense, logged and accomplished once the "run" task is done. Now, if you're looking for data to trigger another event, maybe I'd switch over to a case structure that's inside your event structure. For case structures, every case must have an output.
    Can you trigger an event in the subvi calling it from the main vi.... Excellent question... I'm not exactly sure when this would come up, but i'm not super experienced like some of the people around here. It may be possible, but i'd imagine a case structure would be more efficient. Like the ones in error handling. Pass the case to the subvi, it'll operate depending on what you want, and then continue along. Events seem most useful when dealing with events that occur on the front panel.
    Hope this helps,
    ElSmitho

  • Calling 'show hide' event from 'select' event

    Hi all,
    is it possible to call an event from another event?
    Can i call the 'show hide' event from the 'select' event to disclose the selected row?
    As a sidenote: is it possible to remove the show/hide button/link but to retain the show/hide functionality?
    Thanks in advance....
    Regards,
    Robert

    Hi Gabrielle,
    Yes indeed... the row information is sent... the 'select' event i'm refferring to is the one generated when you drag a viewobject as a readonly table to a UIX datapage...
    It is generated initially as
    <event name="select" source="EmpView10">
        <set target="${bindings.EmpView1Iterator}" property="currentRowIndexInRange" value="${ui:tableSelectedIndex(uix, 'EmpView10')}"/>
    </event>However i must have made a typo last time as it works now... ohwell.. made some changes and submitted the selected row as parameter using
        <invoke method="handleEvent" javaType="view.DisclosureEventHandler">
            <parameters>
                <!-- Selected row -->
                <parameter javaType="java.lang.String" value="${ui:tableSelectedIndex(uix, 'EmpView10')}" />
                <!-- SessionScope attribute to put detailDisclosure in -->
                <parameter javaType="java.lang.String" value="detailDisclosure" />
                <!-- All the other stuff -->
                <parameter javaType="oracle.cabo.servlet.expl.ControllerImplicitObject" value="${uix}"/>
            </parameters>
    </invoke>This works more cleanly and can be reused...
    Thanks for your replies... it always helps when someone is thinking along... it makes you takes some crossroads you wouldn't think of...
    Regards,
    Robert

  • Human task flow call back events with external web service

    Hi All,
    I have a requirement to call webservice inside human task flow. I have three participant in my human task flow. Let suppose A, B and C. When A approves then task will be assigned to B and when B approves it will go for C.
    My requirement is that, when A approves , then i need to call one external webservice to update database. For this i have enabled call back events from human task flow.
    In this way i got while loop inside my BPEL. In onTaskAssigned operation i am now trying to call external web service. My requriment is to call external service and get data from service. After getting response from the webservice, i want to assign it to next participant.
    But in this case, when user B approves, it goes to onTaskAssigned block and i am able to make external web service also but mean time, it has been assigned to User C which i do not want.
    I want Human task flow to wait for the web service response then only assign it to next participant.
    Please help.
    Regards,
    Sunil

    Hi Sunil
    Have you tried using WebServices Adapter. The usecase seems pretty straight forward. You have a WebService that has some code and some Operations to update some Database. First thing, I hope you have methods/Operations defined with request and response xsd for each operation.
    Now you define the main master payload, that should have all elements specific to your process and also few elements to store the output coming from each operation. Because response of each operation may need to go to other Task and get saved in the Payload also.
    You have like 3 Tasks. To complicate, I will assume that each Task can either Approve or Reject. And last 2 Tasks gets data from payload, previous task and also output from the WebService Operation (method).
    Task A -> Xor Gateway (Approve/Reject) -> If Approve -> Call WebServices Adapter -> Task B -> Xor Gateway(...) -> ......
    At each intersection, you can map the attributes for incoming and outgoing. Based on WebServices output also, you can have Another XOR Gateway and decide to send to Task B or do something else. So combinations of outputs of each service (task or webservice adapter) and XOR gateways, you can have a decent control on the overall flow.
    Note: I am hoping the webservices is Synchronous where you get the response immediately.
    Let me know if I am missing something.
    Thanks
    Ravi Jegga

  • How to call an event

    hi all.
    i have a jframe that implement window listener...
    what im trying to do is in windowopened i will check for a certain date and if that date is met i want it to call the windowclosing event...
    i dont wanna do it in other ways because in window closing event im deleting files and it wont work any other way...
    thanks in advance...

    Hi,
       While calling the event from wdDoInit(), you can just say
    wdThis.onAction<event name>(null);
    But make sure that within the event handler, wdEvent is nowhere used.
    Regards,
    Satyajit.

  • Call Custom Service from Event Receiver as Current User

    Hello,
    i bang my head on this problem for days now:
    My custom web service hosted in Sharepoint 2013 needs to know the logged on user name. I used to have a self-written impersonation in my service client before, but with switching to claims authentication this should be obsolete.
    So within my service i decode the user from
    IClaimsPrincipal icp = Thread.CurrentPrincipal as IClaimsPrincipal;
    IClaimsIdentity ci = (IClaimsIdentity)icp.Identity;
    String User = ci.ToString();
    This works well when i call the service from a custom aspx page.
    It utterly fails when i call the service from a List Item Event Receiver. The User always is the Application Pool Account.
    This is the Client code to open the Channel:
    private void SetChannelFactory(
    MyServiceApplicationProxy proxy,
    Uri address)
    if (null == proxy)
    throw new ArgumentNullException("proxy");
    if (null == address)
    throw new ArgumentNullException("address");
    // Check for a cached channel factory
    string endpointConfigurationName = GetEndpointConfigurationName(address);// Get the endpoint configuration name
    if ((null == s_ChannelFactory) || (endpointConfigurationName != m_EndpointConfigurationName))
    lock (s_ChannelFactoryLock)
    if ((null == s_ChannelFactory) || (endpointConfigurationName != m_EndpointConfigurationName))
    // Create a channel factory without specifying an endpoint address
    // so it can be cached and used for multiple endpoint addresses
    s_ChannelFactory = new ConfigurationChannelFactory<IMyServiceContract>(
    endpointConfigurationName, proxy.Configuration, null);
    // Configure the channel factory for claims-based authentication
    s_ChannelFactory.ConfigureCredentials(SPServiceAuthenticationMode.Claims);
    foreach (var operation in s_ChannelFactory.Endpoint.Contract.Operations)
    DataContractSerializerOperationBehavior behavior = operation.Behaviors.Find<DataContractSerializerOperationBehavior>() as DataContractSerializerOperationBehavior;
    if (behavior != null)
    behavior.MaxItemsInObjectGraph = 2147483647;
    // Store the current endpoint configuration name.
    m_EndpointConfigurationName = endpointConfigurationName;
    private IMyServiceContract GetChannel(
    MyServiceApplicationProxy proxy,
    Uri address)
    //Create Channelfactory
    SetChannelFactory(proxy, address);
    // Create a channel from the channel factory.
    return s_ChannelFactory.CreateChannelActingAsLoggedOnUser(new EndpointAddress(address));
    All research pointed out that "CreateChannelActingAsLoggedOnUser" would pass the current user (which is correctly identified within the event receiver!) to the service, but it doesn't work for my event receiver...
    Any advice on this would be great!
    With kind regards,
    Joachim

    You should be able to get the current user id from the SPListItemEventProperties object. From here you should be able to create a Claim. For example get the user by using
    user = SPWeb.Users.GetByID(properties.CurrentUserId)
    SPClaim claim = SPClaimProviderManager.CreateUserClaim(user.email, SPOriginalIssuerType.TrustedProvider, issuerIdentifier);
    https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimprovidermanager.createuserclaim(v=office.14).aspx
    Blog | SharePoint Field Notes Dev Tools |
    SPFastDeploy | SPRemoteAPIExplorer

  • Calling a thread from a cvi code file to another code file

                Hello, 
                I want to call a thread from a labwindows/cvi code file to another labwindows/cvi code file. Namely, my thread function (GraphLoop) is in 'TestsModel.c' ; but I will call the thread in 'Tests.c' .  My code in 'Tests.c' is in the following;
    int CVICALLBACK GraphLoop (void *functionData);
    int GraphLoopId;
    int callbackDataGraphLoop;
    int CVICALLBACK CBBasla (int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2)
    switch (event)
    case EVENT_COMMIT:
    CmtInstallThreadPoolCallback (poolHandle, EVENT_TP_THREAD_BEGIN, GraphLoop, callbackDataGraphLoop, GraphLoopId);
    if (tiklandiE3631ACihazinaBaglan == 0 && tiklandi34401ACihazinaBaglan == 0) // 'E3631A Cihazına Bağlan' ve '34401A Cihazına Bağlan' tuşlarına basılmamışsa uyarı verir.
    MessagePopup ("Uyarı", "Lütfen cihaz bağlantısını kontrol ediniz.");
    else
    if (tiklandiKaydet == 0)
    MessagePopup ("Uyarı", "Lütfen ayarları kaydediniz.");
    else
    SetCtrlAttribute (Testler, PnlTestler_BASLA, ATTR_DIMMED, 1); // 'Başla' tuşunu pasif hale getirir.
    SetCtrlAttribute (Testler, PnlTestler_BASLA, ATTR_DISABLE_PANEL_THEME, 1); // 'Başla' tuşunun etiketini pasif hale getirir.
    SetCtrlAttribute (Testler, PnlTestler_BITIR, ATTR_DIMMED, 0); // 'Bitir' tuşunu aktif hale getirir.
    SetCtrlAttribute (Testler, PnlTestler_BITIR, ATTR_DISABLE_PANEL_THEME, 0); // 'Bitir' tuşunun etiketini aktif hale getirir.
    CmtNewThreadPool (DEFAULT_THREAD_POOL_HANDLE, &poolHandle); //Yeni bir thread oluşturur.
    CmtScheduleThreadPoolFunction (poolHandle, GraphLoop, NULL, &GraphLoopId); // GrapLoop thread fonksiyonunu başlatır.
    break;
    case EVENT_RIGHT_CLICK:
    break;
    return 0;
              I take that errror after executing this code;
      error:Undefined symbol '_GraphLoop' referenced in "f:\Tests.obj"
             Please, can you help me for my question?
             Regards...

    Hello Eren,
    I assume this is a link error.
    Do you have TestsModel.c file included in your project?
    Constantin.

  • Calling a dll from a new menu item in Bridge.  Idiot help needed

    Hi,
    I'm trying to what I believe is a fairly simple script.  I'm coming from a hobbiest Delphi background, and to be honest I'm finding JavaScript a little bit hard to understand.  My requirements are simple - add a new menu item to Bridge which executes a call to a custom dll.  Note I'm not expecting the dll to return anything here.. 
    Looking at the samples provided even I can add the menu item - but getting it to successfully call the dll is a bit of a mystery. 
    The script compiles and adds the menu item, however the menu action doesn't call the dll.  I believe it should be a fairly simple task and was hoping somebody here could steer me right.  Here's my code (as you'll see a clear cut and paste job from the examples ;o)
    Header 1
    function SnpAddMenuItem()
      this.requiredContext = "\tAdobe Bridge must be running.\n\tExecute against Bridge CS6 as the target.\n";
      this.menuID = "snpmyMenu";
      this.menuCommandID1 = "snpAddMenuItemSub1";
      $.level = 1; // Debugging level
    SnpAddMenuItem.prototype.run = function()
      var retval = true;
      if(!this.canRun()) {
      retval = false;
      return retval;
      // Create the menu element
      var newMenu = new MenuElement( "menu", "myMenu", "before Help", this.menuID );
      // Create the menu item
      var alertCommand1 = new MenuElement( "command", "Load Stuff", "at the end of " + this.menuID, this.menuCommandID1);
      alertCommand1.onSelect = function (m1)
            ExternalObject.myDll = new ExternalObject('lib:/C/temp/apmDLL.dll');
            myDll.sendtoACRPM(1);
    //      return retval;
    SnpAddMenuItem.prototype.canRun = function()
      // Must run in Bridge
      if(BridgeTalk.appName == "bridge") {
      // Stop the menu element from being added again if the snippet has already run
      if((MenuElement.find(this.menuID)) && (MenuElement.find(this.menuCommandID)))
    // $.writeln("Error:Menu element already exists!\nRestart Bridge to run this snippet again.");
    // return false;
                MenuElement.remove(this.menuID);
      return true;
      $.writeln("ERROR:: Cannot run SnpAddMenuItem");
      $.writeln(this.requiredContext);
      return false;
    if(typeof(SnpAddMenuItem_unitTest ) == "undefined") {
      new SnpAddMenuItem().run();

    The dll needs to be compatable with the criteria set in the JavaScript Tools Guide. There is an example in the Bridge SDK that can be downloaded from http://www.adobe.com/devnet/bridge.html
    But it need someone who is knowledgeable with c++
    It would be great if someone could write a wrapper to access other external objects.

  • Call oracle reports from MENU in oracle ebs

    is it possible in oracle ERP EBS R12
    how to call oracle reports from menu [any screen] in oracle ebs erp r12??
    please help

    you may do a few things from menus and by adding buttons, but this is not really standard.
    You may add button on the form or web page that after a certain action or event. You'll have to do personalization / extension and everything is present in oracle for normal report submission.
    Why this is not done thru normal submission ?

  • How can i call mouse click event from keypress event???

    How can i call mouse click event from keypress event???
    I want same GUI changes to be occured at key press.....i.e . button going down & comming up.....
    for calculator

    Put all the code that happens on those events into a method. Then call that method from both events.

Maybe you are looking for

  • Lion Recovery Disk erased mounted volume

    Has anyone had this problem: I created a Lion Recovery Disk and it erased mounted volume? Can the data be recovered?

  • Manually create --- Rebate Credit memo

    Hi Gurus, How Can I create a Credit Memo manually which can fuction like a Rebate Credit memo in posting the credit to the G/L Accounts for rebate expenses. we donot want to use the  Rebate agreements. As of standard SAP we cannot create any rebate c

  • Job Work with Payment of Excise Duty

    Dear Gurus, We have done full process of job work without payment of excise duty. but we also want job work with payment of excise duty. we didn't found any way to do this job. When we make subcontracting entry with 541 mvt type and then make its exc

  • Aliases and cd-r downloads

    I have an e-Mac and lost (trashed and deleted) a small, self assembled, working reference library that was part of a much larger project that I have been working on for over three years. I didn't worry too much because monthly (if not weekly) I had r

  • Fixing pageheight in report printing

    i am using report bulider 6 on win2000. I am unable to stop page eject after a 5.5 inch high page. Any source of program control in plsql, bulit in SRW modules or SQLJ will help. i am using LX-300 dot matrix printer. further in win98 it is easily han