Skip to Content
avatar image
Former Member

Error Handling

Hi Experts,

I have developed a custom w/f using a custom business object. It is triggered from a custom transaction.

A person creates the transaction and then saves it. Workflow gets triggered and then goes to the Approver.

When the Approver executes the work item, then it opens the transaction in display mode and when approver chooses to go back, it takes him to the user decision where he can choose approve or reject option.

If he rejects , then he enters the comments for rejection and sends back for modifying the transaction. This block works fine.

If approver has decided to approve the transaction, then I need to check in the workflow if someone is already editing that record directly by executing the transaction. This particular user decision step uses METHODS tab in the W/F task and uses the BEFORE WORK ITEM EXECUTION block.

My question is how can I give an error message when the approver clicks on the Approve button , saying "Document is already being editied " ?

I check for if the transaction is locked or not. If locked then I use the below option.

exit_return 9001 sy-msgno sy-msgv1 sy-msgv2 sy-msgv3.

It doesn't work..

Please suggest how can I give error message when the workitem is executed ?

Thanks in advance...

S M

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jul 13, 2009 at 03:19 AM

    Hi,

    Check for [Lock Objects|http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eef3446011d189700000e8322d00/content.htm] for that application.

    Regards,

    Surjith

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Surjith,

      I am using lock objects in the Business Object Methods to Enqueue & Dequeue.

      If someone is editing then it is not updating but, how can I stop the workflow and thro an error ?

      Thanks,

      S M

  • avatar image
    Former Member
    Jul 13, 2009 at 04:14 AM

    You can try to use the Condition tab of the Decision step and try to use some coding that will determine if someone is editing and use it in the Complete workitrenm condition.

    Thanks

    Arghadip

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 13, 2009 at 12:00 PM

    To stop the workflow you can make use of the PROCESS CONTROL step and as you said the error message that you have include in the BOR mehtod it is not working did you try to activate the outcome in the OUTCOMES tab page of the activty step. or.

    if you activate then a separate outcome will be include in the template include a process control step in that outcome.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 16, 2009 at 08:50 AM

    In stead of using "uses METHODS tab in the W/F task and uses the BEFORE WORK ITEM EXECUTION block" you can add your check for "Document is already being editied " in the Busines object - methods program just before the function or transaction is being called. then call your own custom screen and display the Error message "Document is already being editied" and then used EXIT_CANCELED

    Add comment
    10|10000 characters needed characters exceeded