cancel
Showing results for 
Search instead for 
Did you mean: 

Error Handling

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

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

bpawanchand
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

surjith_kumar
Active Contributor
0 Kudos

Hi,

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

Regards,

Surjith

Former Member
0 Kudos

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