Trigger the Event

Hello Everybody,
I am trying to trigger the WF with the FM SWE_EVENT_CREATE but its not getting triggering the event.
When I use SWUE its working.
Can someone tell me whats wrong with this code -
DATA: GR_EVENT_ID LIKE SWEDUMEVID-EVTID,
      CREATOR     LIKE SWHACTOR.
      CREATOR-OTYPE = 'US'.
      CREATOR-OBJID = 'DEVELOPER'.
CALL FUNCTION 'SWE_EVENT_CREATE'
  EXPORTING
    OBJTYPE    = 'BUS21O5'
    OBJKEY     = '0010001439'
    EVENT      = 'CHANGED'
    CREATOR    = CREATOR
    DEBUG_FLAG = 'X'
  IMPORTING
    EVENT_ID   = GR_EVENT_ID.
IF SY-SUBRC = 0.
  WRITE: / 'Event created with ID :',GR_EVENT_ID.
  WRITE: / 'Workflow is Started'.
  T_CHAR-CHAR = 'Workflow is Started'.
ELSE.
  WRITE: / 'Event Id is not generated and Work Flow is not started'.
  T_CHAR-CHAR = 'Event Id is not generated and Work Flow is not started'.
ENDIF.
Thanks,
Sneha Singh.

Hi Sneha,
Try this code:
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
  EXPORTING
    object_type           = 'BUS21O5'
    object_key            = '0010001439'
    event                 = 'CHANGED'
*   COMMIT_WORK           = 'X'
*   EVENT_LANGUAGE        = SY-LANGU
  IMPORTING
    RETURN_CODE           = lv_return_code
    EVENT_ID              = lv_event_id
  TABLES
    INPUT_CONTAINER       = lt_INPUT_CONTAINER
    MESSAGE_LINES         = lt_meSSAGE_LINES
    MESSAGE_STRUCT        = lt_MESSAGE_STRUCT
Hope this helps!
Regards,
Saumya

