Terminating event and abap oo class

Hi, gurus,
I 'd like to know how the terminating event works.
for example,  i define a custom abap oo class (which has been implemented the interface of IF_WORKFLOW), and i want to use it as the terminating event of a standard task.
could you please tell me how does it works?
1. there must be an instance defined in the container of the task?
   which must be instanciated in the run time?
2. then in another abap report, i simply raise the event defined as the terminating event, using the same key, then the pending task will be terminated?
could you pls provide more information on this ?
thanks and best regards.
Jun

Hi Jun Zhang,
An event that is used to stop a workflow or task, or change the behavior of an already started workflow is called Terminating Event.
If the event linkage is active and the linkage rules are satisfied, the status of the work item is set to COMPLETED.
Defining Event Linkage  Terminating event linkage consists of 2 parts.
Type linkage which specifies business object type, event name, generic name for event receiver (WORKITEM for terminating events of tasks or EVENTITEM for wait for event steps)
Instance linkage which identifies the particular receivers (I.e. work item Ids) per object instance.
Terminating event linkages can be seen in SWE3.
For terminating events, along with Business object and Event a Container Element should be specified that holds the Object Instance.
Terminating Event for Workflow is available from Release 6.10 only. This is defined in Basic Data of Workflow Builder.
Binding Definition is optional for Terminating Events. Binding can be defined b/n event container and workflow container to pass event information to the workflow if required. That is the only way of passing information from an asynchronous method to the task that started it.
Thanks and Regards,
Prabhakar Dharmala

