ABAP OO class-based workflow, wait step

Hello,
I'm hoping someone is able to help me.  I've implemented a class which triggers a custom workflow through a custom event of the class.  At one point during the workflow I want to use a wait step that waits for another custom event to occur.  I've created my second event which I want to trigger from an ABAP ALV Grid report for users, that will allow them to select the specific workflows to trigger this event for.  My problem is, I am having trouble figuring out how to find the correct object instance of my class from within the ABAP program and trigger the event specifically for that instance, so that the workflow can continue and eventually complete.  I have implemented the IF_WORKFLOW interface and up to this point the workflow is functioning correctly.
Thanks,
Leslie

Hello,
Sorry, not sure where my brain was. Actually I do know: at two clients with projects going live this month, so apologies for a rushed and inaccurate response. It's CL_SWF_EVT_EVENT.
Jocelyn's blog I referred to includes a code sample using the same class on how to raise an event with an object key.
Regarding your second question: No you don't need to do any binding. Just use an instance of your object and it will wait for an event with the same key. The WF part is very straightforward and works exactly like BOR, it's just raising event that can't be done with the WAPI.
Cheers,
Mike

Similar Messages

  • Abap-Class-Event in Wait Step

    Hi guys,
    in my workflow i have an activity with an abap method. This method works like a dialog. This means, i get a workitem in the business-workplace which shows a webdynpro where a pdf is displayed and where i can choose whether i click on button1 or button2.
    When i click on one button, an abap-class event will be created. This event has a container. My target is, to bring the user desicion back to the workflow via event.
    When i start a new workflow with this event then it works fine. But i dont want 2 workflows. I need a solution with one workflow. So i use a fork in my workflow. In branch 1 i have the activity which displays the pdf and create the event. In the other branch i have a waiting step, which waits for the event and bring the user-desision from the event-container to my workflow-container.
    That was my plan, but it dont works this way. I checked the event-trace and theres no receaiver entered for my event. So my workflow stoped at the wait-step (wait step is ready).
    I read, the the workflow system is automatikly doing the type-linkage and the instance-linkage, but i found only the instance-linkage filled. Can it be, that the wait step is only working with BOR-Events?
    Any ideas?

    Hi swangir,
    i tryed this FW SAP_WAPI_WRITE_CONTAINER some days ago. I can use SAP_WAPI_READ_CONTAINER easylie but when i try to modify the container then i get an enqeue exception in the SAP_WAPI_WRITE_CONTAINER FM. I guess this came up, because i call the webdynpro from an activie-step in the workflow and not a dialog-step. So i guess the container is locked and i cant write. I also tried to unlock it with dequee_e_ .. FM i forgot the name. But it also didnt work.
    Thats why i tryed to bring the user desision via event back to the workflow. And it works, as long i use 2 workflows, like i explained in my first post.
    What do u mean with...
    "Alternatively, you can bind back the class event container to workflow container by binding back from the dialogue step."
    Andre

  • SAP MDM Workflow: Wait Step

    Dear Experts,
    We have a scenario to send an email for the created/changed records periodically/daily, but a single mail should be sent for all the records to the users.
    And we think that we can make use of the Wait Step for this activity, but we are not getting the values for GM Time Field and Literal Time Field.
    Thanks And Regards
    Gaurav Kumar Sharma

    Hi Gaurav,
    You can also try this scenario:
    1.Create two ports one for outbound and other for inbound.
    2. Create a sydnication map which will trigger automatically at a specific time using MDSS which only synidcates the records which were created/updated on that day..... say material number
    3. Use PI to pick the syndicated file and drop it in a inbound port which was created earlier.
    4. Create a import map for importing the syndicated file use MDIS here, with a workflow for notification under configuration options.
    5. Workflow design will be start (Check out)->Notification->Stop (Roll back) which triggers on Record import.
    The above steps will help you to send notification of created and updated records in one mail using MDM.
    Let me know if you have any questions.
    regards
    Sowseel

  • Time based workflow:wait action not working

    I need to build a workflow for sending mail to manager if for an opportunity sales stage "requirement" remains for more than 30 days,I have given the workflow condition as:
    ([<SalesStage>] = "01 - Requirements")
    & then 2 actions 1st "Wait" & then "Send mail" somehow its not working.Please guide where i am getting wrong..

    Let me understand your business case: You need to send ONE email to the manager of the opportunity owner, if the Sales Stage = '01 - Requirements' for more that 30 days.
    You need two workflows and a unused/custom field (a boolean field is preferred). Both workflows are similar. The first workflow is based on the event - When new record saved. This workflow will be invoked as soon as a new opportunity is created. The second workflow is invoked whenever the opportunity is modified using the event - When modified record saved. Any user who has edit rights to the opportunity could modify the opportunity but not change the sales stage. This results in an unpleasant situation where the manager could be flooded with emails. That's where we use the boolean field to protect against multiple updates and ensure a single email is sent after 30 days if the sales stage is still '01 - Requirements'
    Workflow 1
    Record Type: Opportunity
    Event: When new record saved
    Condition:[<SalesStageId>] = "12ASA-XCD34" AND ([<IndexedBoolean0>] IS NULL OR [<IndexedBoolean0>] = "N")
    Note:
    1. IndexedBoolean0 is the field named Indexed Checkbox in the list of fields
    2. I have used the sales stage id. You have to find out the sales stage id for '01 - Requirements' and use it here.
    Workflow 1 - Actions (remember to activate all actions and workflows)
    1. Action = Wait
    Period= 30 days
    Reevaluate Rule Conditions After Wait = Y
    2. Action = Field Update After Wait
    Field Name = Indexed Checkbox
    Value = "Y"
    Overwrite Existing Values = Y
    3. Action = Email
    From > Specific Email Address> "[email protected]"
    To > Relative User On Record > Opportunity Owner's Manager
    Repeat this workflow configuration for Workflow 2, where the only difference is the event which should be When modified record saved
    Exposing the Indexed Checkbox on the opportunity detail page layout for all users is optional (not recommended). It might be a good idea to expose this checkbox on the opportunity detail page for the administrator role only... so that he/she can take corrective action if an email is not sent after 30 days.

  • Extend or delegate ABAP OO class

    Hi,
    How could I extend or delegate ABAP OO class in workflow. I have a scenario whereby I make copy of Standard workflow WS61000090 which uses ABAP class as workflow Objects. In one of the task, I need to put my logic with zmethod. I am in ECC 6.0 environment.
    Any Help is appreciated.
    Thanks.
    Bijay

    Hi Bijay,
    I encountered the same problem previously with leave requests (WS12300111) whose class (CL_PT_REQ_WF_ATTRIBS) was marked as final so I couldn't change or extend it. In addition, the workflow triggering logic coudn't be touched.
    Thus, I had two options:
    1. Create custom class for leave requests
    - in this option I would have had to rewrite the CL_PT_REQ_WF_ATTRIBS class and instantiate it in my workflow
    2. Create static class for leave request utilities
    - in this option I created a static (=no instances to be created) class with a few static methods with e.g. the request ID as an import parameter
    - and called the methods from my workflow
    I chose to go with option 2 since I only had a few methods I needed and was under time constraints. If there would then be other needs in the future for extracting/updating leave request data the class would then allow for further enhancements.
    I don't know what would be the most elegant way of going forward, but at least for me the static class/methods approach has worked all right. It just feels kind of silly to make a custom class completely rewriting the original abap class functionality to make it work. Especially because there might be upgrade changes to the class in the future...
    Best regards,
    Mikko

  • Excute workflow from step 3 by abap code

    hI,
    i want to excute workflow from step 3 by abap program. My workflow send mail from approval at 3 step.When approval is made then it will go for further processing.
    please give me code if possible.
    Regards,
    Gurprit
    Message was edited by:
            GURPRIT BHATIA
    Message was edited by:
            GURPRIT BHATIA

    hi Guprit,
    based on my experience you must trace why your workflow is wait.
    is it because the workflow is waiting for certain events ?
    or is it because of an error occured in the step 3 of the workflow ?
    if the worfklow is waiting for certain events, you can force it to continue with triggering the events that workflow wait ( transaction code SWUE )
    if an error occured in the step 3 of the workflow, you need to trace it what kind of error .... and for certain case after you fix the error you can continue the workflow by using tcode SWPR and restart the workflow after error.
    but unfortunatelly based on my experience, some times the workflow just stuck in the middle of the process and no error occured
    it this happens, ussually i re-triggered the workflow
    hopes it helps
    cheers

  • ABAP OO Exception Class based processing

    Hi there,
    Note: In going forward with SAP WAS 6.20, one can handle exceptions using exception-class based handling using RAISE EXCEPTION TYPE abc and then CATCHing it in TRY/ ENDTRY block. Standard method like GET_TEXT can be used to get the text of the exception raised.
    Question: If I know the EXCEPTION CLASS and Exception ID of my exception class, is it possible to get the exception text directly from the repository without creating the exception class object?
    E.g. Exception class is CX_MY_SECRET_ID
    and Exception IDs for this class are
    ID_NOT_FOUND,
    ID_EXPIRED,
    ID_IS_FOR_SPECIAL_ACCESS
    E.g. last two exception IDs are my warning conditions, and if such conditions are encountered, all I want to do is collect the warning messages. Whereas first exception ID condition (i.e. ID_NOT_FOUND) is an error for me, in which I have pass the exception back to the calling program. E.g. the source code is like this:
    PERFORM.......
    If ID is not found
       RAISE EXCEPTION TYPE ZCX_MY_SECRET_ID
               EXPORTING TEXT_ID = 'ID_NOT_FOUND'.
    else if ID has expired
       ...... then do I have to first raise the exception like raised above and CATCH it before I can get its text? or can I get the exception text directly without raising the exception first (as I know i have to retrieve the text of ZCX_MY_SECRET_ID exception class for Exception ID ID_EXPIRED)?
    In other words, if a certain condition is warning for my program, can I get the condition for that exception (from exception class based on exception class name and exception ID), or do I have to RAISE it first explicitely and then CATCH it immediately and execute GET_TEXT to get its text?
    Thanks very much!

    Hello Chetan,
    in basic the raise exception type xxx creates an exception object and aborts normal execution continuing in the enclosing try block.
    The Abap runtime contains some optimizations regarding the try block has an 'into xxx' clause. But as long you use the same exception you cant take benefit from this.
    As far I understand your problem you have two different kind of severities. So I would use 2 differnt exception classes (maybe derived from a common parent type, or one from the other).
    So both the code which throws the exception and the one which catches it are aware of the different semantic.
    Kind Regards
    Klaus

  • Custom proces type based on ABAP OO class

    Hy,
    I have a process type and in one method of its asoociated ABAP OO class I have to check if their process chains are running or not.
      I know how to make the tests, but the problem is that I have to integrate them in one method. I'm lookink for a solution to adapt the process type from :
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/509f3ae6-e36e-2910-48a8-ab43dc167dd9   
    Any suggestions about what should I keep or not and in which method should I put my tests?
    Thank you.

    Hello,
    Sorry, not sure where my brain was. Actually I do know: at two clients with projects going live this month, so apologies for a rushed and inaccurate response. It's CL_SWF_EVT_EVENT.
    Jocelyn's blog I referred to includes a code sample using the same class on how to raise an event with an object key.
    Regarding your second question: No you don't need to do any binding. Just use an instance of your object and it will wait for an event with the same key. The WF part is very straightforward and works exactly like BOR, it's just raising event that can't be done with the WAPI.
    Cheers,
    Mike

  • Wait step in leave workflow wait for 20 min

    hi friends
      I have designed a multilevel ESS leave workflow. After 1st approver the status need to change from approved to sent after that i am using a wait step with condition REQ.STATUS = SENT. This condition is met immediately but it still waits there nearly 15 to 20 min after that only it goes to the next approver. I dont no y its happening even after the condition is met. There is background job SWWCOND is directly related to this wait step. I have scheduled this job for every 3 min. But its long time to execute. If i remove the wait step its shows dump. How to minimize the time of execution of the wait step.
    Regards
    vijay

    Hello,
    Let me know if I've understood the problem correctly.
    You have a workflow with two wait steps.
    These wait steps rely on the running of SWWCOND
    to check if the conditions have been satisfied.
    The workflow takes 15-20 mins to pass the first condition, even
    when already true, but takes little or no time to pass the second
    condition.
    SWWCOND is scheduled to run every 3 mins and doesn't run for more
    than a couple of minutes.
    My questions:
    - Are you absolutely certain SWWCOND runs every 3 minutes?
      Do you see that happening in SM37 while your workflow is waiting?
    - You've said that the first condition is REQ.STATUS = SENT,
      what is the second condition?
    - Is REQ.STATUS a virtual attribute?
    - Where is REQ.STATUS set to SENT? Outside of the workflow?
      Does it do so without an error? Is a commit work done?
    regards
    Rick Bakker
    Hanabi Technology

  • Wait Step in Workflow

    Hi Workflow gurus,
    I have 2 questions want to ask.
    1. We have a wait step deadline monitoring in our workflow project. Let's say 30 day wait period. After 30 days workflow is getting triggered & everything works fine. But that is really required in Production. In Dev/QA systems we do not want to wait really 30 day. We want a small time period, let's say 1 day. Now what is the best way to handle this? Meaning Different time periods for different systems for the same workflow & same wait step period.
    2. If a work item is waiting for a wait step to be completed(for ex waiting for 60 day wait period) before 60 day itself,
    can we execute manually that work item using any std report?
    Kindly help me.
    Thanks,
    Pandu.

    Hi Pandu,
    1. There are a couple of things you can do in this instance. You could manually remove the deadline after the 1 day threshold.
    Open the work item and select Edit -> Change -> Change Deadline -> Excute and then remove the Requested Start deadline
    (ensure you have Technical View set for the work item display)
    Deadline monitoring (SWWDHEX) will have to execute before the work item will transition out of a Waiting state.
    Alternatively you could store the deadline parameter externally in a config table somewhere and retrieve it into the workflow for use with your deadline. Obviously when you change the configuration from 30 days to 1 taking care to ensure that the changes are not transported to prod. Not really fond of this since there is a risk of transporting the changes.
    2. Transactions like SWIA don't allow you to execute work items in a Waiting state. So as above go into the work item and either change the deadline or execute.
    I hope this helps,
    Best Regards,
    Trevor

  • Wait step stops during PI BPM workflow

    Hello Guys,
    I'm testing the one BPM scenario in my test system, during runtime the workflow stops before wait step (only 1 min) but after 1 min the message not process and it is stucked in  'in process' state.
    Earlier the scenario works good with wait step, but now it's not working in Dev & test systems but only working in Production system,
    Note: Recently we migrated from Service pack upgraded from PI 7.31 SP06 to SP11 in all three systems.
    Do you have any idea on this error?  could you please suggest me
    Thank you.
    Sateesh

    Hello Udo,
    You are absolutely right, I reschedule my background jobs in t.code SXMB_ADM_BPE then it resolved my issue.
    And I have one more question currently my PI systems are in 7.31 SP11 and getting error ' Cache content Obsolete' (SXI_CACHE-->deltaMonitoring)
    Could you please provide me any suggestions on this .
    Thank you.
    Sateesh

  • Workflow WAIT FOR EVENT STEP deadline not working

    Hi,
    Need some inputs for the experienced people;
    I have a wait for event step in a workflow with deadline monitoring (Latest End) but it doesn't seem to work.
    Ofcourse, all the required setting are in place and deadline works fine for other Activity steps.
    The problem is specific to Wait for event step.
    The alternative is having a fork but I just want to know why the wait step with deadline doesn't work.
    Thanks,
    Roopesh

    Hello Ajay,
    Can you share with us what did you do to solve your problem?
    I'm facing the same thing in my project now, I'm wandering if you could help me with this one.
    I have this wait for an event step wich is configured to wait 4 minutes since the work item creation. I've also selected 'Modeled' on the Action field, and a display text for the outcome.
    But in one of my tests, the event hasn't occurred and the workflow stuck in this task forever.
    Thanks in advance.
    Regards.
    Actually, I think I got this handled. This thread was really helpful to me: http://scn.sap.com/thread/47482
    Message was edited by: Leandro Farias dos Santos Abreu

  • Need info on wait step in workflow

    Hi All,
    I am working on workflow scenario, where I have a wait step for an event (to be triggered by an incoming Idoc). Now when a time frame is reached, a workitem should be raised for an agent to take the action ( to continue wait or cancel the process).
    I understand that the wait for an event step also raises a work item. So I am planning to design as follows.
    1. Activate the requested start date tab which will put the WI in the inbox. But not very sure how to capture the agent decision and go back to wait step or cancel accordingly.
    Can someone provide me some inputs?
    ~ Roopesh

    Hi Roopesh,
    I think the easy way is to wrap your wait process into a subworkflow. Then make a modeled deadline on your waitstep. In the modeled path, you then place your userdecission, that updates an exporting container with the result. (Cancel, retry or event received)
    This subworkflow is wraped in a loop that determines to continue or not using this container.
    Hope it helps
    Kind regards
    Mikkel

  • Include in ABAP class for Workflow

    Hi,
    In order to use BOR macros inside ABAP class, (From SAP help) came to know that we need to use include <cntn02> .
    How to add this include to ABAP class for workflow?
    Regds,
    Akshay

    Hi Akshay,
    Slight difference, I said "keeping the class clean of BOR <i>code</i>". By all means use BO's in the class: basically create a ZCL_MATERIAL, and use BUS1001 as an attribute (I use a naming convention BO_* for these). As long as it's the right type (SIBFLPORB I think - no system handy right now), and the key values are populated correctly the system will instantiate it as necessary. So in WF I can refer to ZCL_MATERIAL.BO_MATERIAL whenever I need any of the BO's functionality.
    You are correct though, creating a proper business class which you can instantiate such as material does involve a fair bit of effort and coding to set up. e.g. my last project I ended up creating one ZBOR subtype because all I needed was one new attribute - definitely not worthwhile creating a new class for. (USR01.zEmailAddress for what it's worth).
    I've said before somewhere, it's not without pain, so if you're under time pressure etc, then it may be better to do whatever's quickest. There's nothing wrong with using BOR macros, it will still work for quite a few versions. I just meant to say that pure class(y) code is a preferred way to go if it makes sense to do so. This is not always the case.
    Hope that helps,
    Mike

  • ABAP Classes in Workflow

    I am planning to use ABAP classes instead of BOR Objects in Workflow and would appreciate
    1) any elaborate documentation on the use of ABAP classes in workflow (SAP help has very limited documentation)
    2) comparision of using either approach with advantages of using ABAP classes over the use of BOR Objects and limitations of using ABAP classes,if any.
    3) any examples of ABAP classes used in Projects
    Thanks for your help.
    Saurabh

    Hi,
    check the wiki, in the design and development part are listed all of Jocelyn darts blogs about OO in workflow:
    <a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/2.DesignandDevelopment&">https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/2.DesignandDevelopment&</a>
    regards, Rob Dielemans

Maybe you are looking for