Similar Messages

  • Automatically trigger the event to load data from Planning cube to Standard Cube

    Hello,
    We have a below set up in our system..
    1. A Planning BEx query using which user makes certain entries and writes back data to the planning cube.
    2. An actual reporting cube which gets data from the planning cube above.
    Now, what we want to do is to automate the data load from Planning cube to Reporting cube.
    This involves 2 things..
    1. Change the setting " Change real time load behaviour " of the planing cube to Planning.
    2. Trigger the DTP which loads data from Planning cube to reporting cube.
    We want to automate the above two steps...
    I have tried few things to achieve the same..
    1. Created an event in SM64,
    2. In the Planning cube "Manage" Screen,  clicked on "Subsequent Processing" and provided the event details. ( Not sure if its the correct place to provide the event detail ).
    3. Wrote a ABAP program which changes the setting of the planning cube (  " Change real time load behaviour " to Loading )
    4. Created a process chain, where we have used the event as a start variant, used the ABAP program as a next step, DTP run as the last step..
    This i hoped, would trigger the event as soon as a new request comes and sits in planning cube, which in turn would trigger the process chain which would load the data from Planning cube to reporting cube..
    This is not working. I dont think the event is triggering, and even if does i am not sure whether it will start the process chain automatically. Any ideas please ?

    hi,
    try to do the transformation directly in the input cube by using CR of type exit, more details :
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/43/1c3d0f31b70701e10000000a422035/content.htm
    hope it helps.

  • Check and Submit Button dont trigger the events

    All,
    I have two webdynpro activex buttons check and submit embedded on the form. These buttons have this script on their respective click events -
    app.eval("event.target.SAPSubmit();");
    app.eval("event.target.SAPCheckFields();");
    This inturn is supposed to trigger the code within the onCheck and onSubmit event handlers of SAP Interactive Form.
    But, when I click these buttons nothing seem to happen.
    Can someone help me resolve this issue as it is very criticial for me.
    Any help is highly appreciated.
    Many thanks,
    Divya

    All,
    I now made the events as "Server"and get an information message stating (Couldn't post data to '' ) when I click on these buttons.
    But, it still  does not trigger the event handler method.
    What can be wrong?
    Many thanks,
    Divya

  • How to trigger the event HANDLE_DATA_CHANGED manuallly?

    Hi experts,
       I have a requirement were i have a editable alv grid(container..). I have also used the event handle_data_changed.But the event gets triggered only if i press 'enter' after typing the data on the grid. But i need the event to be triggered when i press the save button which i have desinged in the gui status. Please suggest some ways and provide some sample code if possible.
    Thanks in advance
    regards,
    Ashwin

    you might have written code to handle SAVE ucomm.
    data: g_check.
    module status_0100 output
    set pf-status 'ZMAINGUI'.
    set titlebar  'ALVTITLE'.
    case sy-ucomm.
    when 'SAVE'.
          call method g_alv_grid->check_changed_data
            IMPORTING
              e_valid = g_check.
          if g_check = 'X'.
           *here you can write the same code what you have written in
           *HANDLE_DATA_CHANGED
          endif.
       endcase.
    endmodule.                    "status_0100 OUTPUT

  • How to trigger the event when leave current iView

    Hi Expert,
    We have this common senario: when leave current iView(eg, change the menu, close the window etc) we need to notify user whether they want to save current content or not, but I found wdDoExit(in views or coponent controller) can not be triggered
    Is there any event we can use to reside these logic?
    Thanks in advance.
    Best Regards,
    William

    How about trying to use the wdDoBeforeAction event?  You can use a flag to keep track of whether or not there is unsaved data, and check it in the above-mentioned event.
    Walter

  • Using the keydown option in order to trigger an event

    Hi all,
    This is my first question on this forum, and that is probably because i just started learning labview.
    I came across with an error, i could most likely solve in another programming language using C, but not in labview.
    I was wondering if someone could give me a hand with the following:
    I attached the program, which is probably a bit bad-written. Basicly, what im trying with the part on the left, is read all values from a controller on a GPIB bus.
    This part works like a charm, because i get all the values i want without any problem. After that, in the last step of this program, you have a while loop, with in there an event structure. The reason i took a while for that is because i dont want the program to start over at step 1. The event structure was first used with clicks of the mouse on the buttons, and a changed value with the numeric controls. Because a changed value did not work, cause the loop was constantly reading the values coming from the initial phases, i wanted to change the way the events were handled by a keydown of 'Enter'. I think, when you change a value in a numeric control and press enter, this could be perfectly used to trigger the events, instead of the value changes (because everytime the program reads the values in the sides, i think its considered like a value change). The fact is i dont really have an idea how to use the keydown as an event handler, any info on this would be greatly appreciated.
    I'm sorry if my english isn't the best, it's only my 3th language. Hope you understood and i can get some help for this issue
    Thanks in advance
    Thomas De Landtsheer
    Student
    Solved!
    Go to Solution.
    Attachments:
    Labview detection of keystroke.vi ‏197 KB

    The problem is a few
    blocks we havent really seen yet. All these numerics and stuff outside
    the while loop, what are they exactly, or are they just a different way
    of viewing them? The stuff with the digital at INI phase, The block
    in the lower right corner of the INI phase.
    The digital block in the
    dispatcher phase we didn't really understand. 
    I am not sure what you mean here can you circle it and send me a picture so that I can explain.
    Tim
    Johnson Controls
    Holland Michigan

  • How to trigger an event in the program

    Hi,
    I have a program. The purpose of the program is to retrieve the data matching the selection criteria and downlod the same to a file.
    In the selection screen, I have a parameter called 'EVENT'. Here, user enters some event name. Generally, they enter the 'Background job processing events'.
    So, my requirement is... once the files are successfully downloaded, the program should trigger the 'EVENT' specified in the selection screen at run time.
    Can someone help me in this regard. How to trigger an EVENT in the program. Is there any Function Module or Method available in SAP which triggers the EVENT at runtime.
    And is there any table available in SAP which stores all the events available in SAP. Because, whenever the user enters an EVENT in the selection screen, we should check whether the event is valid or not. So, if there is any table available which has all the events then, it will be easy I guess. or is there any other way to validate the EVENT name.
    Please help me. Thanks in advance,
    Best Regards,
    Paddu.

    Hello Paddu,
    have a look at tables
    - btcsev, btcsed (system events)
    - btcuev, btcued (user events)
    and use function BP_EVENT_RAISE.
    kind regards
    Walter Habich

  • How to setup to trigger an event when choose the value from cookie

    Hi,
    I define an firepartialaction event for the messageTextinput, this event can be triggered when the user key in the via keyboard. but failed to be triggered when the user choose the value from the cookie. How to setup or program to trigger the event even the user choose the value from the cookie?
    Best Regards,
    Jiang

    Hi,
    so the next missing information is what the event is that you expect to fire. If the cookie value is displayed in a list then John is correct and you populate the input field behind the scenes in which case e.g. no ValueChange listener fires or autoSubmit action is issued as you don't update the data through the UI component
    Frank

  • How to schedule a background job using the Event concept..?

    Hi Folks,
    I have a requirement that, I need a schedule a background job.
    Once after the previous job successful only, new job should get triggered. How to go ahead with this..?
    For Eg, I am scheduling a job called ZTEST periodically for 1 minute. If the job is not get completing with in 1 minute, I dont want to start my new job. Only after the success of my old job, I want my new job to run.
    Waiting for ur replies.
    Regards,
    Savi.

    Hi,
    You can use events that have already been defined, or you can create new events for scheduling background jobs.
    If you wish to use new events, do the following to implement the event scheduling:
    Define and transport the event as a user event with transaction SM62.
    You must define only event IDs; event arguments are not defined in the R/3 System. Instead, you specify event arguments when you schedule a job to wait for an event and when you trigger the event.
    If you define a new event, you must also transport it to your production systems. The event transaction does not have a connection to the transport system. Instead, you must create a transport request for the event yourself.
    Do this to transport an event:
    Create a transport request.
    Start the editor in the transport request and enter the following:
    R3TR TABU <table name> where table name is BTCSEV for a system event ID, BTCUEV for a user event ID.
    Press F2 with the cursor on the table name to call up the screen for specifying the table entries to transport. In this screen, enter the event ID’s that you have created.
    Save and release the transport request. Ensure that it is imported into your production system(s).
    To trigger an event, add:
    – the function module BP_EVENT_RAISE to your ABAP program, or
    – the program SAPEVT to your external script, batch file, or program.
    When your programs execute these keywords, an event will be triggered in the R/3 background processing system. The event-based scheduler is started immediately. It in turn starts all jobs that were waiting upon the event, subject to normal background processing restrictions, such as the requirement that the job has been released to start.
    Schedule the jobs that are to run when your events are triggered.
    You can schedule jobs for one-time start or to be started whenever an event is triggered.
    Regards,
    Raj.

  • How to call the event handler of other application....?

    Hi,
    I am working  on two applications.
    Now  i need to call a Event handler from my first application to my second application.
    I need a same process in this aaplication also. So i need to call the event handler of that application.
    So, Kindly tell me about the process to call the even handler of another application.
    Thanks in Advance.
    Regards,
    Prithivi

    hi,Prithivi..
    Unfortunately, as far as i know, i should tell you that : you cann't call the event-hanlder in another Application if the 2 applicaions are run in different IE browser...
    If your 2 component are used in the same IE browser, maybe you can make one interface event, and trigger it in one component, then handle the event in the second component(by reimplemented the former)...
    However, from your description, i think, you want to trigger the event handler in another application in different IE Browser...
    So, very upset..We cann't communicate between the 2 applications, as far as i know...
    Best wishes.

  • Trigger DATA_CHANGED event from triggered DATA_CHANGED event in second ALV

    Hello,
    I do have 2 ALVs (class CL_GUI_ALV_GRID) in a Splitter-Control.
    Both ALVs do have registered the event DATA_CHANGED in seperate handler methods.
    If there is a change in first ALV(line insertion with values), there will be inserted a new line with values in the second ALV.  After handling the event at first ALV, I call CHECK_CHANGED_DATA of the second ALV and REFRESH_TABLE_DISPLAY of the second ALV. I would expect that the call of CHECK_CHANGED_DATA would trigger the event DATA_CHANGED, but it does not trigger the event DATA_CHANGED of the second ALV.
    The problem is maybe that the input at the data is not made by the user(UI).
    What could I do to trigger this event and check the new data at second ALV?
    Yours Joerg

    Hello ,
    yeah thats correct , but in your case what you can do is
    g_grid1(first alv) >CHECK_CHANGED_DATA( Importing E_VALID =  l_Valid )>in the implementation method of this ..update global variable g_second = 'X' in order to refresh ALV2.
    g_grid1(first alv) -->Refresh_table_display( ).
    if g_second = 'X'.
    g_grid2-->SET_TABLE_FOR_FIRST_DISPLAY. so it will refresh the second alv contents.
    endif.
    regards
    Prabhu

  • Button catches the Event only on the second click

    Hi Experts,
    I am new to adobe forms and facing a very strange problem. I have 2 buttons on my interactive form "SUBMIT" & "APPROVE" , now the problem is whenever i load my application(Webdynpro ABAP) for the first time and click any of the 2 buttons the event
    ONSUBMIT of the ui element Interactive form is not caught(control doesnt reach the event) , but when i click any of these buttons from  the second time the control reaches the breakpoint successfully.
    I donot understand where i am going wrong , is there some java script that needs to be written in the initialise event of the buttons to make them trigger the event from the first click itself.
    Thanks In Advance,
    Chaitanya.

    Hi Chintan,
    Thanks for your replies, there wasnt any specific reason for using check field buttons was just experimenting with the component.
    Script in the Click event for button 1:
    // DO NOT MODIFY THE CODE BEYOND THIS POINT - 802.20071213024549.437972.422152 - SubmitToSAP.xfo
                          ContainerFoundation_JS.SendMessageToContainer(event.target, "submit", "", "", "", "");
                          // END OF DO NOT MODIFY
    Script in the Click event for button 2:(i am setting a flag when it is clicked)
                        var ref3 = xfa.resolveNode("xfa.record.APPROVE");
                        var ref2 = xfa.resolveNode("xfa.record.APPROVE").value;
                           ref3.value = "X";
                          // DO NOT MODIFY THE CODE BEYOND THIS POINT - 802.20071213024549.437972.422152 - CheckFields.xfo
                          ContainerFoundation_JS.SendMessageToContainer(event.target, "submit", "", "", "", "");
                          // END OF DO NOT MODIFY
    Version of ALD : 8.1
    Adobe Reader :  8.
    Should there be some code written in the initialize event of the button ?
    Thank you for your help so far,
    Chaitanya.

  • How to trigger a event when WBS gets changed in Cj02

    Hello,
    I have a requirement where I need to send create an idoc and send the idoc to external system when WBS is created or changed.  Currently, I have the following setup:
       - I have created a YBUS2054 as a subtype of BUS2054 using SWO1
       - YBUS2054 has been delegated to BUS2054
       - created an CHANGED event in the YBUS2054. This event is implemented and then released
       - created a type linkage (object type=YBUS2054, event=CHANGED, receiver type null, and receiver function module = zz_create_wbs_idoc) using SWETYPV. This function is supposed to create an idoc when CHANGED event occurs. I just don't know how to trigger the event to occur.
       - all the port, define idoc type, logical system, and etc are setup
       - when I try to create an entry in "Event for Chagne Document" using SWEC with change doc object=PROJ, business object type = YBUS2054, with on change, I get "Key for change doc object PROJ and business object type YBUS2054 are incompatible".
    I tried various configurations, and I was not successfully in creating an event on CHANGED
    can you please advise what I am missing in getting the changed event to trigger?
    Thank you in advance,
    Shawn

    Hi,
    If the change doc doesnt exist, check if you can create an event using BSVW.
    Also use the event log to see if there are other sap standard events happening.
    I checked the package belonging to CJ02 to see if there is something useable, but didn't find anything: CN_PSP_OPR
    If there are no sap standard ways to get an event, you'll have to find a badi/enhancement spot and include some coding to start the event using fm SAP_WAPI_CREATE_EVENT.
    Kind regards, Rob Dielemans

  • How to view what are all programs maped with the event....

    I am new to this events concept - could you please say
    in SM64 we can give Event....
    <b>How to view what are all programs maped with the event..</b>
    Thanks in advance.

    Hi Sam,
    See these links:
    How-to trigger a process chain using ABAP?
    Re: scheduling process chain 3 specific times a day
    NOTE: If you want to trigger the process chain from R/3, there are many examples in this forum. However, since the search function is not working now, I suggest you look at OSS Note 135637. This will show you how to do it also.
    Hope this helps.
    concerning to sm64 ..
    Triggering events manually ...
    Events let you start background jobs when particular changes in the R/3 System take place. When an event occurs, the background processing system starts all jobs that were scheduled to wait for that event.
    example : JOB_OPEN to create a background job..
    When scheduling a background job, you can specify it to start "after event".
    If you do so, you'll have to create an event in SM62.
    If a job is scheduled after event event and you trigger the event with SM64, the job will start.
    Events can be raised by external systems in SAP by sending a command to a SAP application server. You can also raise event in any program using function mosule BP_EVENT_RAISE.
    Reward if helpful.
    Regards,
    Harini.S

  • ALV oops - Prioritizing the events and customizing ADD icon in toolbar

    Hi Experts,
    Please help me on how to achieve the following functionalities in ALV:
    1. I have the events data_change_finished and user_command.Is it possible to trigger the event user_command first when both events are simultaneously called?
    2. I have an alv grid which initially has 3 rows of which in each row 4  cells are editable and 3 are non-editable.Now,when the user clicks on the toolbar to append a new row,I need to have only one cell as editable. For me it appends the new row which is the replica of the exiting row
    Kindly help me to resolve this issue.
    Thanks and Regards,
    Archna Raja

    Hi Archna,
    Two events can't be invoked simultaneously. So I am not quite able to visualize your scenario.
    For disabling individual cells in an ALV you can set cell properties for each cell as Disabled or Enabled.
    When a new line is added you can write the specific code to disable the additional two cells.
    Write in if you need more.

Maybe you are looking for

  • Need easiest way to transfer my old hard drive into a new purchased one

    I recently upgraded my 80GB internal HD with a 120GB. I just need to transfer everything I have onto my new one. Mac certified stores charge around 95$/hour so no way am I going to do that. However, I'm not really knowledgeable when it comes to backi

  • Opendocument can't open web i document

    dear all, need your help please i am trying to create hyperlink to open other webi report using opendocument ( my report create with java report panel, so i use opendocument.jsp ). my link is -> "http://<server>/businessobjects/enterprise115/desktopl

  • Signing off of some apps so it doesn't use data...

    I don't ever sign out of facebook and had downloaded pandora radio as well.  Do I have to completely sign out of the app when I close it out in order to not use data when not in wi fi area?  Yesterday when I turned off pandora radio, I just paused a

  • How do i change the VAT information on my account?

    Hi I have recently changed my billing information and I want to change my VAT information too ON my Adobe CC account I have gone through all the FAQs in the support section on Adobe.com and I didn't find how to do it Can you please help me with this?

  • Inspection Plan versions

    Hi,   Can we have Versions in Inspection Plan just like we have in MIC and Inspection Methods.? Appreciate your response Thanks SM