Similar Messages

  • Use of events and interface in class

    Dear All,
    Could you please explain why we use events and interface in class.
    Also please tell me the use of TRY and ENDTRY.
    Regards,
    Amar

    Events may be a way of communication b/w classes. Imagine you want to call certain code from one class, you would need for that public method, but you don't want to expose it to external user. So you may use events for that. Also events are used to notify that certain state of class has changed (tiggering event). Then all handlers of this event executes and react accordingly.
    Interfaces are a way of provide a service to class which implements it. Imagine that you have class office and hotel and gas station . They don't seems to have something in common. However, there can be some external energy provider which will be an interface. Each class which want to have a lease with this energy provided can implement it (the implementation can differ in some way), so he can provided energy to different classes. This way you will achieve polimorphism (meaning you call one interface method, but code behind it differs from class to class).
    Interfaces are also means of multiple inheritance. One class can implement several service (interfaces). In contrary it can oly inherit from one class.
    Try endtry are just new way of handling exceptions .
    Try to search a litte bit you will find lots of info on the above.
    Regards
    Marcin

  • Custom Events and Listeners between classes

    I've got a project I've been working on for weeks that I'm
    having yet another problem with. I'm trying to learn AS3 which is
    why it's taking so long but that's not important for this post.
    I wanted to create a custom event class so that I could make
    sure the event does not interfere with other "COMPLETE" events that
    are being passed between classes. In other words, I have a few
    things that need to complete prior to a function being called...
    one is some XML being loaded and another is a font loaded. So, I
    thought I would create a custom FontLoaded class that extends Event
    and make the type something like "FontLoadedEvent.LOADED". That way
    I could listen for the XML "Event.COMPLETE" and this font event
    also.
    Please tell me if I'm going down the wrong path here but I
    don't seem to be getting the dispatched event for my new custom
    event. Also, how does one detect if it's being dispatched other
    than if the eventListener is fired? Any other ways to test
    this?

    You can trace the event to see if it dispatched.
    Also, this is not a good case to create a new event. Custom
    events are used to store additional information. MouseEvent exists
    because Event doesn't have localX, localY, etc. properties. Since
    you don't seem to be throwing additional properties, you can use a
    regular event.
    trace(dispatchEvent(new Event("panelFontsLoaded"));
    addEventListener("panelFontsLoaded", onFontsLoaded);
    Static consts are used to help debug typos. The event type is
    just a string, often stored in a const.

  • Terminating event 'Created' in ABAP OO context

    Hi,
    I need a little help here. A lot of times I have used terminating event ‘Created’ for different BOR types – and asynchronous tasks where users are asked to create an object using call transaction from a work item.
    Now I am struggling with the same in ABAP OO and have an issue:
    The goal is to have a terminating event raised on a custom class  - and received by a work item if a customer is fully created, that is the general part, the company code part and the sales area part.
    Raising the event is working great. I have put in a class in trx. SWEC together with a function module which set the class as object type if the condition is fulfilled.
    Then in trx. SWED I have entered another function module to set the key for class together with object_por-catid = ‘CL’.
    Then when a customer master record is created I can see in the event trace that the event is raised with the correct key.
    No I want to receive the new object into my asynchronous dialog task. I define the event as terminating event – and in the code call transaction XD01.
    When the work item is created I find a waiting event linkage in trx. SWE3 – of cause without key; this is unknown until after creating.
    But after executing the workitem and raising the event the workitem does not receive the event and is therefore not completed.
    Is this approach not possible in ABAP OO – or do I miss something in the class definition / coding?
    The event is defined as public instance – I have not coded any event handler method.
    Thanks,
    Claus.

    Hello Claus,
    Interesting question, unfortunately not with a simple answer.
    The issue is that you are waiting for an instance event without a key. Your object raises an event with a key => No match.
    If you raise the created event without a key, you won't be able to match up two near-simultaneous creations with their corresponding work items. Same thing if you wait for a static event.
    So how does SAP do it with BOR events? By breaking the rules of course!
    They do some hidden trickery to bypass this problem by doing an 'Export to Memory' of the work item ID, and the CREATED event raising code bypasses the usual event linking mechanisms and looks for it's creator by retrieving the memory variable. I don't have the exact spots of code in my head, but a bit of debugging should find it.
    So what can you do? Given that you have full control of the class you could do something similar and maybe also create some kind of temporary key consisting of the Work Item ID and raise an event with that, or you could maybe skip the transaction concept completely and run the create GUI entirely within your WF step - maybe a custom screen gathering the initial data and then create the object via BAPI. Time to get creative!
    Hope that helps,
    Mike
    Edit: Or you could do the quick and dirty solution and just use the BOR events for the step and instantiate the class during the binding back to WF...

  • Workflow- Adding Terminating event into a Decision Step

    Hi
    I have a requirement like, in the decision step for example 'Approve' or 'Reject' has to be executed from the web application by triggering a terminating event for this decision step. I have copied the decision BO DECISION to ZDECISION and created two terminating events and make it ashynchrounous. But this step is not getting executed in the workflow showing error as 'no terminating event is attached to the task'.
    Any input on this is welcome. If you could reply bit early as I need the information ASAP.
    Thanks in advance.
    Padman

    Hi Padman,
    Weclome to the SDN forums. We don't have a specific Workflow forum yet. Please post your questions in the General SDN Forum until we do.
    I moved your questions there.
    Thanks, Mark.

  • Link BOR Event with ABAP code (program or function)!

    Hello experts,
    I am trying to link program or function to bor event. Change of data in HR IT0002 trigger event CHANGE of PERSDATA Object. I need to execute some ABAP code (program or function) on CHANGE event, so I have to link event and ABAP code.
    Question: is it possible and how?

    Hi,
    It is very much possible....
    You can use the Workflow & use BO as PERSDATA & this workflow can be triggered on event change.
    & You can write your code ...
    Regards,
    Rahul

  • Use abap class event as terminating event

    Hi,
       The class is say ZCL_WF_CLASS and the event  END_WF.
    What needs to be done to have this event used correctly as a terminating event of a workflow? Does this event require a parameter to hold the workitem id (or workflow id), as currently this event has no parameters?
    Previous developer has developed the class and event and installed as a terminating event but the workflow is going into error not terminating correctly. I believe the incorrect development of the event and/or its use in the workflow is the issue. Note that nowhere is this event currently raised in any code of the workflow.
    Cheers,
    Ross

    Hello,
    Unless I'm mistaken, a terminating event for a workflow is just like any wait-for event in a workflow.
    It can be based on any object or class and it can be used in various ways - to terminate a branch or terminate the workflow, for example.
    The workflow listens out for the event and checks if there is a matching key. You could base it on the key of a workflow object but it makes more sense to base it on an object or class that's used in the workflow - e.g. the POSTED event of an object would be used to terminate a workflow seeking approval for the posting of an object.
    It definitely won't work if the event has no parameters. I guess if you do base it on the workflow object then you would use the top-level workitem id. Try it with a test workflow and SWUE to generate the event.
    regards
    Rick Bakker
    hanabi technology

  • INTERFACE AND EVENTS IN ABAP OO

    Can some one explain me the real time need with example for use of interfaces and events in abap objects
    (asking interface and events along doesnt mean that i am relating them).
    <removed_by_moderator>
    Pankaj Giri
    Edited by: Julius Bussche on Jul 14, 2008 1:36 PM

    Events :
    Technically speaking :
    " Events are notifications an object receives from, or transmits to, other objects or applications. Events allow objects to perform actions whenever a specific occurrence takes place. Microsoft Windows is an event-driven operating system, events can come from other objects, applications, or user input such as mouse clicks or key presses. "
    Lets say you have an ALV - An editable one ...
    Lats say - Once you press some button  you want some kind of validation to be done.
    How to do this ?
    Raise an Event - Which is handled by a method and write the validation code.
    Now you might argue, that I can do it in this way : Capture the function code - and call the validate method.
    Yes, in this case it can be done.. But lets say .. you change a field in the ALV and you want the validation to be done as soon as he is done with typing.
    Where is the function code here ? No function code... But there is an event here - The data changed event.
    So you can raise a data changed event that can be handled and will do the validation.
    It is not user friendly that you ask the user to press a button (to get the function code) for validation each time he enters a data.
    The events can be raised by a system, or by a program also. So in this case the data changed event is raised by a system that you can handle.
    Also, Lets say on a particular action you want some code to trigger. (You can take the same example of validation code). In this case the code to trigger is in a separate class. The object of which is not available here at this moment. (This case happens very frequently).
    Advantage with events : Event handlers can be in a separate class also.
    e.g : In the middle of some business logic .. you encounter a error. You want to send this information to the UI (to user - in form of a pop up) and then continue with some processing.
    In many cases - A direct method call to trigger the pop up is not done. Because (in ideal cases) the engine must not interact with UI directly - Because the UI could be some other application - like a windows UI but the error comes from some SAP program.
    So - A event is raised from the engine that is handled in the UI and a pop up is triggered.
    Here -- I would have different classes (lets say for different Operating Systems). And all these classes must register to the event ERROR raised in application.
    And these different classes for different Operation systems will have different code to raise a pop-up.
    Now you can imagine : If you coded a pop-up for Windows (in your application logic) .. it will not work for Mac or Linux. But of you raise a event.. that is handled separately by a different UI classes for Win, Linux or Mac  they will catch this event and process accordingly.
    May be I complicated this explanation .... but I couldn't think of a simpler and concrete example.
    Cheers.
    Varun.

  • Event handling in global class (abap object)

    Hello friends
    I have 1 problem regarding events in abap object... how to handel an event in global class in se24 .
    Regards
    Reema jain.
    Message was edited by:
            Reema Jain

    Hello Reema
    The following sample report shows how to handle event in principle (see the § marks)..
    The following sample report show customer data ("Header"; KNB1) in the first ALV list and sales areas ("Detail"; KNVV) for the selected customer (event double-click) in the second ALV list.
    *& Report  ZUS_SDN_TWO_ALV_GRIDS
    REPORT  zus_sdn_two_alv_grids.
    DATA:
      gd_okcode        TYPE ui_func,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_splitter      TYPE REF TO cl_gui_splitter_container,
      go_cell_top      TYPE REF TO cl_gui_container,
      go_cell_bottom   TYPE REF TO cl_gui_container,
      go_grid1         TYPE REF TO cl_gui_alv_grid,
      go_grid2         TYPE REF TO cl_gui_alv_grid,
      gs_layout        TYPE lvc_s_layo.
    DATA:
      gt_knb1          TYPE STANDARD TABLE OF knb1,
      gt_knvv          TYPE STANDARD TABLE OF knvv.
    "§1. Define and implement event handler method
    "     (Here: implemented as static methods of a local class)
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_knb1      TYPE knb1.
        CHECK ( sender = go_grid1 ).
        READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
        CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
        CALL METHOD go_grid1->set_current_cell_via_id
          EXPORTING
    *        IS_ROW_ID    =
    *        IS_COLUMN_ID =
            is_row_no    = es_row_no.
    *   Triggers PAI of the dynpro with the specified ok-code
        CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      SELECT        * FROM  knb1 INTO TABLE gt_knb1
             WHERE  bukrs  = '1000'.
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create splitter container
      CREATE OBJECT go_splitter
        EXPORTING
          parent            = go_docking
          rows              = 2
          columns           = 1
    *      NO_AUTODEF_PROGID_DYNNR =
    *      NAME              =
        EXCEPTIONS
          cntl_error        = 1
          cntl_system_error = 2
          OTHERS            = 3.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Get cell container
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 1
          column    = 1
        RECEIVING
          container = go_cell_top.
      CALL METHOD go_splitter->get_container
        EXPORTING
          row       = 2
          column    = 1
        RECEIVING
          container = go_cell_bottom.
    * Create ALV grids
      CREATE OBJECT go_grid1
        EXPORTING
          i_parent          = go_cell_top
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    "§2. Set event handler (after creating the ALV instance)
      SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1.  " Or:
    " SET HANDLER: lcl_eventhandler=>handle_double_click FOR all instances.
      CREATE OBJECT go_grid2
        EXPORTING
          i_parent          = go_cell_bottom
        EXCEPTIONS
          OTHERS            = 5.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Display data
      gs_layout-grid_title = 'Customers'.
      CALL METHOD go_grid1->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNB1'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_knb1
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      gs_layout-grid_title = 'Customers Details (Sales Areas)'.
      CALL METHOD go_grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'KNVV'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = gt_knvv  " empty !!!
        EXCEPTIONS
          OTHERS           = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * NOTE: dynpro does not contain any elements
      CALL SCREEN '0100'.
    * Flow logic of dynpro (does not contain any dynpro elements):
    *PROCESS BEFORE OUTPUT.
    *  MODULE STATUS_0100.
    *PROCESS AFTER INPUT.
    *  MODULE USER_COMMAND_0100.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.  " contains push button "DETAIL"
    *  SET TITLEBAR 'xxx'.
    * Refresh display of detail ALV list
      CALL METHOD go_grid2->refresh_table_display
    *    EXPORTING
    *      IS_STABLE      =
    *      I_SOFT_REFRESH =
        EXCEPTIONS
          OTHERS         = 2.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
    *   User has pushed button "Display Details"
        WHEN 'DETAIL'.
          PERFORM entry_show_details.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  ENTRY_SHOW_DETAILS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM entry_show_details .
    * define local data
      DATA:
        ld_row      TYPE i,
        ls_knb1     TYPE knb1.
      CALL METHOD go_grid1->get_current_cell
        IMPORTING
          e_row = ld_row.
      READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
      CHECK ( syst-subrc = 0 ).
      SELECT        * FROM  knvv INTO TABLE gt_knvv
             WHERE  kunnr  = ls_knb1-kunnr.
    ENDFORM.                    " ENTRY_SHOW_DETAILS
    Regards
    Uwe

  • Why and how to use events in abap objects

    Dear all,
      Please explain me why and how to use events in abap objects with real time example
    regards
    pankaj giri

    Hi Pankaj,
    I will try to explain why to use events... How to use is a different topic.. which others have already answered...
    This is same from your prev. post...
    Events :
    Technically speaking :
    " Events are notifications an object receives from, or transmits to, other objects or applications. Events allow objects to perform actions whenever a specific occurrence takes place. Microsoft Windows is an event-driven operating system, events can come from other objects, applications, or user input such as mouse clicks or key presses. "
    Lets say you have an ALV - An editable one ...
    Lats say - Once you press some button  you want some kind of validation to be done.
    How to do this ?
    Raise an Event - Which is handled by a method and write the validation code.
    Now you might argue, that I can do it in this way : Capture the function code - and call the validate method.
    Yes, in this case it can be done.. But lets say .. you change a field in the ALV and you want the validation to be done as soon as he is done with typing.
    Where is the function code here ? No function code... But there is an event here - The data changed event.
    So you can raise a data changed event that can be handled and will do the validation.
    It is not user friendly that you ask the user to press a button (to get the function code) for validation each time he enters a data.
    The events can be raised by a system, or by a program also. So in this case the data changed event is raised by a system that you can handle.
    Also, Lets say on a particular action you want some code to trigger. (You can take the same example of validation code). In this case the code to trigger is in a separate class. The object of which is not available here at this moment. (This case happens very frequently).
    Advantage with events : Event handlers can be in a separate class also.
    e.g : In the middle of some business logic .. you encounter a error. You want to send this information to the UI (to user - in form of a pop up) and then continue with some processing.
    In many cases - A direct method call to trigger the pop up is not done. Because (in ideal cases) the engine must not interact with UI directly - Because the UI could be some other application - like a windows UI but the error comes from some SAP program.
    So - A event is raised from the engine that is handled in the UI and a pop up is triggered.
    Here -- I would have different classes (lets say for different Operating Systems). And all these classes must register to the event ERROR raised in application.
    And these different classes for different Operation systems will have different code to raise a pop-up.
    Now you can imagine : If you coded a pop-up for Windows (in your application logic) .. it will not work for Mac or Linux. But of you raise a event.. that is handled separately by a different UI classes for Win, Linux or Mac  they will catch this event and process accordingly.
    May be I complicated this explanation .... but I couldn't think of a simpler and concrete example.
    Cheers.
    Varun.

  • How to Handle Business Object event in ABAP class

    Hello Everybody,
    I wanted to know if it was possible to reference BOR objects in ABAP class and handle BOR events in ABAP Objects.
    Thanks in advance.

    Hi,
    Catch the et_VALIDATE event, when InnerEvent = False and ItemChanged = True.
                If pVal.EventType = BoEventTypes.et_VALIDATE Then
                    If pVal.InnerEvent = False And pVal.ItemChanged Then
                        'TODO Your code here...
                    End If
                End If
    Regards,
    Vítor Vieira

  • ABAP OO Class and Change Documents

    I have created a class based on the IF_WORKFLOW interface.  I created a couple of events.  I created a workflow task assigned to a custom method of the class.  I setup the Material Change Document to trigger the class event when there is a change.  The workflow task does trigger when I change a material, but I don't know how to pass the key of the Change Document (matnr) to the workflow task/method using the ABAP OO Class interface.  Any help?
    Thanks,
    Kenneth

    Thanks for the reply Florin.  Yes, I have seen Joclyn Dart's Whitepaper and blogs.  They are very helpful, but I haven't seen much information within them about Change Documents.  I tried your suggestions, but the material key is still not being filled when I trigger the change document and workflow task using tcode MM02.
    Here is what I have done:
    Created an Attribute 'Material' type mara-matnr and checked 'Key Attribute'.
    Created an Attribute M_POR type SIBFLPOR.
    Here are the methods:
    Constructor with parameter 'Material' *
    METHOD constructor.
      me->m_por-catid = 'CL'.
      me->m_por-typeid = 'ZMM_WF_MATTEC'.
      me->m_por-instid = me->material.
    ENDMETHOD.
    Find_by_lpor with parameters LPOR and RESULT (default params) *
    METHOD bi_persistent~find_by_lpor.
      DATA: p_material TYPE matnr.
      MOVE lpor-instid TO p_material.
      TRY.
          CREATE OBJECT result
            TYPE
              zmm_wf_mattec
            EXPORTING
              material      = p_material.
        CATCH cx_bo_error .
          EXIT.
      ENDTRY.
    LPOR with parameter RESULT (default param) *
    method BI_PERSISTENT~LPOR.
    result = me->m_por.
    endmethod.
    ENDMETHOD.
    Custom method MAT_CHANGED with parameter 'Material' * (not coded yet)
    This is the task being triggered by the Change Documents *
    METHOD mat_changed.
    ENDMETHOD.
    Edited by: Kenneth Moore on Nov 4, 2008 11:00 AM

  • ECC6.0 WebDynpro(ABAP) - raising terminating event

    Hi, in ECC6.0 I have a custom WDA application with a custom workflow.  The workflow is launched via an event that is raised in the WDA application.  However, at one point workflow sends a link to one of the WDA pages, whereby the user clicks a button which raises what should be a terminating event for the workflow task.  However, while this event is raised, as confirmed in SWEL, it doesn't terminate the task.  The event is raised through a WDA assistance class.  The object type, event and object key are all being set properly during the raising of the event.  Viewing the event in SWEL confirms the proper setting of the key fields.  So why isn't the step terminating?
    Thanks in advance,
    Kevin

    Hi,
    If the object that is waiting for event has no instance, the task will not be terminated when the event is created in the system (As I said). So now the reason is clear for you.
    >The event is raised through a WDA assistance class
    I am not sure what you mean by this. You raise the event from the WDA assistance class? Or you raise an event for the assistance class? (Or perhaps both?).
    If you raise the event for the assistance class, you should have an instance of that class in the workflow container (which you would then bind from workflow container to the task container). So, now the question is: do you have an instance of the assistance class in the WF container (when you look it from log)? Or is it initial also?
    Actually I don't really even understand how you have managed to combine the WDA assistance class and WF class? How do you actually start the workflow (with which kind of event)? Whatever event it is, it should most likely instantiate some class/object in the workflow. Then in your problematic task you should most likely use this same class in the terminating event (unless there is something really fancy in your workflow).
    Regards,
    Karri

  • Copy of task TS50000075 and  EXTSRV - termination event not working

    Hi,
    We have done copy of TS50000075 and extended business object EXTSRV to ZEXTSRV
    this was done to call function module ISR_CALL_FOR_CHANGE to open up adobe form in edit mode
    it works well but the task is not terminated
    if termination event is put just like TS50000075 like WIOBJECT, ZEXTSRV COMPLETED then workitem never ends and always stays in inbox
    ZEXTSRV COMPLETED event is not triggered when the workitem is completed in the UWL
    even if we trigger this event programatically , it does not find receiver and the task stays in-process
    if termination event is put as _WORKITEM PROCESSED then it bahves like synchronous task ie even if the workitem is clicked and form is not completed, the workitem ends. so the user can click it only once
    also i've tried following
    1 - used the function module to complete the workitem in QISR BADI. but the workitem ID is not available inthe BADI. If I try to export it from business object method and import in BADI, it doesnt work
    2 - find active workflows and derive workitem id and complete workitem using FM SAP_WAPI_WORKITEM_COMPLETE
         this FM doesnt work , step becomes logically deleted which is not desirable
    3 - find active workflows and derive workitem id and complete workitem using other FM SAP_WAPI_SET_WORKITEM_COMPLETD
         work item is complete but there is workflow error - cannot determine succesor node
    4 - find active workflows and derive workitem id and change a particular container element
        check this container element in complete workitem condition in activity step of dialog step of workflow of this task-
         workitem stays inprocess
        check this container element in parellel wait step to complete the workitem-
         parellel step executes but fork is not complete, workflow doesnt proceed
    kindly help in this matter. the workitem does not get completed at all even if we force complete, workflow goes in error of - cannot determine succesor node.
    is there anything specific to the EXTSRV-PROCESS method which makes the TS50000075 task to trigger EXTSRV-COMPLETED and end the workitem ?
    help is much needed in this case
    thank you,
    b

    Hi,
    You need to see the event in SWEL, otherwise it will never work with workflow. Make sure that the event monitor is on (in transaction SWELS).
    I cant see the event in SWEL. The vent monitor is on because if I create event in SWUE, it shows up.
    How you actually create the event now?
    There is BADI QISR which is always called to handle user action of PDF form. I have written the function modue to create event in the user action
    >If i trigger it using funciton module -- then it doesnt find any receivere so it doesnt terminate the task. it is seen in SWEL with no receiver found. do i still need to do commit work ?
    You need the COMMIT WORK always if you trigger the event in any program&function or whatever.
    ok ill try doing commit work after the create event function module
    Test your event with transaction SWUE. Make a test case first in a way that the task is waiting in the inbox/UWL. Then create the event in SWUE. Now, if the task gets completed, you will know that that event itself is working and your terminating event configuration is done properly. If this works, your only problem is in the event creation itself. And for that you need to tell exactly how you create the event. If you do it with your own custom code, use SAP_WAPI_CREATE_EVENT and don't forget to have COMMIT WORK after the function call.
    I am doing exactly like you said. but it doesnt work ie even if I create the event in SWUE, the workitem doesnt get completed.
    This event is seen in SWEL with no receivere found
    I am able to infact set the workitem to complete using WAPI funciton module to complete teh task in the BADI.
    but the workflow goes in to error saying , next node cannot be determined
    Regards,
    Karri

  • 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?

Maybe you are looking for

  • Time Machine will not recognize hard drive

    Time Machine tells me "You cannot open "Time Machine" preferences pane because it is not available to you at this time." My Lacie HD is on and mounted. I have erased it and repartitioned it and still get nothing. I get the would you like to set up TM

  • Email with special characters

    Hi Gurus, I'm working on a table of below structure. namexxxxx message [email protected] abc123 [email protected] def456 Now, I'm sending mail based on this table using SMPT_UTIL. but the problem is, their exists some special characters (ITALY langua

  • Ask the Expert: FlexVPN and Internet Key Exchange Version 2 (IKEv2)

    With Jay Young-Taylor Welcome to the Cisco Support Community Ask the Expert conversation. This is an opportunity to learn and ask questions about  FlexVPN and IKEv2 with Welcome to the Cisco Support Community Ask the Expert conversation. This is an o

  • How can i work in office word or excel

    Hello sir, 1) Is there any options to make new file in word or excel? 2) How can i work in new file of word or excel or it's only use for update file?

  • Editing live tracks

    I imported a live multi-track recording of my band. Can I edit the individual instrument tracks? (ie. fix bad notes, in pitch or in time..?) Thanks!