搜诶符合你 发表于 2015-9-17 10:32:10

SAP WORK FLOW

  今天在论坛里看到有讨论WORK FLOW的,自己没有做过,转个例子,以便以后学习使用。
  http://www.abaptech.com/?p=324
  
SAP-Workflow
  313 views


  第一节:   很早之前就想把sap business workflow详细的研究一下,并且能够给出实例供大家参考,可是老是被别的事情所打断。现在手里还有一个待完成的alv demo的程序,也打算做一个alv generator, 可惜家里的服务器坏了,又不打算在46c下面完成,只能搁浅。

  
  现在开始总结workflow,虽然有些过时的技术,但是还是有很多公司在使用,特别是一些比较大的企业,系统升级比较慢。也为自己知道的,做过的事情有一个总结,希望还能有点参考意义。
  1. 从目的上来说,就是让整个业务更加流畅,更加透明,更加方便快捷。
  2. 既然有了workflow,就应该相应的有一个管理系统,以及一个开发环境,这些我们都能够在sap中找到。
  T-code: SWDM
  3. 在使用workflow之前,我们必须明白一件事情,那就是不管什么样的workflow,都会有一整套的业务原型。在定义workflow之前,应该找到相应的已经存在的模型(或许也可以自己开发,没有尝试过)。
  4. 不要误会workflow的功能,其实它是很强大的,虽然我们经常只使用它的一部分功能。包括,email的通知,transaction的集成,不同系统之间的数据交换(ALE/EDI)等等。
  Workflow的定义:
  每个workflow都能在sap中找到业务流程;
  Workflow由很多的步骤组成;
  Workflow可以由事件触发;
  Workflow的创建:
  如果我们已经知道了业务如何执行,那么就可以创建自己的workflow了,于是我们会需要workflow builder.
  T-code: SWDD
  第二节:
  SAP提供了大量的Workflow的模板可以供大家参考,如果不符合具体的业务流程,可以对该模板做增强。不过就像SAP标准程序一样,不能对其进行修改,当然,你可以把这个模板复制出来然后对其修改,具体就看你的需要了。
  查看workflow 模板的方法:T-code :PFTC_DIS
  Task type: WS
  Workflow 助手:Business Workplace--SBWP
  当Workflow执行到某一步需要特定的用户确认或者批准的时候,就会发出work item到该用户的workplace,以使该用户做出相应的操作。
  Business Workplace可以和很多外部工具集成,例如lotus note,MS outlook等等,这样使workflow的通知方式更加灵活。
  弄清楚Workflow的架构:
http://blogimg.chinaunix.net/blog/upfile2/080319155726.png
  上面的图非常重要,这基本上描述了我们的开发方向,同时也对你理解SAP自带的Workflow有很大的帮助,看明白到底是为什么而定义,以及如何去执行。
  在Workflow中,我们经常会遇到关于Business Object的东西,我想在单独的文章中介绍它的开发以及使用。如果你不知道BO,那么和它紧密相关的BAPI你一定知道,在进一步了解BAPI的原理,你会发现其根本就在BO里面。   第三节.rar
  

  第四节
  从前面我们的一个简单的例子,对workflow有了一个大概的认识,现在我们来熟悉一下workflow的术语,这部分我基本上从sap help上面copy下来,也不想做什么翻译,只要经常使用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 starts 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 program 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:http://blogimg.chinaunix.net/blog/upfile2/080324145633.png
  You define or process an activity in the following cases:
   If you want to add a new activity to 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 :http://blogimg.chinaunix.net/blog/upfile2/080324145650.png
  You use this step type to send an XML document from the workflow to another system. The recipient can process the XML document according to their requirements. This XML document can start a workflow in another system for example.
  Mail Transmission :http://blogimg.chinaunix.net/blog/upfile2/080324145701.png
  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 the text, which are filled from the task container at runtime.
  Form Steps :http://blogimg.chinaunix.net/blog/upfile2/080324145714.png
  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 automatically 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 :http://blogimg.chinaunix.net/blog/upfile2/080324145725.png
  In a user decision, the recipients receive the task description together with the possible decision options during execution.
  Document from a Template :http://blogimg.chinaunix.net/blog/upfile2/080324145734.png
  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 based on a document template, which can also contain container elements of the workflow container.
  Condition:http://blogimg.chinaunix.net/blog/upfile2/080324145744.png
  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 view.
   If the workflow system can make a decision based on the contents of the workflow container without user interaction.
  Multiple Condition :http://blogimg.chinaunix.net/blog/upfile2/080324145753.png
  You use a multiple condition to define different processing branches for a workflow.
  Event Creator :http://blogimg.chinaunix.net/blog/upfile2/080324145802.png
  You can use an event creator to trigger an event or a local event.
  Wait Step :http://blogimg.chinaunix.net/blog/upfile2/080324145811.png
  A wait step can wait for:
   An event
   A condition
   A local event
   An event that is initially received by the workflow.
  Container Operation :http://blogimg.chinaunix.net/blog/upfile2/080324145822.png
  You use a container operation to change a container element of the workflow container at runtime.
  Process Control :http://blogimg.chinaunix.net/blog/upfile2/080324145831.png
  You can use a process control 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 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 Loops :http://blogimg.chinaunix.net/blog/upfile2/080324145840.png
  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 Loops :http://blogimg.chinaunix.net/blog/upfile2/080324145847.png
  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 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:http://blogimg.chinaunix.net/blog/upfile2/080324145857.png
  You use a fork in a workflow definition when the business process can be continued by several users at the same time. You can also configure the fork in such a manner that not all branches have to be processed.
  Ad Hoc Anchor :http://blogimg.chinaunix.net/blog/upfile2/080324145906.png
  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 workflows 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:http://blogimg.chinaunix.net/blog/upfile2/080324145916.png
  You can group together steps in a Workflow in a block. You have the following options 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 :http://blogimg.chinaunix.net/blog/upfile2/080324145923.png
  Unlike a sub-Workflow, a local Workflow has full access to the data in the Workflow container. In 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 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 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 can be an SAP System transaction.
Related Posts

[*]No Related Post
  If you enjoyed this post, make sure you subscribe to my RSS feed!
  
  

  

  
页: [1]
查看完整版本: SAP WORK FLOW