转 Raising exceptions in a method and handling the same in the workflow

本文档详细介绍了在SAP Business Object Builder中定义方法异常的过程,并演示了如何将这些异常集成到工作流程中进行处理。首先,通过Business Object Builder创建业务对象及方法,并设置异常类型如临时错误、应用错误和系统错误。接着,在工作流程中捕获这些异常并定义相应的处理步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Raising exceptions in a method and handling the same in the workflow

By Suresh Kumar Parvathaneni, from link.

This document details the procedure in defining exceptions in a method and using the same in a workflow. 
Let us first look at raising exceptions in a method: 

Go to Business Object Builder (Transaction SWO1). 

Create a business object. 
 

Now create a method.

 

Now select the method you have created and click on button “Exceptions” available on the toolbar.

Following screen appears:

 

Now click on Create. Following popup screen appears: 

 

Enter the information as shown above. The error type “Temporary error” is chosen in the case wherein the record is locked by somebody else or some required resource is not available. The error type “Application Error” is to be chosen when there is no authorization for the document you are processing. The error type “System error” is to be chosen if there are no values passed for the mandatory parameters. 

Click on continue.

Go back to the main screen.

Now in the method, provide the following code:

 

Save the business object and release the same. 

 

Try executing the method by clicking on Test/Execute (F8). The exception would be raised as shown below: 

 

Capturing the exception raised by the method in the workflow: 

Go to Workflow Builder (TCode: SWO1). 

Create the step “Activity”

 

Create a task and provide the following details in the new task: 

 

Save your entries and return to the previous screen. 

 

Click on “Outcomes” tab. Here you can observe the exception you defined in your method:

 

As observed in the observe screen, the outcome is not active by default. If we do not handle the exception, the work item might go into the error status. Activate the outcome:

Save your entries and go back to the main screen of Workflow builder. Please ensure that you have done the agent assignment for this task. 

 

You can now observe a new branch when the exception is raised. You can define your steps whenever the exception is raised. 

References:

http://help.sap.com/saphelp_nw04s/helpdata/en/c5/e4ad98453d11d189430000e829fbbd/frameset.htm

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值