1、SAP workflowOK第一节: 现在开始总结workflow,虽然有些过时的技术,但是还是有很多公司在使用,特别是一些比较大的企业,系统升级比较慢。也为自己知道的,做过的事情有一个总结,希望还能有点参考意义。 1 从目的上来说,就是让整个业务更加流畅,更加透明,更加方便快捷。 2 既然有了workflow,就应该相应的有一个管理系统,以及一个开发环境,这些我们都能够在sap中找到。 T-code: SWDM 3 在使用workflow之前,我们必须明白一件事情,那就是不管什么样的workflow,都会有一整套的业务原型。在定义workflow之前,应该找到相应的已经存在的模型(或许也可以
2、自己开发)。 4 不要误会workflow的功能,其实它是很强大的,虽然我们经常只使用它的一部分功能。包括,email的通知,transaction的集成,不同系统之间的数据交换(ALE/EDI)等等。 Workflow的定义: 每个workflow都能在sap中找到业务流程; Workflow由很多的步骤组成; Workflow可以由事件触发; Workflow的创建: 如果我们已经知道了业务如何执行,那么就可以创建自己的workflow了,于是我们会需要workflow builder. T-code: SWDD 第二节: SAP提供了大量的Workflow的模板可以供大家参考,如果不符合
3、具体的业务流程,可以对该模板做增强。不过就像SAP标准程序一样,不能对其进行修改,当然,你可以把这个模板复制出来然后对其修改,具体就看你的需要了。 查看workflow 模板的方法:T-code FTC_DIS Task type: WS Workflow 助手:Business WorkplaceSBWP 当Workflow执行到某一步需要特定的用户确认或者批准的时候,就会发出work item到该用户的workplace,以使该用户做出相应的操作。 Business Workplace可以和很多外部工具集成,例如lotus note,MS outlook等等,这样使workflow的通知方
4、式更加灵活。 弄清楚Workflow的架构:上面的图非常重要,这基本上描述了我们的开发方向,同时也对你理解SAP自带的Workflow有很大的帮助,看明白到底是为什么而定义,以及如何去执行。 在Workflow中,我们经常会遇到关于Business Object的东西,我想在单独的文章中介绍它的开发以及使用。如果你不知道BO,那么和它紧密相关的BAPI你一定知道,在进一步了解BAPI的原理,你会发现其根本就在BO里面。 第四节 从前面我们的一个简单的例子,对workflow有了一个大概的认识,现在我们来熟悉一下workflow的术语,这部分我基本上从sap help上面copy下来,也不想做什
5、么翻译,只要经常使用wf,这些东西就非常容易理解了。 workflow container The workflow container contains workflow-specific system elements and other container elements to be defined explicitly. Workflow Agent : Person within the system of workflow roles who appears as an end user in productive workflows. The workflow agent st
6、arts workflows and processes work items. Their work area is the Business Workplace. Organizational Plan : Representation of the task-related, functional structure of your enterprise, created using tools from the Organizational Management component. Event: An event is created from any application pro
7、gram and published system-wide. Any number of receivers can react to the event. Work Items : Work items are used in the SAP Business Workflow/WebFlow to execute the individual steps of a workflow. Activity: You define or process an activity in the following cases: If you want to add a new activity t
8、o a workflow definition. If you want to change an existing activity with regard to its agent assignment or its deadline monitoring. If you want to analyze a workflow definition. Web Activity : You use this step type to send an XML document from the workflow to another system. The recipient can proce
9、ss the XML document according to their requirements. This XML document can start a workflow in another system for example. Mail Transmission : You use this step type to send a mail to different recipients. You define the text and subject of the mail when defining the step. You can use variables in t
10、he text, which are filled from the task container at runtime. Form Steps : This step type enables you to display or process the data in a container element of the workflow container. The container element must refer to a structure whose fields are used in the form. A form can be generated automatica
11、lly by the workflow system. You can process the form generated to adapt it to suit your individual requirements. Deep structures are not supported. Forms can also contain other elements, with which, for example, the form content can be approved during execution of the step. User Decisions : In a use
12、r decision, the recipients receive the task description together with the possible decision options during execution. Document from a Template : You use this step type to create documents of various PC applications and process them within the workflow. The work item recipient creates the document ba
13、sed on a document template, which can also contain container elements of the workflow container. Condition: You use a condition in a workflow definition in the following cases: If, at execution time, only one of two possible alternatives can be processed during the workflow, from a business point of
14、 view. If the workflow system can make a decision based on the contents of the workflow container without user interaction. Multiple Condition : You use a multiple condition to define different processing branches for a workflow. Event Creator : You can use an event creator to trigger an event or a
15、local event. Wait Step : A wait step can wait for: An event A condition A local event An event that is initially received by the workflow. Container Operation : You use a container operation to change a container element of the workflow container at runtime. Process Control : You can use a process c
16、ontrol to execute the following functions during the runtime Terminate or cancel other work items in the current workflow Terminate or cancel the current workflow Activate a correlation(Correlating Objects :A correlation enables you to identify objects that belong together, for example, a quotation
17、and the relevant sales order. This involves correlating the objects by using one or more common elements, for example, the quotation number. When you define a Workflow, you can specify the object that the Workflow must wait for, without having to enter the ID of the object.) Raise an exception UNTIL
18、 Loops : You use an UNTIL loop in a workflow definition if: At execution time with one of two possible alternatives, the workflow is to “jump back” to process sections of the workflow definition again. The workflow system can make a decision based on the contents of the workflow container. WHILE Loo
19、ps : You use the WHILE loop in a workflow definition if: At execution time, only one of several possible alternatives can be processed in the workflow from a business point of view, and then the comparison is to be performed again. The workflow system can make a decision based on the contents of the
20、 workflow container. The decision can be formulated based on a comparison between an expression from workflow container and a finite amount of comparison values (constants, expressions). Forks: You use a fork in a workflow definition when the business process can be continued by several users at the
21、 same time. You can also configure the fork in such a manner that not all branches have to be processed. Ad Hoc Anchor : You can save one or more additional workflows with the same interface as the ad hoc anchor. At runtime, an authorized user can replace the ad hoc anchor with one of the added work
22、flows in the graphical workflow log. The workflow being executed is then extended by the steps of the added workflow. If the anchor is not replaced, the ad hoc anchor is ignored when the workflow is executed. Block: You can group together steps in a Workflow in a block. You have the following option
23、s for a block and the steps it contains: Define local data (local container) Define deadline Define exceptions and exception handlers Define dynamic processing (parallel or sequential) Local Workflow : Unlike a sub-Workflow, a local Workflow has full access to the data in the Workflow container. In
24、the local container you can also define additional container elements. A local Workflow is started by means of a local event. You can use a local Workflow, for example, to model reactions to business exception situations. For example, if you model how an order is processed in Workflow, you can use a
25、 local Workflow to model how you want exception handling to function should the order be deleted. This local Workflow can be started by a local event Order Deleted and, for example, trigger a notification to be sent to the administrator. A local Workflow is called asynchronously. This means that the
26、 caller step does not wait for the local Workflow to be completed. An instance of the caller Workflow can start multiple instances of the local Workflow. Task: You use a Task to define an activity that can be executed within a workflow definition or independently (as a single step). This activity ca
27、n be an SAP System transaction.一步一步教你创建第一个workflow:我就是用最老套的关于创建Material所引起的workflow,这样是我们的第一个例子非常简单,同时也能够让我们熟悉一些基本的组件的使用。业务背景:当DB的人员创建了新的物料之后,会触发一个workflow,该workflow会通知IT去检查这个物料。假定这个it人员的用户名是p2,我们只做一个针对该人员的wf。打开workflow builderSWDD最终效果图如下:1 这个workflow从misd11收到workflow开始设计,首先我们需要使用一个user decision,确定m
28、isd11是否要执行这个wf. 选择新建,user decision(点中图标,然后点击右键,在弹出的界面中选择用户决策)2 新建一个task,用于显示物料如果用户选择yes,则显示物料的内容点新建activity,进入创建activity画面,选择新建task新版本的效果图如下:新版本效果图如下:Assign agent好了,这个步骤完成3 新建一个send mail,如果用户选择不执行,则发一个mail到该用户的workplace4 好了,现在我们需要规定一些import的字段选择workflow container,指定import字段新版本效果图如下:5 现在激活wf,执行测试(测试事
29、物代码SWUS)点击input data,输入你要显示的物料号新版本测试如下:点击在关键字在弹出的窗口中输入物料号,然后点绿色钩钩按钮然后在点运行按钮或按F8,会弹出如下界面点击yes I do会弹出如下界面显示物料如果点击 no I didnt的话会收到一封邮件,进入SBWP进入到业务工作台可以看到选择yes, I do选择no, I dont.6 经过测试,看来没有什么问题,那么我们加一个event,当物料创建的时候就会触发这个wf,并且加入限制条件,只有创建物料号码中包含ztest字符串的物料才能触发。.7 现在我们来测试一下,创建一个物料用SBWP进入到工作台看到以下邮件新版本创建事件
30、方法如下:1、assign event receiver to a basic workflow输入SWDD事物码,点击帽子按钮(基本数据),然后点击开始事件,Within here insert the category and type of your business object along with the event. In the example I am going to use event REATED of business object US10010062、setup bindingsNow press the binding buttonOn the followin
31、g screen press the generate automatic binding button3、activate start eventnow press the activate icon ,the third button is for start conditions so you can add further restrictions on when the workflow starts.4、activate workflowNow return to main workflow screen and activate it.shis should be setup and if workflow is running correctly whenever the event you have assigned you workflowtoo is triggered it should in turn execute you workflow5、test workflo
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2