Workflow---Advanced-Programming-with-ABAP-OO.pdf



Comments



Description

BIT611SAP Business Workflow Advanced Programming with ABAP OO SAP NetWeaver Date Training Center Instructors Education Website Participant Handbook Course Version: 62 Course Duration: 1 Day Material Number: 50087408 An SAP course - use it to learn, reference it for work Copyright Copyright © 2008 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Trademarks • Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registered trademarks of Microsoft Corporation. • IBM®, DB2®, OS/2®, DB2/6000®, Parallel Sysplex®, MVS/ESA®, RS/6000®, AIX®, S/390®, AS/400®, OS/390®, and OS/400® are registered trademarks of IBM Corporation. • ORACLE® is a registered trademark of ORACLE Corporation. • INFORMIX®-OnLine for SAP and INFORMIX® Dynamic ServerTM are registered trademarks of Informix Software Incorporated. • UNIX®, X/Open®, OSF/1®, and Motif® are registered trademarks of the Open Group. • Citrix®, the Citrix logo, ICA®, Program Neighborhood®, MetaFrame®, WinFrame®, VideoFrame®, MultiWin® and other Citrix product names referenced herein are trademarks of Citrix Systems, Inc. • HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. • JAVA® is a registered trademark of Sun Microsystems, Inc. • JAVASCRIPT® is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. • SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other products mentioned are trademarks or registered trademarks of their respective companies. Disclaimer THESE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR APPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THESE MATERIALS AND THE SERVICE, INFORMATION, TEXT, GRAPHICS, LINKS, OR ANY OTHER MATERIALS AND PRODUCTS CONTAINED HEREIN. IN NO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES OF ANY KIND WHATSOEVER, INCLUDING WITHOUT LIMITATION LOST REVENUES OR LOST PROFITS, WHICH MAY RESULT FROM THE USE OF THESE MATERIALS OR INCLUDED SOFTWARE COMPONENTS. g2008022104036 About This Handbook This handbook is intended to complement the instructor-led presentation of this course, and serve as a source of reference. It is not suitable for self-study. Typographic Conventions American English is the standard used in this handbook. The following typographic conventions are also used. Type Style Description Example text Words or characters that appear on the screen. These include field names, screen titles, pushbuttons as well as menu names, paths, and options. Also used for cross-references to other documentation both internal (in this documentation) and external (in other locations, such as SAPNet). 2008 Example text Emphasized words or phrases in body text, titles of graphics, and tables EXAMPLE TEXT Names of elements in the system. These include report names, program names, transaction codes, table names, and individual key words of a programming language, when surrounded by body text, for example SELECT and INCLUDE. Example text Screen output. This includes file and directory names and their paths, messages, names of variables and parameters, and passages of the source text of a program. Example text Exact user entry. These are words and characters that you enter in the system exactly as they appear in the documentation. <Example text> Variable user entry. Pointed brackets indicate that you replace these words and characters with appropriate entries. © 2008 SAP AG. All rights reserved. iii tips. All rights reserved. or background Note or further explanation of previous point Exception or caution Procedures Indicates that the item is displayed in the instructor's presentation.About This Handbook BIT611 Icons in Body Text The following icons are used in this handbook. iv © 2008 SAP AG. Icon Meaning For more information. 2008 . ....................................... 110 2008 © 2008 SAP AG.................. v ................................................... 91 Exceptions....Attributes and Methods ........................ 92 Using Classes in Workflow Architecture ............................................. 1 From BOR Objects to ABAP Classes ................................8 Unit 2: ABAP Classes Definition and Implementation ........ 53 Unit 3: Use Classes in Workflow Architecture ..............2 Technical View and Business Example .....Contents Course Overview ............................ Events and API Functions ..... 17 Class Definition .............................................................................Instance Handling and Key Fields ..................... vii Course Goals ................ All rights reserved............vii Unit 1: Introduction....................................... 15 Underlying Concepts of ABAP Object Classes in SAP Business Workflow........ 29 Class Definition .......vii Course Objectives ...................... 2008 . All rights reserved.Contents vi BIT611 © 2008 SAP AG. You will learn how to program workflow interfaces at the ABAP class level. This includes attributes. you will be able to: • • 2008 Identify all points in the workflow system at which programming is possible or necessary Create your own classes and use them in the workflow architecture © 2008 SAP AG.Course Overview This course covers customer adaptations and enhancements to workflows that require programming. vii . methods and events. The course also provides information on developing functional methods with the new “Container Parameter Interface” . including check function modules. Target Audience This course is intended for the following audiences: • • Workflow developers (with ABAP and ABAP OO knowledge) Workflow consultants (with ABAP and ABAP OO knowledge) Course Prerequisites Required Knowledge • • • • SAPTec BIT601 BIT610 BC400 and BC401 or equivalent knowledge Recommended Knowledge • • BIT600 DBITWF Course Goals This course will prepare you to: • • Perform workflow programming at all levels Use ABAP classes in SAP Business Workflow Course Objectives After completing this course. All rights reserved. and so on. and so on) SAP Software Component Information The information in this course pertains to the following SAP Software Components and releases: • viii SAP Web Application Server 6. 2008 .Course Overview BIT611 • Use “Container Parameter Interface” as the new application programming interface (API) for workflow related functions (check. receiver type.20 © 2008 SAP AG. All rights reserved. ...2 Lesson: Technical View and Business Example ..... Unit Objectives After completing this unit....... All rights reserved........... you will be able to: • • • • • • Repeat the main points of SAP Business Workflow architecture.......8 2008 © 2008 SAP AG. Compare and contrast ABAP classes and business object types used in workflow development... This unit also introduces the example that will be used in the course exercises...... It explains the definition architecture and the places within it that can be programmed.......Unit 1 Introduction Unit Overview This unit covers a brief overview of the uses and tasks of a workflow management system......... 1 ...... Recognize the components of SAP Business Workflow that enable or require programming by the user. Identify the main technical aspects of ABAP Classes and BOR Analyze the Business Process Compare the business object components (available) with the ABAP class components needed Unit Contents Lesson: From BOR Objects to ABAP Classes........ you have to discuss.Unit 1: Introduction BIT611 Lesson: From BOR Objects to ABAP Classes Lesson Overview This lesson repeats the underlying architecture and terminology of the workflow engine. Business Example Your company have implemented some new business functions as Add On to the SAP ERP system. 2008 . the existing business functions should used in workflow architecture to model the important business processes in this Add On. Lesson Objectives After completing this lesson. 2 © 2008 SAP AG. you will be able to: • • • Repeat the main points of SAP Business Workflow architecture. These functions are developed with ABAP Objects and your developers have many experience in this part of programming technique. It also compares and contrasts ABAP Classes and SAP Business Objects used in workflow development. All rights reserved. To gain advantage of these resources. Compare and contrast ABAP classes and business object types used in workflow development. It enables the control of connected activities across transactions and across different applications. Workflow Management Structure There are some important declarations. Recognize the components of SAP Business Workflow that enable or require programming by the user. to describe a workflow management system: • A system that delivers work: – – – – In the correct sequence With all the necessary information At the correct time To the responsible people Workflow Management is used to link work steps automatically. 3 . There has to be a variety of services to control the workflow runtime.. rule definition • Application encapsulation Which objects are required? Business Object Builder. work item manager • Evaluation of processing Who did what and when? Reporting and analysis Through end user support. Class Builder Through the process definition. a workflow management system ensures that “work is delivered in the correct sequence at the correct time”. ”. All rights reserved. a workflow management system ensures that “work is delivered with all the necessary information”. Tools like the following allow to gain access of the advantages of a workflow management system: • Support for end users What have I got to do today? Business Workplace • Process control What happens when? Workflow manager.. the a workflow management system ensures that “work is delivered in the correct sequence. 2008 © 2008 SAP AG. Through process control.. and in which order? Workflow builder. there has to be a variety of services to develop the necessary functions at design time: • Processdefinition What happens.”. a workflow management system ensures that “work is delivered to the people responsible at the correct time”.BIT611 Lesson: From BOR Objects to ABAP Classes To work with structured processes in a workflow management system. Through application encapsulation. task definition • Organizational modeling Who does what? Organization model.. a workflow management system ensures that “work is delivered to the people responsible. Through organization modeling. 0c was SAP’s first real concerted effort at providing Business Process Management with the introduction of SAP Business Workflow. however it was already clear that object oriented techniques were the way of the future and critical to the underpinnings of SAP Business Workflow. History of Business Process Management Business Process Management services were first introduced with release 2.Unit 1: Introduction BIT611 Figure 1: SAP Business Workflow: Definition Architecture In the graphic. Tasks use workflow definitions (in multistep tasks) or methods (in single step tasks). 4 © 2008 SAP AG. object-oriented programming was more an idea than a reality in ABAP. A→ B means that A uses B For example: A step definition uses attributes (container operation). At that time. but 3. events (wait steps). methods (submethods).0. 2008 . All rights reserved. association. All rights reserved. and by the time ABAP OO was fully available and capable of replacing the BOR. and polymorphism . SAP Business Workflow was delivered with an approximation of object-oriented programming called the Business Objects Repository (BOR). delegation. Major strengths of the BOR was in how well it provided object oriented capabilities .BIT611 Lesson: From BOR Objects to ABAP Classes Figure 2: History of Business Objects and ABAP Classes As a result. 5 .to such an extent that it wasn’t until R/3 release 4. a large body of business content had already been provided by the BOR.20 that ABAP OO was able to be integrated with SAP Business Workflow to the same degree as the BOR. The aim of the BOR was clearly to provide object oriented (style) techniques and services in systems that were not yet capable of object oriented programming.6C that similar depth of object oriented capabilities was available in ABAP OO and not until SAP Web Application Server 6.such as inheritance. Why use Classes? • • • • • • • It’s the way forward! Standard SAP applications starting to use classes Modern editor & improved coding standards Clever bindings using functional methods Usage not limited to workflow Maintainable by developers without workflow knowledge Adding additional components to classes is really easy! The need for workflow services outstripped the introduction of ABAP OO. 2008 © 2008 SAP AG. All rights reserved. Currently the effort required to convert the existing body of BOR content to ABAP OO. 2008 .Unit 1: Introduction BIT611 Why not use Classes?! • • • • More up front “Do It Yourself” when creating a class Knowledge of OO syntax essential (but not hard to pick up!) 1000+ BOR Object Types exist and can still be used Older versions of SAP do not support OO Classes It is no longer a simple matter of replacing code fragments in macros . 6 © 2008 SAP AG.a major effort would be needed to convert existing workflow content from the BOR to ABAP OO. exceeds the ROI of such an activity. and the disruption to customers that would be caused by such a major change in direction. BIT611 Lesson: From BOR Objects to ABAP Classes Lesson Summary You should now be able to: • Repeat the main points of SAP Business Workflow architecture. 2008 © 2008 SAP AG. 7 . All rights reserved. • Compare and contrast ABAP classes and business object types used in workflow development. • Recognize the components of SAP Business Workflow that enable or require programming by the user. and conduct the detailed project analysis. To create class functions. We will also compare the business object components (available) with the ABAP class components needed. Expressions. 2008 . you have to use a generic (cross component) tool called the Class Builder. Lesson Objectives After completing this lesson. Methods and Events The main developing area to create workflow functions still is the Business Object Repository (see explanations in the previous lesson). First Technical View There are some important changes in the workflow architecture to make the use of classes possible: • SAP Business Workflow now supports two object repositories: • – SWO1 (Business Object Repository) – SE24 (Class Builder) Persistent object keys now have three components: • – Object category (CATID) – Object type (TYPEID) – Object key (INSTID) Both repositories are equally well supported: • – But: There is no delegation feature for ABAP Objects SE24 support covers the same aspects as BOR support: – Container. 8 © 2008 SAP AG. you will be able to: • • • Identify the main technical aspects of ABAP Classes and BOR Analyze the Business Process Compare the business object components (available) with the ABAP class components needed Business Example Motor Sports International has decided to implement SAP Business Workflow as its business solution for the “Material Master Change” business process.Unit 1: Introduction BIT611 Lesson: Technical View and Business Example Lesson Overview This lesson will identify the main technical aspects of the two necessary developing areas. All rights reserved. Only persistent objects can survive the frequent context changes the workflow system encounters. the type (BOR object type or ABAP class name) and the key. In workflow classes. 9 . At runtime. One important aspect of workflow enabling a class is persistence management. In general. the methods invoked by the workflow engine. the workflow engine executes the processes. Figure 3: Business Object / ABAP Classes Comparison Steps in process definitions contain. it is the main aspect of programming to implement such a management. determines the relevant steps and invokes the methods of each step. With Web AS 6.40. The problem at MSI is the delayed notification when a material changes. object methods that will be invoked at runtime to execute application logic. are based on business object types. One important change in handling business objects is that the broadened persistent object key now includes the category (BOR or ABAP Objects). in most cases. it is also possible to use methods of ABAP Classes. For business objects. Business Process Review Motor Sports International Business Process is a scenario that involves Material Master change. so you have to develop workflow functions in the borders of the object oriented approach it represents. All rights reserved.BIT611 Lesson: Technical View and Business Example The class builder is not workflow specific. 2008 © 2008 SAP AG. the Business Object Manager handles the variety of context changes as a “Black Box”. the OldMaterialChanged event is triggered. © 2008 SAP AG. The result of the change triggers a workflow event (for example. Main Business Scenario I • The problem at MSI: The existing system at MSI could not notify the designer of relevant changes to material master records.Business Process Review The production line is not notified about the changes in time and continues producing what is eventually obsolete inventory. This communication gap led to a delay in adjusting the production line. As soon as you change the field from the value * to your group number ##. • 10 *Note: Tests at MSI have shown that this field is not used. • Triggering: This business process always starts when a user changes the Old Material field in a material master record. They have decided that SAP Business Workflow is their solution.Unit 1: Introduction BIT611 Figure 4: Motor Sports International . which then initiates one of two workflow processes. OldMaterialChanged). which in turn resulted in large quantities of obsolete and unwanted warehouse stock. 2008 . Changes to its value are used to inform the designer of a relevant change to the material master. All rights reserved. The triggering event is actually initiated by a link to the change documents. The triggering event determined is OldMaterialChanged. It is important to differentiate between synchronous and asynchronous edit (both do not exist). and it is linked to Change Documents (transaction SWEC). The agent responsible is based on the Laboratory field. This event is therefore a terminating event of an asynchronous task. 11 . An Asynchronous edit method and task is needed to allow changes and/or updates that are terminated by raising a terminating event. If the designer does not complete all activities within a specified time interval (for example. To inform the workflow system that this work has been completed.BIT611 Lesson: Technical View and Business Example The Main Business Scenario is based on a Material Master change. five minutes). 2008 © 2008 SAP AG. All rights reserved. The company has also decided that Basic Material is also available to be used for a terminating event. • *Note: Tests carried out during the project indicate that no one else uses the Basic Material field. stating that the process is completed and that the material just changed can now return to production. The workflow determines who receives this notification (in practice. The responsible agent for the first step is based on the Laboratory field (MARA-LABOR). The ABAP Object class has to be implemented like the object type for Material Master: “BUS1001006” . this would be implemented using rule resolution). the designer changes the Basic Material field of the relevant material master. the designer adjusts the production process to correspond to the change. After notification. a particular designer must be informed. A change to the value represents a status change. the designer’s manager must be informed of this delay. The process involves notifying the designer when a material is changed. it sends a notification of completion. Main Business Scenario II • Core process: As soon as a material is changed. As soon as the workflow system is notified that the designer has completed his or her work. However. 2008 . All rights reserved. 12 © 2008 SAP AG. all necessary functions will be shown.Unit 1: Introduction BIT611 Necessary components of class (compare ZRGMARA) • Attributes • – ChangedBy – IndustryName – PLANT – QMessages Methods • – Change (asynchronous) – DisplayView (parameter MaterialView) – CreateMaterialFormReference (parameter ReferenceMaterialNumber) Events – – – BasicMaterialChanged OldMaterialChanged DeadlineTest (with parameter “LatestEndDate”) Not all components called above are implemented in the following exercises due to time constraints. BIT611 Lesson: Technical View and Business Example Lesson Summary You should now be able to: • Identify the main technical aspects of ABAP Classes and BOR • Analyze the Business Process • Compare the business object components (available) with the ABAP class components needed 2008 © 2008 SAP AG. 13 . All rights reserved. • Compare and contrast ABAP classes and business object types used in workflow development.Unit Summary BIT611 Unit Summary You should now be able to: • Repeat the main points of SAP Business Workflow architecture. • Recognize the components of SAP Business Workflow that enable or require programming by the user. • Identify the main technical aspects of ABAP Classes and BOR • Analyze the Business Process • Compare the business object components (available) with the ABAP class components needed 14 © 2008 SAP AG. All rights reserved. 2008 . ......... and how parameters are called and returned in method processing... The final part of the unit covers access to attributes and calling methods inside and outside the BOR...... 15 .. 29 Exercise 1: Create a Class with Instance Handling... you will be able to: • • • • • • • • • Explain the basic technical concepts of ABAP Object classes in SAP Business Workflow Classify some important concepts of object-oriented programming Create a class Create instance handling required for workflow engine Define key fields Define attributes with a database reference Define “virtual attributes”....... You will learn how attributes and methods are defined and implemented...... You will also learn how to implement exceptions in methods..Unit 2 ABAP Classes Definition and Implementation Unit Overview This unit provides a short description of the underlying concepts of ABAP Classes for SAP Business Workflow and explains the definition of a class and its components in detail...... and performance recommendations for implementing an object type............... like values Define multiline attributes Describe how object references are addressed in the BOR and the workflow Unit Contents Lesson: Underlying Concepts of ABAP Object Classes in SAP Business Workflow ........................Instance Handling and Key Fields .... All rights reserved....... Unit Objectives After completing this unit...................... 17 Lesson: Class Definition . 41 2008 © 2008 SAP AG... ..................... All rights reserved....... 65 Exercise 3: Create Methods for Workflow Class ......Attributes and Methods ...... 2008 ... 53 Exercise 2: Create Attributes for Workflow Class .. 79 16 © 2008 SAP AG.....................Unit 2: ABAP Classes Definition and Implementation BIT611 Lesson: Class Definition ........... 2008 © 2008 SAP AG. the methods invoked by the workflow engine are based on object types (BOR). where standard object types are not sufficient for your requirements. reports and function modules) by the workflow engine.BIT611 Lesson: Underlying Concepts of ABAP Object Classes in SAP Business Workflow Lesson: Underlying Concepts of ABAP Object Classes in SAP Business Workflow Lesson Overview In general. All rights reserved. 17 . The workflow engine is also able to invoke methods of ABAP classes. Because the workflow engine has to handle all objects in a uniform way. Lesson Objectives After completing this lesson. this means. the class has to react in the exact way like its business object type pendant. The developers in your company are familiar in programming ABAP Objects and most of the add-on functions are based on this language. Classes in SAP Business Workflow Classes have to encapsulate the application data (tables) and actions that can be performed on this data (such as transactions. you will be able to: • • Explain the basic technical concepts of ABAP Object classes in SAP Business Workflow Classify some important concepts of object-oriented programming Business Example You have introduced workflow techniques in your company and now need to insert functions from your customer-based add-ons. This lesson describes the underlying technical concepts of ABAP Object classes for SAP Business Workflow. This encapsulation has the following advantages: • • • 18 Simple modeling of processes Stable processes with a high degree of reusability On a technical level: A standard calling interface for the workflow runtime system © 2008 SAP AG. transactions. by using standard interface components like attributes. reports and so on.Purpose A class instance defines a stable. methods and events. 2008 . The class handles the functional changes internally by implementing appropriate changes for all of its users.Unit 2: ABAP Classes Definition and Implementation BIT611 Figure 5: Objects / Classes . All rights reserved. extendable “business” view. Users of the instance are not affected by changes to the underlying database tables. parallel processing forks. programmed binding. All rights reserved. The user is then notified of the release by an event.”. deadlines Events – – Start workflows. wait for event Use of methods in steps (methods can change object data) • • The “main method” of an activity is encapsulated in a task so that it can be reused. Use of attributes (access to object attributes in the workflow is always read-only) • • Values are used for process control or transferred as parameters on the method. Before. Use of events: • • 2008 Events are created for communicating between the application and the workflow system or for communicating different workflows. agent assignment. loops. “Wait until a particular document is released. end steps Create event. • Methods • – In tasks: Define the “core” of an activity – In steps: Before methods.BIT611 Lesson: Underlying Concepts of ABAP Object Classes in SAP Business Workflow Since the engine stores information about the process' state. after methods and secondary methods Attributes – • Conditions: Branches. The Wait for Event prompt (for example. it must be able to convert references to instances of ABAP classes to a representation that can be saved (and vice versa: it must be possible to create an instance of an ABAP class from a previously stored persistent representation). after and secondary methods define subordinate or parallel activities and are directly specified at a particular step. steps and related objects in database tables. 19 . For example. “Wait until a specific document is released?”) is used for synchronizing processes or parts of a process. conditions before and after steps – Container operation. binding. © 2008 SAP AG. receiver type function modules). You can query attributes in your own modules in programming exits (check type function modules. however. 20 © 2008 SAP AG. interfaces are simply superclasses that cannot be instantiated.Definition in Class Builder The Class Builder (SE24) is a client-independent directory of all defined ABAP Object classes. Two types of Attribute can be can be created: • • Database attribute (attribute value is contained in the specified database table) Virtual attribute (source text is run to determine the value) Methods are implemented using transactions. Events are triggered and received using other tools. and only have public components. Depending on the implementation. there are hardly any differences. reports and so on. From a technical point of view. is also indirectly assigned to an application component. Each object instance is clearly displayed in a row in the table specified. methods are classified according to their processing model (synchronous/asynchronous) or interaction model (dialog/background). BAPIs. do not have an implementation part. Key fields provide a unique reference between an object type and a database table (or a view). Each class is assigned to a development class and therefore. Interfaces Interfaces differ from regular inheritance in their area of use. 2008 . Events are only declared in the class (both their names and parameters are declared).Unit 2: ABAP Classes Definition and Implementation BIT611 Figure 6: Class . In terms of programming. All rights reserved. BIT611 Lesson: Underlying Concepts of ABAP Object Classes in SAP Business Workflow In ABAP Objects, interfaces primarily serve to define uniform interfaces (protocols) for services. Various classes can thus offer (implement) these services in different ways, but keep the same semantics. Interfaces therefore contain no implementations. To recognize the semantic differences from regular inheritance, you can concentrate on the following, typical use cases: Figure 7: Central Definition of Shared Components For example, you want to allow for the option of having multiple classes implementing a service in different ways, but using the same method names and with a uniform signature. With regular inheritance, you would define such a method in the shared superclass. However, if you cannot model a superclass suitably for inheritance, you need to define an interface and then define this method there. Therefore, you can compare this case with a generalization relationship with a superclass. Development Support for Creating a class To be able to use an object of an ABAP class with the workflow engine, the class has to implement the interface “IF_WORKFLOW”. This interface provides a total of six different methods which cover the requirements from workflow architecture (see below). 2008 © 2008 SAP AG. All rights reserved. 21 Unit 2: ABAP Classes Definition and Implementation BIT611 Figure 8: Interface – IF_WORKFLOW Be aware that classes implementing IF_WORKFLOW can be used in any workflow by any workflow modeler. This means that a class, implementing this interface, has automatically status “released” (compare with behavior of BOR objects!). As a first conclusion, such a class should only be changed in a compatible way that does not invalidate existing users (never delete attributes, change methods in an upward compatible way). There is no “where used list” that shows in which workflow a class is used: you should always assume that there are unknown users of your class in some subsequent systems or at the customer’s site. The second conclusion is that “your” (internal) classes should not implement interface IF_WORKFLOW. To protect internal classes, it is better to use wrapper classes that implement IF_WORKFLOW. These wrapper classes would be constructed especially for use within workflow and could provide a process-specific subset of methods and attributes of your internal class. 22 © 2008 SAP AG. All rights reserved. 2008 BIT611 Lesson: Underlying Concepts of ABAP Object Classes in SAP Business Workflow Figure 9: Interface – BI_PERSISTENT One important aspect of workflow-enable a class is persistence management. As mentioned before, only persistent objects can survive the frequent context changes the workflow system encounters. If you want to convert a persistent saved display of an object into an instance of the corresponding ABAP class, the workflow engine calls the FIND_BY_LPOR method. The LPOR method is the counterpart to the FIND_BY_LPOR method. It provides the persistent display for an existing instance of an ABAP object. The workflow engine calls the REFRESH method when the system has to ensure that all values of an object are valid or that they correspond exactly with the persistent display of the object. 2008 © 2008 SAP AG. All rights reserved. 23 workflow inbox) by displaying their default attribute also allow to navigate to an object by clicking on that default value. All rights reserved. Since the generic tools cannot know how to navigate to a given object (which may be of some user-defined class). a descriptive text) to represent an object instance. 2008 . If these tools should use a value different from the object key (for example. 24 © 2008 SAP AG. the system calls a generic method that implements this navigation. an application can signal that it no longer needs the given object. and so on) display objects that are attached to processes or process steps. By calling the RELEASE method. the object key will be used as the display attribute. The tools that represent objects in a textual way (for example. workflow log. The method DEFAULT_ATTRIBUTE_VALUE is used to get this value from an object. the object key is used to represent the object. If this method doesn't return any value. The instance could therefore be removed from the instance management as soon as the last reference to this object is released. This method is EXECUTE_DEFAULT_METHOD. then the object itself has to provide the value.Unit 2: ABAP Classes Definition and Implementation BIT611 Figure 10: Interface – BI_OBJECT Different Workflow tools (inbox. This enables the garbage collector to free the related memory. In general. objects can also trigger events. Use customer-specific object extensions 2008 © 2008 SAP AG. how they will react. polymorphism is when instances of different classes respond differently to the same messages. Event control Instead of sending messages directly to specific objects. so that one class (the subclass) adopts the structure and behavior of another class (superclass). Polymorphism • In object-orientation. 25 . All rights reserved. possibly also adapting or extending it. and if so.BIT611 Lesson: Underlying Concepts of ABAP Object Classes in SAP Business Workflow Additional Concepts of the Object-Oriented Programming Model Figure 11: Additional Concepts of the Object-Oriented Programming Model • Inheritance • Inheritance defines the implementation relationships between classes. Events can be triggered if it is not yet known at the time of development if objects will react. An enhancement point is a possibility to add (without modification) source code. variable. some new enhancement options have been added: Enhancement Points and Enhancement Sections. function modules and classes. The only way. it was not possible to extend classes like business object types. is to use explicit enhancement possibilities (User-Exits. so an only once instantiated class construct is not fitting. that means. The most interesting fact is that customer enhancements with such “implicit” enhancement points (in contrast to the old fashioned way) do not need to be prepared by SAP. 26 © 2008 SAP AG. BAdIs. Explicit enhancement points are SAP prepared extension possibilities in application programming. 2008 . All rights reserved. The class is defined with the additions FINAL and CREATE PRIVATE and is instantiated using its static constructor.and parameter.0. You can do this using the singleton concept. The singleton concept is not a commencement to develop workflow related functions.0. You need to use classes in workflow architecture with multiple instances. without SAP preparation: • • • • • at the beginning and end of methods of local/global classes at the end of the importing/exporting/changing declaration area of methods of local classes at interface definitions of methods of global classes at the end of public/protected/private section of local classes (to define additional attributes and methods) you can add additional attributes and methods to global classes Hint: Classes Without Multiple Instantiation (Singleton Pattern): There are many cases (but not the workflow one) in which you need to prevent a class from being instantiated more than once for each program context. and so on) delivered in the standard programming. With SAP NetWeaver 7.Unit 2: ABAP Classes Definition and Implementation BIT611 Caution: Before SAP NetWeaver 7. to implement customer specific object extensions in SAP classes.declarations in SAP-programs. There is no technique like delegation in ABAP classes for SAP Business Workflow. while implicit enhancement points exits standardized at definite places in SAP programming syntax. All rights reserved. On request. They are transient (temporary) and disappear when the program ends.BIT611 Lesson: Underlying Concepts of ABAP Object Classes in SAP Business Workflow Hint: Persistent Objects with ABAP Objects In principle.10. For this purpose. the Persistence Services for ABAP Objects were introduced in the SAP Web AS 6. these services write the current attribute values of objects defined as persistent to the associated transparent tables. 2008 © 2008 SAP AG. they import these values from the tables again. and write the attributes to an object previously defined as persistent. ABAP programs work with data and objects that are valid at runtime. On receiving another request. If this data is to be stored permanently and independently of the program (persistently) it must be stored in a database. 27 . 2008 . All rights reserved.Unit 2: ABAP Classes Definition and Implementation BIT611 Lesson Summary You should now be able to: • Explain the basic technical concepts of ABAP Object classes in SAP Business Workflow • Classify some important concepts of object-oriented programming 28 © 2008 SAP AG. The workflow engine itself does not provide an instance manager that detects if an object has already been instantiated in the current context (for BOR objects. is its instance handling.Instance Handling and Key Fields Lesson Overview This lesson explains how to create a class. you will be able to: • • • Create a class Create instance handling required for workflow engine Define key fields Business Example You have introduced workflow techniques in your company and now need to insert functions from your customer-based add-ons. like in object types (database fields. Instance handling in classes for SAP Business Workflow The persistent representation of an object can appear in different processes or at different places within one process. There is no difference in attribute properties. used in workflow. object references).BIT611 Lesson: Class Definition . because their values are set by the methods of the class. Lesson Objectives After completing this lesson. Attributes of classes can refer to all kinds of data types. All rights reserved. where standard object types are not sufficient for your requirements. An essential function of a class.Instance Handling and Key Fields Lesson: Class Definition . create the class and define the key fields and the required attributes. this is a feature of the corresponding object manager). and define its key fields and attributes. 29 . 2008 © 2008 SAP AG.database references. virtual attributes . First. This lesson describes the form in which the classes must be available to workflow runtime. Unit 2: ABAP Classes Definition and Implementation BIT611 Figure 12: Persistent vs. Interface BI_PERSISTENT The following example demonstrates. since operations like an existence-check. creating instances from persistent representations are often performance critical. This example uses a private attribute that keeps all created instances and their persistent representation: 30 © 2008 SAP AG. and so on may require elaborate actions. All rights reserved. Runtime Having two instances of the same object may lead to unexpected behavior. how an instance management could be realized. initialization. 2008 . for example: • • • • in particular if the object data is changed within that context mutual locking one instance overwrites data the other has just written inconsistent data display of the “older” instance Furthermore. However.10. the concept of persistent ABAP classes is not flexible enough to handle workflow instances. Objects and their attributes can be written to the database and re-imported. ABAP classes have also the possibility to handle its instances automatically. the “persistence service” was introduced with SAP R/3 Basis Release 6. Hint: To be able to work with ABAP Objects persistently. so you usually handle the persistence of these objects in the class itself (as described in the following sections): Figure 14: Object References handled in Classes 2008 © 2008 SAP AG.BIT611 Lesson: Class Definition . The workflow engine use the Business Object Manager for these purposes. All rights reserved.Instance Handling and Key Fields Figure 13: Instance Handling Instance management is automatic for business objects. 31 . • INSTID The key of the object. This structure consists of three components: • CATID Contains an indicator (a ‘category ID’) describing what kind of object is represented.method parameter LPOR is the persistent object reference *. the system must be able to distinguish between these two object categories. 2008 . METHOD bi_persistent~find_by_lpor. All rights reserved.LPOR = Local Persistent Object Reference 32 © 2008 SAP AG. a structure of type SIBFLPOR (POR = Persistent Object Reference).Unit 2: ABAP Classes Definition and Implementation BIT611 The only input parameter of the following persistence handling method is a persistent object reference. *. • TYPEID Contains the name of the object type (for example. This field is restricted to 32 characters Figure 15: Implementation – FIND_BY_LPOR It could therefore be useful to manage already instantiated objects within the class. Changes on this instance. It contains “BO” for BOR object and “CL” for an ABAP class. the ABAP class) that should be instantiated. which are done by a client are immediately visible to all other clients. to make sure that different calls of FIND_BY_LPOR will all return a pointer to the same instance. Since the Workflow Engine handles BOR Objects and ABAP Classes. . CATCH cx_bo_error . * load l_matnr and l_standardmaterial in ls_instance and append the structure * to table mst_instances ls_instance-number = l_matnr. 2008 © 2008 SAP AG. * instid is the key of the object l_matnr = lpor-instid.BIT611 Lesson: Class Definition . All rights reserved.. " key field DATA: ls_instance TYPE t_instance. APPEND ls_instance TO mst_instances. EXIT. * endif of no result is found ENDIF. " instance handling * end of local data * Check if LPOR is filled CHECK lpor-instid IS NOT INITIAL. 33 . " reference to class instance DATA: l_matnr TYPE mara-matnr. ENDTRY.Instance Handling and Key Fields * begin of local data DATA: l_standardmaterial TYPE REF TO zbit611_.. * read mst_instances into ls_instance to test. if instance already exists READ TABLE mst_instances WITH KEY number = l_matnr INTO ls_instance. * if no result is found IF sy-subrc NE 0. ENDMETHOD. ls_instance-instance = l_standardmaterial. * create object l_standardmaterial with key l_matnr and catch exception * if exception is raised. CREATE OBJECT l_standardmaterial EXPORTING im_matnr = l_matnr . * load ls_instance-instance into result result = ls_instance-instance. exit the method TRY. ELSE. If an instance manager is used. as in the FIND_BY_LPOR example above. 2008 . DATA: ls_instance TYPE t_instance. There is a close relationship between these two methods: by first calling FIND_BY_LPOR for a persistent reference to get an instance.Unit 2: ABAP Classes Definition and Implementation BIT611 The method coding uses the class name and object key passed in the LPOR parameter to create an ABAP object instance.. coding of the following type could be used: METHOD bi_persistent~lpor. IF sy-subrc = 0. the instance data could be loaded right away or could be loaded later (on demand). * instance not found. All rights reserved. create the persitent representation * an other way 34 © 2008 SAP AG.. Depending on the persistence model chosen for this ABAP class. Method LPOR is the counterpart of FIND_BY_LPOR: Figure 16: Implementation – LPOR FIND_BY_LPOR receives a persistent representation of an object reference and returns a “live” ABAP instance. and then calling LPOR on this instance. you should get back to the persistent reference that you started out with. LPOR is called on the live instance and returns the persistent object reference for that instance. READ TABLE mst_instances WITH KEY object = me INTO ls_instance. * return the persistent representation result = ls_instance-lpor. REFRESH Depending on how the class organizes its own delta handling. in sync with the persistent image..Instance Handling and Key Fields . the implementation of the method may remain empty. If required. whenever the system has to make sure that the internal values of the object are valid . me->materialgroup = me->m_mara-matkl. There are also several ways of implementing this method in this case.. . ENDIF. * get public attributes. (DDIC) * load table mara SELECT SINGLE * FROM mara INTO m_mara WHERE matnr = me->matnr. that is. The method is called by the workflow engine. There is an implementation example in the CL_SWF_FORMABSENC demo class. me->materialtype = me->m_mara-mtart.. 2008 © 2008 SAP AG. 35 . * call table makt and m_makt SELECT SINGLE * FROM makt INTO m_makt WHERE matnr = me->matnr AND spras = sy-langu.. reload the object instance data from database in this method: METHOD read_attributes. All rights reserved. Figure 17: Implementation .BIT611 Lesson: Class Definition . ENDMETHOD... just enter the METHOD . ENDMETHOD... ENDMETHOD statements (without implementation in between) as coding. The example assumes that the class has an instance attribute DESCRIPTION that is to be used to identify the object. the interface method DEFAULT_ATTRIBUTES_VALUE still needs some “empty” implementation to avoid dumps if the system calls this method... ENDMETHOD statements (without implementation in between) as coding. If this method is not needed by a class. 36 © 2008 SAP AG. Object Functions Handling in Classes Interface BI_OBJECT Figure 18: Implementation – DEFAULT_ATTRIBUTE_VALUE This example demonstrates how this method could be implemented. the interface-method still needs some “empty” implementation to avoid dumps if the system calls this method. just enter the METHOD . All rights reserved.. Even if a class does not return a specific default value (thus indicating that the object key will be used). 2008 . In this case. The statement GET REFERENCE OF is used to return a pointer to the DATA-Object (REF TO DATA) rather than the data object itself. In this case. ..Unit 2: ABAP Classes Definition and Implementation BIT611 * load field maktx of structure m_makt into * class attribute description me->description = m_makt-maktx. The example above demonstrates. *. 37 .end of local data CALL FUNCTION 'BAPI_MATERIAL_DISPLAY' EXPORTING material = me->matnr IMPORTING return = ls_return . 2008 © 2008 SAP AG. the system calls EXECUTE_DEFAULT_METHOD. It expects that the class has a method DISPLAY that shows a dialog for an instance of this class. which implements this navigation. Since the generic tools cannot know how to navigate to a given object (which may be of some user-defined class). workflow inbox) by displaying their default attribute.Instance Handling and Key Fields Figure 19: Implementation – EXECUTE_DEFAULT_METHOD The tools that represent objects in a textual way (for example.BIT611 Lesson: Class Definition . how this method could be implemented. WHEN '000'. For many existing business objects. *. this method is implemented simply by calling the standard display transaction: METHOD DISPLAY. also allow you to navigate to an object by clicking on that default value.begin of local data DATA: ls_return TYPE bapiret1. CASE ls_return-number. All rights reserved. the interface method still needs some “empty” implementation to avoid dumps if the system calls the method.Unit 2: ABAP Classes Definition and Implementation BIT611 WHEN '262'. In this case. Nevertheless. an “empty” implementation is required to avoid dumps if the method is called by the system. If a class does not have a default method. 38 © 2008 SAP AG. The instance could therefore be removed from the instance management as soon as the last reference to this object is released. the system can provide different services. By calling the method RELEASE. generic dialogs to find an instance. 2008 . WHEN '305'. just enter the METHOD . All rights reserved. Most classes will not implement this method. RAISE EXCEPTION TYPE cx_bo_error.. ENDMETHOD statements (without implementation in between) as coding. for example. If key attributes are specified. an application can signal that it no longer needs the given object.. This enables the garbage collector to free the related memory. ENDCASE. RAISE EXCEPTION TYPE cx_bo_error. Key fields Classes implementing interface IF_WORKFLOW are recognized by transaction SE24 as “Workflow” enabled: such a class can declare attributes as key fields. ENDMETHOD. WHEN OTHERS. The reason for this restriction is that the length of the field INSTID of the persistent representation for an object has a length of 32. Furthermore.BIT611 Lesson: Class Definition . only one key field is possible). DATS or TIMS) with fixed length. All rights reserved. All specified key fields must be character fields (elementary types CHAR. the total length when concatenating all key attributes must not exceed 32 characters. it is of course also possible to use a character guid (GUID32) as the type of the key field (in this case.Instance Handling and Key Fields Figure 20: Implementation of Key Fields If an object type specifies multiple key fields. the order is the same as displayed in the class builder. 39 . Applications that internally use raw-guids (GUID16) should define the key field as an (additional) character guid field an move the raw-guid to this attribute in the constructor. For general ABAP classes implementing IF_WORKFLOW. NUMC. 2008 © 2008 SAP AG. All rights reserved. BIT611 2008 .Unit 2: ABAP Classes Definition and Implementation 40 © 2008 SAP AG. These extensions are implemented in an ABAP Object.. 41 . Complete the basic data of this class as follows: Continued on next page 2008 © 2008 SAP AG. If so. and ENDMETHOD. you will be able to: • Create a class for use in the workflow architecture • Implement instance handling for the workflow engine • Define key fields Business Example Your company has developed some add-ons to the standard business scenarios of the SAP ERP system. ” could appear.Instance Handling and Key Fields Exercise 1: Create a Class with Instance Handling Exercise Objectives After completing this exercise.BIT611 Lesson: Class Definition . All rights reserved. Please use this possibility if you do not have enough time or you are not an experienced developer. Caution: If you create the following class.. and save the method. We want to create functions like these encapsulated in the BOR object type BUS1001006. . You could also copy some coding from the example implementation of class ZBIT611_MARA. a warning like “Implementation missing for method "BI_OBJECT~RELEASE" . please go into method implementation of called function and insert a line with a space between METHOD . Hint: Please be aware that you have to be an experienced developer to implement all following functions in the given exercise time. where ## represents your group number. To gain experience with the techniques of inserting these functions in the workflow architecture. Task: Create a new class for use in the workflow architecture. someone has to test the possibilities. You have the task of creating some ABAP class functions as examples for your colleagues. Create a new class ZBIT611_##. 1. . All rights reserved. 2. please create an import parameter. and you have to program FIND_BY_LPOR an LPOR method.Unit 2: ABAP Classes Definition and Implementation Object type: ZBIT611_## (Class) Description: Class Group ## (Material) Package: Z001 BIT611 Use the IF_WORKFLOW interface to define the standard behavior of your class. To finish the implementation of the “Instance Handler” functions. Also maintain an exception to handle within this method. 42 Test your implementation by using the “Test” button (F8). You need to implement some types and attributes to administer the class instances. so please set coding (read single entry from leading database table) at first in the constructor method itself. like the key field inserted above.the assignment of import variable to key field of class .calling of the existencecheck method . To call the CONSTRUCTOR method in a object oriented way. Enter the key field Material Number into class ZBIT611_##.set the initial values of the class reference for handling in workflow The existencecheck method has to be implemented (part of the next exercise). Also calling the functions to set initial values of workflow class is part of a later exercise. 3. which have to be handled in this method: . 2008 . There are some functions. 5. insert the necessary code in the CONSTRUCTOR method. © 2008 SAP AG. Develop the “Instance Handling” of your class. 4. for this function. BIT611 Lesson: Class Definition . a warning like “Implementation missing for method "BI_OBJECT~RELEASE" .Instance Handling and Key Fields Solution 1: Create a Class with Instance Handling Task: Create a new class for use in the workflow architecture.. All rights reserved. If so. Complete the basic data of this class as follows: Object type: ZBIT611_## (Class) Description: Class Group ## (Material) Package: Z001 Continued on next page 2008 © 2008 SAP AG. . Create a new class ZBIT611_##.. ” could appear. please go into method implementation of called function and insert a line with a space between METHOD . Caution: If you create the following class. . 1. and save the method. and ENDMETHOD. 43 . where ## represents your group number. Continued on next page 44 © 2008 SAP AG.Unit 2: ABAP Classes Definition and Implementation BIT611 Use the IF_WORKFLOW interface to define the standard behavior of your class. In the next dialog. 2008 . The following entries should appear: BI_OBJECT BI_PERSISTENT IF_WORKFLOW Save your class (Ctrl + S). All rights reserved. enter the description Class Group ## (Material) Check the following parameters and press Enter (F8): b) Instantiation: Public Class Type: Usual ABAP Class Only Modeled: -> no entry Final: 'X' Go to the tab “Interfaces” and insert interface IF_WORKFLOW. a) To create a class. check selection “Class” and press Enter (F8). In the next dialog. navigate to the class builder:Tools → Business Workflow → Development → Definition Tools → Application Integration → Class Builder (SE24) Insert class name ZBIT611_## and press the “Create” Button. Press enter. BIT611 Lesson: Class Definition - Instance Handling and Key Fields 2. Enter the key field Material Number into class ZBIT611_##. a) Use the business object type BUS1001006 as an example implementation to compare features of your class with some existing code. b) Go to the tab “Attributes” and insert the following properties into first line: Attribute: MATNR Level: Instance Attribute Visibility: Public Key Attribute: 'X' Read-Only: 'X' Typing: Type Associated Type: MARA-MATNR Description: -> set automatically Initial Value: -> not required Save your class (Ctrl + S). 3. Develop the “Instance Handling” of your class. You need to implement some types and attributes to administer the class instances, and you have to program FIND_BY_LPOR an LPOR method. To call the CONSTRUCTOR method in a object oriented way, please create an import parameter, like the key field inserted above, for this function. Also maintain an exception to handle within this method. a) Call Edit -> Create Constructor and mark the created entry in tab “Methods”. Press the “Parameters” Button and insert the following properties into first line: Parameter: IM_MATNR Pass Value: -> no entry Optional: -> no entry Typing Method: Type Associated Type: MARA-MATNR Default Value: -> not required Description: -> set automatically Continued on next page 2008 © 2008 SAP AG. All rights reserved. 45 Unit 2: ABAP Classes Definition and Implementation BIT611 Save your class (Ctrl + S). b) To handle the raised exceptions of this method, insert exception class “CX_BO_ERROR” in the exception list of the CONSTRUCTOR method (tab “Exceptions”). Exceptions are theme of chapter 3, however it is necessary to handle a failed constructor method. Please insert the information as described and wait for an explanation until chapter 3. c) Go to the tab “Types” and insert two entries T_INSTANCE and T_INSTANCES with Visibility “Private”. Press the “Direct Type Entry” button (after column Associated) and declare the types in next GUI as follows: TYPES: BEGIN OF t_instance, number TYPE mara-matnr, instance TYPE REF TO zbit611..., END OF t_instance . TYPES: t_instances TYPE STANDARD TABLE OF t_instance . Save your class (Ctrl + S) and navigate back into your class. d) Go to the tab “Attributes” and insert a new line with the following properties: Attribute: MST_INSTANCES Level: Static Attribute Visibility: Private Key Attribute: -> no entry Read-Only: -> no entry Typing: Type Associated Type: T_INSTANCES Description: -> set automatically Initial Value: -> not required Save your class (Ctrl + S). e) Go to the tab “Methods” (with the 'Back to methods' button) and double click the BI_PERSISTENT~FIND_BY_LPOR method. Implement the coding as shown in the following example. Continued on next page 46 © 2008 SAP AG. All rights reserved. 2008 BIT611 Lesson: Class Definition - Instance Handling and Key Fields If you want to compare your coding, please call the implementation of class ZBIT611_MARA! METHOD bi_persistent~find_by_lpor. DATA: l_standardmaterial TYPE REF TO zbit... . " reference of object DATA: l_matnr TYPE mara-matnr. " key field DATA: ls_instance TYPE t_instance. " instance handling * Check if LPOR is filled CHECK lpor-instid IS NOT INITIAL. * instid of import parameter LPOR is object key l_matnr = lpor-instid. * ??? instance already exists ??? READ TABLE mst_instances WITH KEY number = l_matnr INTO ls_instance. * if no result found IF sy-subrc NE 0. * create object l_standardmaterial TRY. CREATE OBJECT l_standardmaterial EXPORTING im_matnr = l_matnr . CATCH cx_bo_error . EXIT. ENDTRY. * append result to mst_instances ls_instance-number = l_matnr. ls_instance-instance = l_standardmaterial. APPEND ls_instance TO mst_instances. ENDIF. * fill result result = ls_instance-instance. ENDMETHOD. Save your class (Ctrl + S). Continued on next page 2008 © 2008 SAP AG. All rights reserved. 47 '. m_por-typeid = 'ZBIT611.. * fill attribute m_por * could also be placed in the constructor m_por-catid = 'CL'. There are some functions. If you want to compare your coding. All rights reserved. Implement the coding as shown in the following example. Save your class (Ctrl + S). m_por-instid = me->matnr. * load instance attribute m_por into result result = m_por. ENDMETHOD. insert the necessary code in the CONSTRUCTOR method. g) Go to the tab “Methods” (with the 'Back to methods' button) and double click the BI_PERSISTENT~LPOR method. 2008 . which have to be handled in this method: Continued on next page 48 © 2008 SAP AG..Unit 2: ABAP Classes Definition and Implementation f) BIT611 Go to the tab “Attributes” and insert a new line with the following properties: Attribute: M_POR Level: Instance Attribute Visibility: Private Key Attribute: -> no entry Read-Only: -> no entry Typing: Type Associated Type: SIBFLPOR Description: -> set automatically Initial Value: -> not required Save your class (Ctrl + S). 4. To finish the implementation of the “Instance Handler” functions. please call the implementation of class ZBIT611_MARA! METHOD bi_persistent~lpor. set the initial values of the class reference for handling in workflow The existencecheck method has to be implemented (part of the next exercise). 49 .the assignment of import variable to key field of class .Instance Handling and Key Fields . All rights reserved.BIT611 Lesson: Class Definition . so please set coding (read single entry from leading database table) at first in the constructor method itself. Continued on next page 2008 © 2008 SAP AG.calling of the existencecheck method . Implement the coding as shown in the following example.Unit 2: ABAP Classes Definition and Implementation BIT611 Also calling the functions to set initial values of workflow class is part of a later exercise. ENDMETHOD. * calling of the existence check method SELECT SINGLE * FROM mara INTO m_mara WHERE matnr = me->matnr. If you want to compare your coding. All rights reserved. * DUMMY ENDIF. Continued on next page 50 © 2008 SAP AG. 2008 . IF sy-subrc NE 0. Go to tab “Attributes” and insert a new line with the following properties: Attribute: M_MARA Level: Instance Attribute Visibility: Private Key Attribute: -> no entry Read-Only: -> no entry Typing: Type Associated Type: MARA Description: -> set automatically Initial Value: -> not required Save your class (Ctrl + S). b) Go to the tab “Methods” (with the 'Back to methods' button) and double click the CONSTRUCTOR method. * assignment of import variable to key field of class matnr = im_matnr. Save your class (Ctrl + S) and activate it. a) It is possible to use the existence check to fill the main table entry of the main application table into an attribute of your class. please call implementation of class ZBIT611_MARA! METHOD constructor. One attribute (the key field MATNR) should also be shown. a) Press the “Test” button (F8). All rights reserved. “BI_PERSISTENT” and “IF_WORKFLOW”. Test your implementation by using the “Test” button (F8). where you see the interfaces “BI_OBJECT”. b) Enter the material “T-BBD##” into the field IM_MATNR and press the “Instance” button. 2008 © 2008 SAP AG. c) A screen should be displayed.BIT611 Lesson: Class Definition . 51 .Instance Handling and Key Fields 5. Unit 2: ABAP Classes Definition and Implementation BIT611 Lesson Summary You should now be able to: • Create a class • Create instance handling required for workflow engine • Define key fields 52 © 2008 SAP AG. All rights reserved. 2008 . Now you want to create the attributes to be handled in the workflow engine and also the methods that you require. There are no restrictions as to the data type of these attributes. All rights reserved.BIT611 Lesson: Class Definition . like values Define multiline attributes Describe how object references are addressed in the BOR and the workflow Business Example You have created a new customer-specific class and defined instance handling and key fields. attributes can refer to database fields. Lesson Objectives After completing this lesson. All simple ABAP types and all DDIC types or references to other classes can be used. This lesson describes the main programming aspects in connection with the handling of class attributes in the workflow engine. The following attribute natures are developed (in business object types) to be handled in workflow engine (and should reflected by the class structures): • • • • 2008 database attributes . You want the methods to be called using parameters. Definition of Attributes The workflow engine provides the possibility to access all public attributes of an object. the value of attributes always set by methods (for example. or they can be virtual attributes whose content is determined at runtime.Attributes and Methods Lesson Overview In business object types. and return parameters and exceptions. based on stored coding.calculation with user's own ABAP code attributes typed either with an ABAP dictionary field or an object type / class single-line and multiline attributes © 2008 SAP AG. It also describes the form in which attributes handle object references and multiline values and its conjunctions to the runtime environment.access to database tables virtual attributes . 53 . you will be able to: • • • • Define attributes with a database reference Define “virtual attributes”.Attributes and Methods Lesson: Class Definition . In classes. in the constructor). Unit 2: ABAP Classes Definition and Implementation BIT611 A Database Attribute is defined with reference to a column of the related application table. in the CONSTRUCTOR -> to get a behavior like “Virtual Attributes” in business object types .the coding will be passed at runtime (when the workflow engine calls the virtual attribute) . for example. you have the possibility to read the complete database row and buffer it in the class. as this is executed for each instance whether the attribute is used or not Database Attributes Figure 21: Implementing Database Field Attributes 54 © 2008 SAP AG.a “Functional Method” (GET_-method) has to be implemented with special properties (see below). A Virtual Attribute is a special function of object types: -> in classes you always have the possibility to calculate the values of attributes with (your own) ABAP code by implementing it in the relevant methods (SET_-method) and call them. When the database is first accessed. 2008 . Some General Hints: • • • • • Class attributes work like variables They have to be set in CONSTRUCTOR method They have to be refreshed in the BI_PERSISTENT~REFRESH method It is recommended to flag them as read-only Performance Note: Avoid complex attributes that are not always needed. All rights reserved. All rights reserved. The necessary attributes should set in the CONSTRUCTOR method of class.for example. Virtual Attributes Figure 22: Functional Methods (Virtual Attributes) .Enhanced equivalent of BOR Virtual Attributes Can NOT be used in Work Item Texts . you have to implement the settings of the relevant attributes in the BI_PERSISTENT~REFRESH method.Attributes and Methods The workflow engine provides the possibility to access all public attributes of an object.for example. There are no restrictions as to the data type of these attributes. 55 . because the workflow engine need the values when object instance is created. EMAIL_ADDRESS Can be used in bindings and container operations . To refresh attribute values. GET_EMAIL_ADDRESS Returning parameter has to be named like virtual attributes . especially when business content of object is changed.Bind to separate task container element instead © 2008 SAP AG. All simple ABAP types and all DDIC-types or references to other classes can be used.Example Hint: To simulate the behavior of Virtual Attributes you can use Functional Methods: • • • • • • 2008 Method with one returning parameter Can have importing but no exporting parameters Naming convention: GET_ .BIT611 Lesson: Class Definition . Unit 2: ABAP Classes Definition and Implementation BIT611 Virtual attributes have to be calculated if the workflow engine calls them in a process context. Such attributes have to be declared using the structure “SWOTOBJID” as the data type which the workflow system recognizes as a persistent BOR object handle. The workflow system assumes that object valued attributes of a persistent object will automatically be instantiated by the persistent class when its FIND_BY_LPOR method is called . Normal class attributes are set with method functions in CONSTRUCTOR (or in REFRESH) method (see explanations above). 2008 . Such an attribute then points to “any BOR object”. the workflow engine interprets Functional Methods as Virtual Attributes. no instantiation automatism is invoked for attributes.in other words. Figure 23: Implementing Class References It is also possible to define attributes that point to BOR objects. To become more specific and declare your attribute as. you need to provide an initial value in which you supply the object type. To reach the “old” BOR behavior in classes. References If attributes have to be object references (ABAP Objects). for example a BOR object of type “BUS2012”. 56 © 2008 SAP AG. This behavior is a speciality of attributes from business object types. then these classes are not required to implement IF_WORKFLOW (it is required for the objects stored directly in the workflow context (container) but is not required for attributes of these objects). All rights reserved. 57 .. This structure consists of the fields LOGSYS.. ENDMETHOD.Attributes and Methods Figure 24: Implementing Object Type References METHOD set_. . 2008 © 2008 SAP AG. Here. DATA: lt_porder TYPE swfborptab. All rights reserved. Caution: Structure SWOTOBJID is the BOR specific persistent representation of an object. ls_porder TYPE swotobjid VALUE ' BUS2012'. OBJTYPE. OBJKEY and DESCRIBE. .. the initial value of this attribute starts with 10 spaces (for LOGSYS) followed by the object type “BUS1001006” in upper case.. Since we need to leave the field LOGSYS blank.BIT611 Lesson: Class Definition . “OBJTYPE” is the only field you have to fill. under Goto -> Class-local types -> Local class implementations. selection of responsible agent. you can use the common BOR macros. you need the line: INCLUDE <cntn02>. Hint: In the “Local types” section of your class. and so on) Starting in release 6. where the process or its steps can be dynamically configured (for example. deadlines. Therefore.Unit 2: ABAP Classes Definition and Implementation BIT611 The above steps declare an attribute that represents a BOR object of a given type. you need the line: INCLUDE <cntn03>. These expressions can occur in • • • • data binding conditions container operations in any location.30. All rights reserved. under Goto -> Class-local types -> Macros. an expression can also be used to synchronously call a method. Figure 25: INCLUDE <cntn03> Hint: In the “Macros” section of your class.attribute&”. attributes need not be exposed as public attributes. but can also be accessed via GET_-methods. 2008 . 58 © 2008 SAP AG. This type of initialization is typically done in the CONSTRUCTOR of your class. To initialize this attribute with a specific BOR object instance. Figure 26: INCLUDE <cntn02> Using Attributes in Processes Attributes are typically accessed in workflow expressions like “&my_object. 59 . and so on. methods of these classes can be executed within a step. In short. these methods have all the features that. Figure 27: Synchronous and Asynchronous methods The methods implement business logic. 2008 © 2008 SAP AG. They can invoke dialogs. they can run synchronously or asynchronously. their execution (status) appears in the workflow log. were reserved for BOR methods.BIT611 Lesson: Class Definition . Since these objects can be implemented by ABAP classes. All rights reserved. invoke methods of objects that are accessible within the process context.Attributes and Methods Definition of Methods Individual steps that are executed by the workflow engine as part of business processes. in previous releases. All rights reserved. there is another place to set these properties in connection with the workflow architecture (see figure above). you have to set some properties in BOR methods (as example. only public methods can be invoked. Note: The BOR method properties are then pasted to the “Standard Task” properties automatically. 2008 . synchronous/asynchronous). These methods could be defined in different ways: • • 60 defined at the class or one of its super-classes included via interfaces © 2008 SAP AG. Note: You have to set the Class method properties in the “Standard Task” directly! In general.Unit 2: ABAP Classes Definition and Implementation BIT611 Figure 28: Properties of Workflow Steps There is one difference between BOR and Class methods. dialog/background. You do not have the possibility to define these properties to a Class method. Therefore. To define the behavior of the workflow engine. All rights reserved. string. export parameters). complex types) not containing ABAP-OO references BOR object references References to ABAP classes that support the interface IF_WORKFLOW © 2008 SAP AG. the types of the method parameters are restricted to one of the following: • • • • 2008 Simple types (for example. tables. If the method name gets too long. as well as. Parameters of Methods In most cases. 61 . Since the workflow engine in some cases uses RFC ( calling methods in background .using an RFC . import parameters) or to receive values (for example. IF_WORKFLOW~FIND_BY_LPOR. integer. methods will have parameters (import-. structures. The total length for a method name may exceed 30 characters (currently the maximum length for a method name that can be entered in a single step task). For methods that are included via interfaces. the class which includes the interface should simply define an alias name for this method. and so on) Any DDIC type (for example.Attributes and Methods Methods defined at the class itself or one of its super-classes can always be used directly within the workflow engine. it is possible of pass values (for example. When calling a method in a step of a process. for example. when defining expressions) and avoid the length problem.requires that all parameters can internally be serialized / deserialized) to call a method. One can then use a public alias name (when defining tasks. a restriction applies: Hint: Since some methods included via interfaces are specified in the form “interface-name”~“method-name”. export-.BIT611 Lesson: Class Definition . and so on). When defining a task that calls this method.Unit 2: ABAP Classes Definition and Implementation BIT611 Method parameters representing persistent objects could be defined in any of the following ways: • ABAP classes (implementing IF_WORKFLOW) – TYPE SIBFLPORB The object is passed using its persistent representation – TYPE REF TO <classname> The object is passed as object handle • BOR objects – TYPE SIBFLPORB The object is passed using its persistent representation – TYPE SWOTOBJID the object is passed using its persistent representation that is only valid for BOR objects Caution: Using one of the persistent object reference (POR) structures will lead to parameters with an unspecified object type. the persistent reference can be typed using initial values. you can make sure that only objects of a specific type can be passed to the task (and hence to the method) through data binding in the workflow. 62 © 2008 SAP AG. edit the task container and change the object type of this parameter (element) to the concrete object type you need. the method parameters are replicated into the task container. the workflow builder will “see” only the correctly typed element in your task container. This way. 2008 . However. In that case. All rights reserved. There are more options to type a persistent object reference if these methods are used in tasks. When you integrate this task into a workflow step later. when one of the POR structures is used. 2008 © 2008 SAP AG. “B” and “C”). Result parameters have an influence on the use of methods in workflow steps: If the result parameter is defined with a data reference on a fixed value domain (such as CHAR1 with the fixed values “A”. “B” and “C” in the Workflow Builder for the new step when he or she incorporates a step based on this method.Attributes and Methods Figure 29: Implementing the Return of Results In defining BOR methods there is also a technique called “Return of Results”. To implement this feature please define a “Returning” parameter in method interface that contains a domain with an explicit maintained value range (see also table field SWXFORMABS-PROCSTATE with domain SWX_PROCST). the system always specifically selects the output that returns the method as a value for the result parameter. the modeler receives three outputs with the name “A”. 63 . All rights reserved. When processing the workflow.BIT611 Lesson: Class Definition . Unit 2: ABAP Classes Definition and Implementation 64 © 2008 SAP AG. All rights reserved. BIT611 2008 . All rights reserved. Please use this possibility if you do not have enough time or you are not an experienced developer. Please insert some attributes with database and object reference and an attribute that refers to a list of purchase orders (also object references).Attributes and Methods Exercise 2: Create Attributes for Workflow Class Exercise Objectives After completing this exercise. 65 . . We want to create functions like these encapsulated in the BOR object type BUS1001006. ”. someone has to test the possibilities. please go into method implementation of called function and insert a line with a space between METHOD .BIT611 Lesson: Class Definition . Task: To take advantage of class functions in the workflow architecture. If so. you may see a warning like “Implementation missing for method "BI_OBJECT~RELEASE" . 1. Caution: If you create the following class.. You could also copy some coding from the example implementation of class ZBIT611_MARA. and save the method.. Create a read_attributes method in your class to set all necessary attributes to handle within your class: Continued on next page 2008 © 2008 SAP AG. . To get experience with the techniques of inserting these functions in workflow architecture. you have to implement some different types of attributes in your implementation. These extensions are implemented in ABAP Objects. Hint: Please be aware that you have to be an experienced developer to implement all following functions in the given exercise time. and ENDMETHOD. you will be able to: • Define attributes with different references Business Example Your company has developed some add-ons to the standard business scenarios of the SAP ERP system. Your have the task of creating some ABAP class functions as examples for your colleagues. INDUSTRY . 2.MATERIALTYPE . 7. 4. Create a (virtual. To execute the above developed methods at the right time (for workflow engine). It should contain the material number and the text (table MAKT).Unit 2: ABAP Classes Definition and Implementation BIT611 . OPTIONAL: Create a set_purchaseorder method to set the result of a class attribute points to a list of object references of object type BUS2012. 66 Test your implementation by using the “Test” button (F8). 6. 5. single-line) get_actual_date attribute (functional method) to get the actual date and time when the virtual attribute is called from workflow engine. © 2008 SAP AG. OPTIONAL: Create a set_formabsenc method to set the result of a class attribute points to a reference of class CL_SWF_FORMABSENC. All rights reserved. Create a set_description method to set a default attribute like the one in business object types. To use this attribute. 3.LABOR Insert a call of this method in the BI_PERSISTENT~REFRESH method. you have to call it in the CONSTRUCTOR method.MATERIALGROUP . insert a call of it in the BI_OBJECT~DEFAULT_ATTRIBUTE_VALUE method. 2008 . Use the class CL_BSP_UTILITY for this purpose. Caution: If you create the following class. All rights reserved.BIT611 Lesson: Class Definition .INDUSTRY . 67 .Attributes and Methods Solution 2: Create Attributes for Workflow Class Task: To take advantage of class functions in the workflow architecture. . a) To change your class. and save the method. Create a read_attributes method in your class to set all necessary attributes to handle within your class: . ”..MATERIALGROUP .MATERIALTYPE . Please insert some attributes with database and object reference and an attribute that refers to a list of purchase orders (also object references). please go into method implementation of called function and insert a line with a space between METHOD .. b) Go to the tab “Attributes” and insert a new line with the following properties: Attribute: MATERIALGROUP Level: Instance Attribute Visibility: Public Key Attribute: -> no entry Read-Only: 'X' Typing: Type Continued on next page 2008 © 2008 SAP AG. 1. If so. .LABOR Insert a call of this method in the BI_PERSISTENT~REFRESH method. navigate to the class builder:Tools → Business Workflow → Development → Definition Tools → Application Integration → Class Builder (SE24) Insert the class name ZBIT611_## and press the “Change” button. and ENDMETHOD. you have to implement some different types of attributes in your implementation. you may see a warning like “Implementation missing for method "BI_OBJECT~RELEASE" . Unit 2: ABAP Classes Definition and Implementation BIT611 Associated Type: MARA-MATKL Description: -> set automatically Initial Value: -> not required Attribute: MATERIALTYPE Level: Instance Attribute Visibility: Public Key Attribute: -> no entry Read-Only: 'X' Typing: Type Associated Type: MARA-MTART Description: -> set automatically Initial Value: -> not required Attribute: INDUSTRY Level: Instance Attribute Visibility: Public Key Attribute: -> no entry Read-Only: 'X' Typing: Type Associated Type: MARA-MBRSH Description: -> set automatically Initial Value: -> not required Attribute: LABOR Level: Instance Attribute Visibility: Public Key Attribute: -> no entry Read-Only: 'X' Typing: Type Associated Type: MARA-LABOR Description: -> set automatically Initial Value: -> not required Continued on next page 68 © 2008 SAP AG. All rights reserved. 2008 . me->materialtype = me->m_mara-mtart. 69 .Attributes and Methods Save your class (Ctrl + S).BIT611 Lesson: Class Definition . SELECT SINGLE * FROM mara INTO m_mara WHERE matnr = me->matnr. c) Go to the tab “Methods” and insert following entries in new line: Method: READ_ATTRIBUTES Level: Instance Method Visibility: Private Method type: -> no entry Description: Read attributes from database tables Save your class (Ctrl + S). ENDMETHOD. ENDMETHOD. Implement the coding as shown in the following example. call the implementation of class ZBIT611_MARA. Save your class (Ctrl + S). All rights reserved. me->materialgroup = me->m_mara-matkl. call the implementation of class ZBIT611_MARA. e) Go to the tab “Methods” and double click the BI_PERSISTENT~REFRESH method. METHOD read_attributes. d) Double-click the READ_ATTRIBUTES method. If you want to compare your coding. Continued on next page 2008 © 2008 SAP AG. METHOD bi_persistent~refresh. If you want to compare your coding. Implement the coding as shown in the following example. read_attributes( ). me->industry = me->m_mara-mbrsh. me->labor = me->m_mara-labor. It should contain the material number and the text (table MAKT). 2008 .Unit 2: ABAP Classes Definition and Implementation BIT611 Save your class (Ctrl + S). insert a call of it in the BI_OBJECT~DEFAULT_ATTRIBUTE_VALUE method. All rights reserved. Create a set_description method to set a default attribute like the one in business object types. a) Go to the tab “Attributes” and insert a new line with the following properties: Attribute: M_MAKT Level: Instance Attribute Visibility: Private Key Attribute: -> no entry Read-Only: -> no entry Typing: Type Associated Type: MAKT Description: -> set automatically Initial Value: -> not required Attribute: DESCRIPTION Level: Instance Attribute Visibility: Public Key Attribute: -> no entry Read-Only: 'X' Typing: Type Associated Type: SYST-TITLE Description: -> set automatically Initial Value: -> not required Save your class (Ctrl + S). b) Go to the tab “Methods” and insert following entries in new line: Continued on next page 70 © 2008 SAP AG. To use this attribute. 2. Attributes and Methods Method: SET_DESCRIPTION Level: Instance Method Visibility: Private Method type: -> no entry Description: Set description Save your class (Ctrl + S). All rights reserved. * call table makt and m_makt SELECT SINGLE * FROM makt INTO m_makt WHERE spras = sy-langu AND matnr = matnr. call the implementation of class ZBIT611_MARA. METHOD bi_object~default_attribute_value. c) Double-click the SET_DESCRIPTION method. Continued on next page 2008 © 2008 SAP AG. If you want to compare your coding. Implement the coding as shown in the following example. METHOD set_description. * load field maktx of structure m_makt into class attribute description CONCATENATE 'Text zu' matnr ':' m_makt-maktx INTO description SEPARATED BY space. 71 . d) Go to the tab “Methods” and double-click the BI_OBJECT~DEFAULT_ATTRIBUTE_VALUE method. Implement the coding as shown in the following example. Save your class (Ctrl + S). If you want to compare your coding. ENDMETHOD. ENDMETHOD. call the implementation of class ZBIT611_MARA. Save your class (Ctrl + S) and activate it.BIT611 Lesson: Class Definition . GET REFERENCE OF description INTO result. BIT611 To execute the above developed methods at the right time (for workflow engine). Create a (virtual. Implement the coding as shown in the following example. a) Go to the tab “Methods” and insert following entries in new line: Method: GET_ACTUAL_DATE Level: Instance Method Visibility: Public Method type: -> no entry Description: Get actual date (as virtual attribute) Save your class (Ctrl + S).Unit 2: ABAP Classes Definition and Implementation 3. you have to call it in the CONSTRUCTOR method. call the implementation of class ZBIT611_MARA. b) Press the “Parameters” button and insert a new line with the following properties: Parameter: EX_ACTUAL_DATE Type: Returning Pass Value: -> set automatically Optional: -> set automatically Typing Method: Type Continued on next page 72 © 2008 SAP AG. single-line) get_actual_date attribute (functional method) to get the actual date and time when the virtual attribute is called from workflow engine. Save and activate your class (Ctrl + S). me->set_description( ). me->read_attributes( ). 2008 . 4. If you want to compare your coding. All rights reserved. a) Double-click the CONSTRUCTOR method. Use the class CL_BSP_UTILITY for this purpose. a) Go to the tab “Methods” and insert following entries in new line: Continued on next page 2008 © 2008 SAP AG. Implement the coding as shown in the following example. 5. DATA: lref_bsp_utility TYPE REF TO cl_bsp_utility. Save your class (Ctrl + S). CALL METHOD cl_bsp_utility=>date_to_string_http EXPORTING timestamp = lv_timestamp RECEIVING result = lv_result. lv_result TYPE string. ENDMETHOD. All rights reserved. c) Double-click the GET_ACTUAL_DATE method.Attributes and Methods Associated Type: STRING Default Value: -> set automatically Description: -> set automatically Save your class (Ctrl + S). call the implementation of class ZBIT611_MARA. CONCATENATE sy-datum sy-uzeit INTO lv_timestamp. OPTIONAL: Create a set_formabsenc method to set the result of a class attribute points to a reference of class CL_SWF_FORMABSENC.BIT611 Lesson: Class Definition . METHOD get_actual_date. 73 . If you want to compare your coding. actual_date = lv_result. lv_timestamp TYPE char14. b) Go to the tab “Attributes” and insert a new line with the following properties: Attribute: FORMABSENC Level: Instance Attribute Visibility: Public Key Attribute: -> no entry Read-Only: 'X' Typing: Type Ref To Associated Type: CL_SWF_FORMABSENC Description: -> set automatically Initial Value: -> not required Save your class (Ctrl + S). All rights reserved. c) Double-click the SET_FORMABSENC method. If you want to compare your coding. call the implementation of class ZBIT611_MARA.Unit 2: ABAP Classes Definition and Implementation BIT611 Method: SET_FORMABSENC Level: Instance Method Visibility: Private Method type: -> no entry Description: Set object reference of class CL_SWF_FORMABSENC Save your class (Ctrl + S). CREATE OBJECT l_formabsenc EXPORTING im_number = '0000004980' . * Local Data DATA l_formabsenc TYPE REF TO cl_swf_formabsenc. * Create Object Reference TRY. METHOD set_formabsenc. Implement the coding as shown in the following example. 2008 . Continued on next page 74 © 2008 SAP AG. b) Go to the tab “Methods” and insert following entries in new line: Continued on next page 2008 © 2008 SAP AG. d) 6. * Fill class attribute formabsenc = l_formabsenc. Insert the just created method in the CONSTRUCTOR method. All rights reserved. OPTIONAL: Create a set_purchaseorder method to set the result of a class attribute points to a list of object references of object type BUS2012. 75 . ENDMETHOD. ENDTRY. Save your class (Ctrl + S).Attributes and Methods CATCH cx_bo_error . a) Go to the tab “Attributes” and insert a new line with the following properties: Attribute: PURCHASEORDER Level: Instance Attribute Visibility: Public Key Attribute: -> no entry Read-Only: 'X' Typing: Type Associated Type: SWFBORPTAB Description: -> set automatically Initial Value: -> not required Save your class (Ctrl + S).BIT611 Lesson: Class Definition . EXIT. All rights reserved. DATA: lt_porder ls_porder TYPE swfborptab. In the “Macros” section of your class. under Goto -> Class-local types -> Local class implementations. METHOD set_purchaseorder. Implement the coding as shown in the following example. TYPE swotobjid VALUE ' BUS2012'. lt_tekdoc TYPE STANDARD TABLE OF ekdoc. ls_tekdoc TYPE ekdoc. you have to insert the following lines: Hint: In the “Local types” section of your class. CLEAR lv_werks. DATA: lref_porder TYPE swc_object. call the implementation of class ZBIT611_MARA.Unit 2: ABAP Classes Definition and Implementation BIT611 Method: SET_PURCHASEORDER Level: Instance Method Visibility: Private Method type: -> no entry Description: Set object references of object type BUS2012 Save your class (Ctrl + S). c) To get all functions referring to the macro language used to handle business object types. d) Double-click the SET_PURCHASEORDER method. If you want to compare your coding. 2008 . you need the line: INCLUDE <cntn03>. you need the line: INCLUDE <cntn02>. under Goto -> Class-local types -> Macros. CALL FUNCTION 'ME_CHECK_DOCUMENT_FOR_MATERIAL' EXPORTING * EXISTENCE_CHECK = ' ' matnr * PLANT_INITIAL = matnr = ' ' Continued on next page 76 © 2008 SAP AG. lv_werks TYPE ekpo-werks. ENDMETHOD. purchaseorder = lt_porder. 77 .BIT611 Lesson: Class Definition . swc_create_object lref_porder 'BUS2012' ls_tekdoc-ebeln. Continued on next page 2008 © 2008 SAP AG. LOOP AT lt_tekdoc INTO ls_tekdoc WHERE bstyp = 'F'.Attributes and Methods werks = lv_werks * PLANT_INFO = ' ' * BWART = * BWKEY = * NO_ACCOUNT_ASSIGNED = ' ' * BMATN = * MPROF = * IF_SOBKZ = * IF_VBELN = * IF_VBELP = * IF_PSPNR = * IMPORTING * CONTRACT_FLAG = * DELPLAN_FLAG = * INFO_FLAG = * PO_FLAG = * REQ_FLAG = * RFQ_FLAG = TABLES xekdoc = lt_tekdoc EXCEPTIONS OTHERS. All rights reserved. swc_object_to_persistent lref_porder ls_porder. ENDLOOP. Caution: The Default Value of “LS_PORDER” should have 10 spaces before the object type name (see also description in the previous lesson). Save your class (Ctrl + S). . APPEND ls_porder TO lt_porder. a) Press “Test” Button (F8). 2008 . All rights reserved.Unit 2: ABAP Classes Definition and Implementation e) 7. It should also show the above developed attributes. “BI_PERSISTENT” and “IF_WORKFLOW”. b) Enter the material “R-1003” in the field IM_MATNR and press the “Instance” button. c) A screen should be displayed where you see the interfaces “BI_OBJECT”. Test your implementation by using the “Test” button (F8). 78 © 2008 SAP AG. BIT611 Insert the just created method in the CONSTRUCTOR method. It is only the call of main application table for business scenario and should not have other code. and ENDMETHOD. someone has to test the possibilities.Attributes and Methods Exercise 3: Create Methods for Workflow Class Exercise Objectives After completing this exercise. create in the some “ExistenceCheck” and “Display” methods.. You could also copy some coding from the example implementation of class ZBIT611_MARA. Caution: If you create the following class. These extensions are implemented in ABAP Objects. To gain experience with the techniques of inserting these functions in workflow architecture. you will be able to: • Define methods with import and export parameters Business Example Your company has developed some add-ons to the standard business scenarios of the SAP ERP system. ”. given from the workflow engine. and save the method. The last part of this exercise should be the implementation of some methods with import and export parameters. Continued on next page 2008 © 2008 SAP AG. We want to create functions like those encapsulated in the BOR object type BUS1001006. 1. . Please use this possibility if you do not have enough time or you are not an experienced developer.BIT611 Lesson: Class Definition . You have the task of creating some ABAP class functions as examples for your colleagues. 79 . All rights reserved. you may see a warning like “Implementation missing for method "BI_OBJECT~RELEASE" . please go into method implementation of called function and insert a line with a space between METHOD . If so. Hint: Please be aware that you have to be an experienced developer to implement all following functions in the given exercise time.. Create an “ExistenceCheck” method to validate the key structure. . Task: To handle the basic functions of an object used in the workflow architecture. Use transaction MM02 and necessary SET/GET parameter. OPTIONAL Create a “Create” method with interface BAPI_STANDARDMATERIAL_CREATE. 7.Unit 2: ABAP Classes Definition and Implementation 2. To implement the behavior of the default method. Test your implementation by using the “Test” button (F8). This is a static function. Create a “DisplayView” method with the Import Parameter “MaterialView” to display special application data. OPTIONAL You could also test some of your developed functions in standard task. this is part of last exercise of this course. 4. it works without instance. Use transaction MM03 and the necessary SET/GET parameter. 6. All rights reserved. BIT611 Create a “Display” method to display application data with the functionality of BAPI_MATERIAL_DISPLAY. 5. insert a call of this method in BI_OBJECT~EXECUTE_DEFAULT_METHOD method. Create a “Change” method to change application data. 2008 . 3. that means. Yet. 80 © 2008 SAP AG. All rights reserved. The last part of this exercise should be the implementation of some methods with import and export parameters. insert exception “CX_BO_ERROR” in the exception list of the EXISTENCECHECK method (tab “Exceptions”).Attributes and Methods Solution 3: Create Methods for Workflow Class Task: To handle the basic functions of an object used in the workflow architecture. and ENDMETHOD. Implement the coding as shown in the following example. however it is necessary to handle a failed constructor method. If so. Please insert the information as described and wait for an explanation until chapter 3. given from the workflow engine. create in the some “ExistenceCheck” and “Display” methods. Continued on next page 2008 © 2008 SAP AG. ”. and save the method. . It is only the call of main application table for business scenario and should not have other code. please go into method implementation of called function and insert a line with a space between METHOD . 81 . b) Double-click the EXISTENCECHECK method. Exceptions are theme of chapter 3. you may see a warning like “Implementation missing for method "BI_OBJECT~RELEASE" . Create an “ExistenceCheck” method to validate the key structure.. . a) Go to the tab “Methods” and insert following entries in new line: Method: EXISTENCECHECK Level: Instance Method Visibility: Public Method type: -> no entry Description: Existence Check to verify data from workflow engine To handle the raised exceptions. Save your class (Ctrl + S). Caution: If you create the following class.BIT611 Lesson: Class Definition . 1.. To implement the behavior of the default method. CATCH cx_bo_error. 2. TRY. ENDMETHOD. ENDIF. a) Go to the tab “Methods” and insert following entries in new line: Continued on next page 82 © 2008 SAP AG. All rights reserved. ENDMETHOD. Create a “Display” method to display application data with the functionality of BAPI_MATERIAL_DISPLAY. . CALL METHOD me->existencecheck.. insert a call of this method in BI_OBJECT~EXECUTE_DEFAULT_METHOD method. METHOD existencecheck.. * assignment of import variable to key field of class matnr = im_matnr. IF sy-subrc NE 0.Unit 2: ABAP Classes Definition and Implementation BIT611 If you want to compare your coding. EXIT. SELECT SINGLE * FROM mara INTO m_mara WHERE matnr = me->matnr. 2008 . Save your class (Ctrl + S). c) Call EXISTENCECHECK method in the CONSTRUCTOR method: METHOD constructor. Save your class (Ctrl + S). ENDTRY. call the implementation of class ZBIT611_MARA. RAISE EXCEPTION TYPE cx_bo_error. BIT611 Lesson: Class Definition . 83 . call the implementation of class ZBIT611_MARA. CASE ex_return-number. Continued on next page 2008 © 2008 SAP AG.Attributes and Methods Method: DISPLAY Level: Instance Method Visibility: Public Method type: -> no entry Description: Display application data Save your class (Ctrl + S). CALL FUNCTION 'BAPI_MATERIAL_DISPLAY' EXPORTING material = matnr IMPORTING return = ex_return. b) c) Press the “Parameters” Button and insert the following properties into the first line: Parameter: EX_RETURN Type: Exporting Pass Value: -> no entry Optional: 'X' Typing Method: Type Associated Type: BAPIRET1 Default Value: -> not required Description: -> set automatically Double-click the DISPLAY method. ENDMETHOD. Implement the coding as shown in the following example. METHOD display. All rights reserved. * DUMMY ENDCASE. If you want to compare your coding. It has not to be inserted into interface of BI_OBJECT~EXECUTE_DEFAULT_METHOD. METHOD bi_object~execute_default_method.Unit 2: ABAP Classes Definition and Implementation BIT611 Save your class (Ctrl + S). d) Go to the tab “Methods” and double-click the BI_OBJECT~EXECUTE_DEFAULT_METHOD method. If you want to compare your coding. call the implementation of class ZBIT611_MARA. b) 84 Press the “Parameters” Button and insert the following properties into the first line: Continued on next page © 2008 SAP AG. 2008 . ENDMETHOD. All rights reserved. a) Go to the tab “Methods” and insert following entries in a new line: Method: DISPLAYVIEW Level: Instance Method Visibility: Public Method type: -> no entry Description: Display application data with Import Parameter MaterialView Save your class (Ctrl + S). Implement the coding as shown in the following example. The exception class cx_root handles all exceptions from method display and communicates them to the workflow engine. display( ). Use transaction MM03 and the necessary SET/GET parameter. ENDTRY. 3. Create a “DisplayView” method with the Import Parameter “MaterialView” to display special application data. Save your class (Ctrl + S) and activate it. CATCH cx_root. TRY. Save your class (Ctrl + S). 85 . SET PARAMETER ID 'MAT' FIELD matnr.Attributes and Methods c) Parameter: IM_MATERIALVIEW Type: Importing Pass Value: -> no entry Optional: 'X' Typing Method: Type Associated Type: T132T-STATM Default Value: 'K' Description: -> set automatically If you want to compare your coding.BIT611 Lesson: Class Definition . CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN. Continued on next page 2008 © 2008 SAP AG. METHOD displayview. SET PARAMETER ID 'MXX' FIELD im_materialview. All rights reserved. call the implementation of class ZBIT611_MARA. ENDMETHOD. Unit 2: ABAP Classes Definition and Implementation 4. “BI_PERSISTENT” and “IF_WORKFLOW”. a) Go to the tab “Methods” and insert following entries in a new line: Method: CHANGE Level: Instance Method Visibility: Public Method type: -> no entry Description: Change application data Save your class (Ctrl + S). Implement the coding as shown in the following example. that you can test: “EXISTENCECHECK”. “DISPLAY”. ENDMETHOD. call the implementation of class ZBIT611_MARA. it should display the above developed attributes. Also. and so on. 5. Test your implementation by using the “Test” button (F8). BIT611 Create a “Change” method to change application data. b) A screen should be displayed where you see only the “CREATE” method. All rights reserved. it should display the variety of methods. Use transaction MM02 and necessary SET/GET parameter. a) Press the “Test” button (F8). Lastly. b) Double-click the CHANGE method. CALL TRANSACTION 'MM02' AND SKIP FIRST SCREEN. Continued on next page 86 © 2008 SAP AG. If you want to compare your coding. c) Click the “Instance” button and enter the material “R-1003” in the field IM_MATNR and press the “Instance” button. d) A screen should be displayed where you see the interfaces “BI_OBJECT”. 2008 . METHOD change. SET PARAMETER ID 'MAT' FIELD matnr. Save your class (Ctrl + S). “DISPLAYVIEW”. 87 . This is a static function. METHOD create.Attributes and Methods 6. Implement the coding as shown in the following example. All rights reserved. a) Go to the tab “Methods” and insert following entries in a new line: Method: CREATE Level: Static Method Visibility: Public Method type: -> no entry Description: Create Material Save your class (Ctrl + S). that means. b) c) Press the “Parameters” button and insert the following properties into the first line: Parameter: EX_RETURN Type: Exporting Pass Value: -> no entry Optional: 'X' Typing Method: Type Associated Type: BAPIRET1 Default Value: -> not required Description: -> set automatically Double-click the CREATE method. Continued on next page 2008 © 2008 SAP AG. it works without instance. OPTIONAL Create a “Create” method with interface BAPI_STANDARDMATERIAL_CREATE. If you want to compare your coding. call the implementation of class ZBIT611_MARA. CALL FUNCTION 'BAPI_STANDARDMATERIAL_CREATE' IMPORTING material = ex_newmaterial return = ex_return.BIT611 Lesson: Class Definition . ENDMETHOD. All rights reserved. Yet. OPTIONAL You could also test some of your developed functions in standard task. Save your class (Ctrl + S). 7. b) Test the created standard tasks with transaction “SWUS”.Unit 2: ABAP Classes Definition and Implementation BIT611 CASE ex_return-number. * DUMMY ENDCASE. this is part of last exercise of this course. 88 a) Create some standard tasks with transaction “PFTC”. 2008 . © 2008 SAP AG. 89 . like values • Define multiline attributes • Describe how object references are addressed in the BOR and the workflow 2008 © 2008 SAP AG.BIT611 Lesson: Class Definition .Attributes and Methods Lesson Summary You should now be able to: • Define attributes with a database reference • Define “virtual attributes”. All rights reserved. like values • Define multiline attributes • Describe how object references are addressed in the BOR and the workflow 90 © 2008 SAP AG.Unit Summary BIT611 Unit Summary You should now be able to: • Explain the basic technical concepts of ABAP Object classes in SAP Business Workflow • Classify some important concepts of object-oriented programming • Create a class • Create instance handling required for workflow engine • Define key fields • Define attributes with a database reference • Define “virtual attributes”. All rights reserved. 2008 . ..........Unit 3 Use Classes in Workflow Architecture Unit Overview This unit shows additional concepts for controlling processes in Business Process Management like Exception Handling in class methods and Event Handling in relation to the object oriented paradigm of ABAP classes. 119 2008 © 2008 SAP AG............................. Unit Objectives After completing this unit............... 91 .. 110 Exercise 5: Create and Test Workflow Functions with ABAP Classes .....101 Lesson: Using Classes in Workflow Architecture............. you will be able to: • • • • • • Understand the exception techniques in workflow classes and their handling in the workflow engine Define events and trigger them to start processes Use API functions to affect workflow functions based on classes Define and start single-step tasks and multistep tasks Explain and define bindings within a multistep task Use class components in workflow architecture Unit Contents Lesson: Exceptions... All rights reserved........... 92 Exercise 4: Create Exception and Event Handling for Classes ........... Events and API Functions .................................. It shows the consequences of these techniques for the process flow and gives you hints about the most important aspects you have to know in building workflow with ABAP classes..... An exception is triggered directly for all error types (temporary. Lesson Objectives After completing this lesson. object is locked) and application exceptions that report “permanent” errors. we discuss the class “Exception Handling”. Depending on the kind of exception. the engine can distinguish between temporary exceptions (for example. 2008 . Events and API Functions Lesson Overview There are some additional techniques to control processes in the workflow engine. it is also possible to create own exception classes by subclassing the class-based workflow exceptions (for example CX_BO_TEMPORARY). application or system errors). the system behaves differently: • • For BOR-Object types. the different types of exception are based on either the exception class hierarchy or on naming conventions.Unit 3: Use Classes in Workflow Architecture BIT611 Lesson: Exceptions. you will be able to: • • • Understand the exception techniques in workflow classes and their handling in the workflow engine Define events and trigger them to start processes Use API functions to affect workflow functions based on classes Business Example You have to implement some additional techniques in your material master process to control its flow. All rights reserved. In general. “Event Handling” with ABAP classes and the technique to set container values with new programming API. using the method exceptions in the class builder and entering the “RAISE EXCEPTION TYPE” statement. To define customer based exceptions. In this lesson. the type of exception (temporary or application exception) can be defined using the Business Object Builder For ABAP classes. The workflow engine is able to handle these exceptions. the “Events” in classes and the necessary areas to use class API functions. To do this. Exceptions in Methods Methods might also have exceptions that report errors to the caller. 92 © 2008 SAP AG. you have to understand the “Exception Handling”. Background Steps Background steps also allow you to model a repeat counter for a temporary error. 2008 © 2008 SAP AG. as application errors.BIT611 Lesson: Exceptions. Events and API Functions Figure 30: Reaction to Exception . the workflow assumes an error status for application errors and system errors. If a subsequent step is modeled in the workflow definition for this exception. If no subsequent step is modeled. 93 . and for temporary errors. this step is executed. All rights reserved. exceptions are defined as temporary exceptions. Figure 31: Reaction to Exception .Dialog Steps In the object method. or as system errors. the workflow remains in the status “in process”. Figure 32: Handle Exceptions from ABAP Classes Class-Based Exceptions Class-based exceptions can be used for methods. At runtime. you can use the exception class CX_BO_TEMPORARY and its subclasses. you can use CX_BO_ACTION_CANCELLED (subclass of CX_BO_TEMPORARY) to raise this specific exception. it might be useful to raise an exception if the user cancels the dialog (as a temporary exception). for the number of times specified in the definition. For dialog methods. the step is automatically repeated. All exceptions of this class and the subclasses are handled as temporary exceptions. 2008 . The repetition is implemented by a background job (SWWERRE). Therefore. whenever a temporary error occurs. The background job must be scheduled to allow the repetition to be carried out if temporary errors occur. The step switches permanently to either “error” or “completed” status (followed by the modeled subsequent step) only when this number of repetitions is complete. it is also possible to create your own exception classes for temporary exceptions by subclassing CX_BO_TEMPORARY. All rights reserved. Non Class-Based Exceptions 94 © 2008 SAP AG. To raise temporary exceptions. In this case.Unit 3: Use Classes in Workflow Architecture BIT611 If this repeat counter is modeled. the workflow engine will catch the thrown exceptions and treat them as application exceptions. For dialog methods it might be useful to raise an exception if the user cancels the dialog (as a temporary exception). The sender and receiver of the event do not need to reside on the same logical system. Figure 33: Basic logic to trigger Events ABAP classes can also define events that are used to communicate between ABAP objects residing in the same context (roll area). 95 .. The events are handled asynchronously and the receivers are started in their own LUW (Logical Unit of Work). These events are triggered by calling the Event Manager API.. Like above. these exceptions will be handled as application exceptions. In this case. are completely different. <ei> = <f i> . These exceptions will also be caught by the engine. the name of an exception has to start with TMP or TEMP. you can use TMP_EXIT_CANCELLED or TEMP_EXIT_CANCELLED to raise this specific exception. All rights reserved. These events. that should be started or steps within a process that should be completed). processes.. Events and API Functions Non class-based exceptions could also be used for methods. which are triggered using built-in ABAP statements. Handling Events The workflow engine makes use of an event manager that handles events and calls the corresponding receivers (for example. this has no significance for the event manager: RAISE EVENT <evt> EXPORTING. To raise temporary exceptions.. and the previously mentioned events handled by the event manager.BIT611 Lesson: Exceptions. 2008 © 2008 SAP AG. If an event is triggered by the following ABAP objects command. 2008 . complex types) BOR object references or references to ABAP classes that implement the interface IF_WORKFLOW The following sections describe how events can be triggered via the workflow event manager API. To achieve this. All rights reserved. public events that are defined at a class could also be used to trigger events for the workflow engine.begin of local data DATA: l_event_parameters TYPE REF TO if_swf_ifs_parameter_container. restrictions concerning data types apply: • • • event parameters are restricted to simple types (for example. thus dispatching a local ABAP event to a workflow event.begin of local data 96 © 2008 SAP AG. It is also possible to use event parameters to pass values to possible event handlers. Triggering Events Via Static Methods *. because the workflow event manager uses RFC to dispatch its events. the corresponding value for the event parameter is set. tables. This section describes how static methods could be used to trigger an event. Since the handlers will be started in their own LUW using a tRFC. structures. integer. However. string. and so on) any possible ABAP dictionary types (for example. an event handler in an ABAP program code would have to make explicit calls to the workflow system’s event manger through its API. a COMMIT WORK is always required to actually start the receivers.Unit 3: Use Classes in Workflow Architecture BIT611 Figure 34: Event Handling in Classes Nevertheless. Before the event is triggered. *. The handling of event parameters is optional. 97 . “the value *--.start the receivers (tRFC) COMMIT WORK.get the event container that is used to transport the event parameters CALL METHOD cl_swf_evt_event=>get_event_container EXPORTING im_objcateg = ‘CL‘ “category for classes im_objtype = ‘CL_DEMO_CLASS‘ “the classname im_event = ‘CHANGED‘ “event that will be triggerd RECEIVING re_reference = l_event_parameters.BIT611 Lesson: Exceptions.-key (instid) im_event_container = l_event_parameters. This section gives an example of how to raise the same event using instance methods. *--. CATCH cx_swf_evt_exception. The example also shows the mechanism for passing event parameters. The following event definition is used to show the mechanism of dispatching an ABAP event to a workflow event manger event.raise the event CALL METHOD cl_swf_evt_event=>raise EXPORTING im_objcateg = ‘CL‘ “category for classes im_objtype = ‘CL_DEMO_CLASS‘ “the classname im_event = ‘CHANGED‘ “the event name im_objkey = ‘…‘ “the obj. There is no difference between these possibilities. Events and API Functions TRY. while raising the event CATCH cx_swf_cnt_container.set the values of the parameters CALL METHOD l_event_parameters->set EXPORTING name = ‘USER‘ “the name of the event parameter value = sy-uname. Raising an event without COMMIT WORK will not start any receiver. *--. the COMMIT WORK of the running transaction can (and should) be used. If the event is triggered within a transaction. “the event params *--. It is up to the user weather to use static or instance methods. “except. while setting event params ENDTRY. Trigger Events Using Instance Methods 2008 © 2008 SAP AG. “except. All rights reserved. *--.get the event container to set the parameters l_event_parameters = l_event->get_event_container( ).Unit 3: Use Classes in Workflow Architecture BIT611 *. DATA: l_event TYPE REF TO if_swf_evt_event. *--. CATCH cx_swf_evt_exception. *--. 98 © 2008 SAP AG. “the value *--. All rights reserved. “exception while setting event params ENDTRY.raise the event CALL METHOD l_event->raise.set the values of the parameters CALL METHOD l_event_parameters->set EXPORTING name = ‘USER‘ “the name of the event parameter value = sy-uname.begin of local data DATA: l_event_parameters TYPE REF TO if_swf_ifs_parameter_container.get an event object CALL METHOD cl_swf_evt_event=>get_instance EXPORTING im_objcateg = ‘CL‘ “category for classes im_objtype = ‘CL_DEMO_CLASS‘ “the classname im_event = ‘CHANGED‘ “event that will be triggerd im_objkey = ‘…‘ “the object-key (instid) RECEIVING re_event = l_event.start the receivers (tRFC) COMMIT WORK. *. 2008 . “exception while raising the event CATCH cx_swf_cnt_container.end of local data TRY. *--. • Interface IF_SWF_IFS_PARAMETER_CONTAINER To set the event parameters. it is still used when programming BOR methods) but some APIs already use the above interface and more of them will follow. use the IF_SWF_IFS_PARAMETER_CONTAINER interface. Therefore. To do this. a new.. Use the TRY . ABAP Objects based programming model has been developed. To overcome the limitations of the old container implementation. the container is represented as an ABAP Object reference of type IF_SWF_IFS_PARAMETER_CONTAINER. call the method for creating an event in the same logical unit of work (LUW) that the status change is made in. Use the SET method of this interface to set the relevant parameters. 99 . • Class CL_SWF_EVT_EVENT The ABAP class CL_SWF_EVT_EVENT has two methods. Events and API Functions Note that events say something about object status changes that have actually occurred. Parameter Container Interface Programming with containers always meant manipulating internal tables of structure SWCONT using container macros. IF_SWF_IFS_PARAMETER_CONTAINER contains the following methods: 2008 © 2008 SAP AG.. In this new programming model. All rights reserved.BIT611 Lesson: Exceptions. RAISE and RAISE_IN_UPDATE_TASK. ENDTRY instruction to catch the exceptions cx_swf_evt_execption (error in event creation) and cx_swf_cnt_container (error in setting a parameter). SWCONT has not disappeared everywhere (for example. which behave in the same way as the function modules SWE_EVENT_CREATE and SWE_EVENT_CREATE_FOR_UPD_TASK. ensure that the event is not created until the relevant status change has taken place. See the new interface implementation in some programming examples: • • • FB sww_wi_create_via_event_ibf (receiver function module for standard wf) FB swb_2_check_fb_start_cond_eval (check function module) FB swe_event_create (function module to generate an event) Figure 36: Examples for Using New Interface 100 © 2008 SAP AG. and so on.Unit 3: Use Classes in Workflow Architecture BIT611 Figure 35: Parameter Container Interface The new container interface could used in. 2008 . as example. triggering events in customer specific programming. All rights reserved. to develop BOR methods. check function modules. You could also copy some coding from the example implementation of class ZBIT611_MARA. The return codes of BAPI_MATERIAL_DISPLAY in the method Display should be handled from workflow engine. 2. We want to create functions like those encapsulated in the BOR object type BUS1001006. when business content is created or changed. Task: To handle the basic functions of an object used in workflow architecture. These extensions are implemented in ABAP Objects. Continued on next page 2008 © 2008 SAP AG. All rights reserved. There should also be some workflow events triggered. Events and API Functions Exercise 4: Create Exception and Event Handling for Classes Exercise Objectives After completing this exercise. Please use this possibility if you do not have enough time or you are not an experienced developer. OPTIONAL The return codes of BAPI_STANDARDMATERIAL_CREATE in the method Create should be handled from the workflow engine.BIT611 Lesson: Exceptions. you have created some methods in the last exercise. someone has to test the possibilities. You have the task of creating some ABAP class functions as examples for your colleagues. Hint: Please be aware that you have to be an experienced developer to implement all following functions in the given exercise time. it has to be implemented an exception handling in the previously developed methods. To gain experience with the techniques of inserting these functions in workflow architecture. 1. you will be able to: • Define exception and event handling for classes Business Example Your company has developed some add-ons to the standard business scenarios of the SAP ERP system. 101 . 3. To check some important function results. Please realize the exception handling of ExistenceCheck and Constructor method implemented in the previous exercises. create two additional events. 6. 5. 2008 . OPTIONAL To make the creation of a new material public. one for the change of field Basic Material and one for the change of field Old Material. All rights reserved. © 2008 SAP AG.Unit 3: Use Classes in Workflow Architecture BIT611 4. 102 Test your implementation by using the “Test” button (F8). you have to implement a triggering event “CREATED” in the Create method. To define customer specific time points for the process. It should be include a parameter “User”. WHEN '000'. if no business object is available to the given key. 103 . b) Double-click the DISPLAY method. All rights reserved. call the implementation of class ZBIT611_MARA. If you want to compare your coding. Implement the coding as shown in the following example. 1. insert exceptions “CX_BO_ERROR” and “CX_BO_ACTION_CANCELLED” in the exceptions list of the method (tab “Exceptions”).BIT611 Lesson: Exceptions. CASE ex_return-number. The return codes of BAPI_MATERIAL_DISPLAY in the method Display should be handled from workflow engine. Continued on next page 2008 © 2008 SAP AG. * material is displayed WHEN '262'. Save your class (Ctrl + S). METHOD display. a) These implemented exceptions handle the general behavior of class in workflow context.. you have created some methods in the last exercise. To check some important function results. If you want to compare your coding. 2. it has to be implemented an exception handling in the previously developed methods. a) To handle the raised exceptions. call the implementation of class ZBIT611_MARA.. . when business content is created or changed. There should also be some workflow events triggered. Events and API Functions Solution 4: Create Exception and Event Handling for Classes Task: To handle the basic functions of an object used in workflow architecture. Please realize the exception handling of ExistenceCheck and Constructor method implemented in the previous exercises. RAISE EXCEPTION TYPE cx_bo_error EXPORTING textid = 'Material not existing. 2008 . Save your class (Ctrl + S). RAISE EXCEPTION TYPE cx_bo_error EXPORTING textid = 'Other Error'.'. OPTIONAL Continued on next page 104 © 2008 SAP AG.'. ENDMETHOD. Save your class (Ctrl + S) and activate it. ENDCASE. WHEN OTHERS. All rights reserved. WHEN '305'.Unit 3: Use Classes in Workflow Architecture BIT611 RAISE EXCEPTION TYPE cx_bo_error EXPORTING textid = 'No materialnumber transfered. c) 3. Save your class (Ctrl + S). All rights reserved. METHOD create. WHEN '000'. CASE ex_return-number. call the implementation of class ZBIT611_MARA. Implement the coding as shown in the following example. WHEN '355'. Save your class (Ctrl + S). RAISE EXCEPTION TYPE cx_bo_action_cancelled EXPORTING textid = 'No material has been created. . RAISE EXCEPTION TYPE cx_bo_error EXPORTING textid = 'other'. b) Double-click the CREATE method. a) To handle the raised exceptions..BIT611 Lesson: Exceptions. * material is created WHEN OTHERS. Events and API Functions The return codes of BAPI_STANDARDMATERIAL_CREATE in the method Create should be handled from the workflow engine. 105 . If you want to compare your coding. when '356'. Continued on next page 2008 © 2008 SAP AG.'. ENDMETHOD.. insert exceptions “CX_BO_ERROR” and “CX_BO_ACTION_CANCELLED” in the exceptions list of the method (tab “Exceptions”). ENDCASE. OPTIONAL To make the creation of a new material public. a) Go to tab “Events” and insert the following entry: Event CREATED Type Instance Visibility Public Description Material Master created Define a parameter “User” for the CREATED event. a) Go to the tab “Events” and insert the following entries: Event BASICMATERIALCHANGED Type Instance Visibility Public Description Field basic material changed Event OLDMATERIALCHANGED Type Instance Visibility Public Description Field old material changed Save your class (Ctrl + S). you have to implement a triggering event “CREATED” in the Create method.Unit 3: Use Classes in Workflow Architecture 4. BIT611 To define customer specific time points for the process. 5. create two additional events. Mark the created entry and use the “Parameters” button to insert the following properties: Continued on next page 106 © 2008 SAP AG. 2008 . All rights reserved. It should be include a parameter “User”. one for the change of field Basic Material and one for the change of field Old Material. If you want to compare your coding.. WHEN '365'..BIT611 Lesson: Exceptions..get the event container that is used to transport the event parameters CALL METHOD cl_swf_evt_event=>get_event_container EXPORTING im_objcateg = 'CL' im_objtype = 'ZBIT611_. b) Double-click the CREATE method. Events and API Functions Parameter USER Optional -> no entry Typing Type Associated Type SY-UNAME Default Value -> no entry Description -> set automatically Save your class (Ctrl + S).end of local data . Continued on next page 2008 © 2008 SAP AG.begin of local data DATA: l_event_parameters TYPE REF TO if_swf_ifs_parameter_container. METHOD create. TRY. Implement the coding as shown in the following example. 107 . *.' im_event = 'CREATED' RECEIVING re_reference = l_event_parameters. CASE ex_return-number. call the implementation of class ZBIT611_MARA.. *... *--. All rights reserved. . b) A screen should be displayed where you see only the “CREATE” method. 108 Test your implementation by using the “Test” button (F8). © 2008 SAP AG. 6. All rights reserved.raise the event CALL METHOD cl_swf_evt_event=>raise EXPORTING im_objcateg = 'CL' im_objtype = 'ZBIT611_. d) To check exception handling.start the receivers (tRFC) COMMIT WORK.set the values of the parameters CALL METHOD l_event_parameters->set EXPORTING name = 'USER' value = sy-uname.. ENDCASE.' im_event = 'CREATED' im_objkey = ex_newmaterial im_event_container = l_event_parameters.Unit 3: Use Classes in Workflow Architecture BIT611 *--. CATCH cx_swf_cnt_container. *--.. a) Press the “Test” Button (F8). . *--. c) Create a new material and check the event triggering in transaction SWEL. CATCH cx_swf_evt_exception... If you abort the creation of material with the yellow “Exit” button (or press Schift + F3). 2008 . ENDTRY. Save your class (Ctrl + S). call the CREATE method of your class and check the reaction of system. the CX_BO_ACTION_CANCELLED exception should be raised. ENDMETHOD. 109 .BIT611 Lesson: Exceptions. Events and API Functions Lesson Summary You should now be able to: • Understand the exception techniques in workflow classes and their handling in the workflow engine • Define events and trigger them to start processes • Use API functions to affect workflow functions based on classes 2008 © 2008 SAP AG. All rights reserved. 2008 . To do this.Unit 3: Use Classes in Workflow Architecture BIT611 Lesson: Using Classes in Workflow Architecture Lesson Overview This lesson explains the concept behind calling synchronous and asynchronous methods in tasks. Definition of Standard Tasks Figure 37: Single-Step Tasks 110 © 2008 SAP AG. you will be able to: • • • Define and start single-step tasks and multistep tasks Explain and define bindings within a multistep task Use class components in workflow architecture Business Example You want to use the methods and attributes of your new class definition in a workflow. This includes saving binding specifications. All rights reserved. so that you can work correctly with the required objects in the individual business process steps at runtime. Lesson Objectives After completing this lesson. It also describes how tasks can be started and integrated into workflows. you need to define tasks. BIT611 Lesson: Using Classes in Workflow Architecture The default rule is evaluated if the task is used either outside a workflow. the synchronous part of the method is processed and ends without returning any export parameters. after it has been processed. reports back to the caller. • Asynchronous: The method is called. or in a step definition without an agent assignment. it takes over the process control and. The asynchronous part (update) runs without any connection to the caller and must report back to the caller with an event. All rights reserved. The following texts can be defined: • • • • • • Work item text (workflow inbox in Business Workplace) Task description (work item preview in Business Workplace) Completion text Latest end text Latest start text Requested end text Calling Synchronous and Asynchronous Methods • Single-step task referring to a synchronous method • – Single-step task is terminated when the method reports back to caller – Binding between task container and method container in both directions Single-step task referring to asynchronous method – – – Method started by workflow system Report back by terminating event Single-step task is terminated when terminating event occurs Communication between single-step task and object method: • Synchronous: The method is called. 2008 © 2008 SAP AG. 111 . Secondary methods are for display only. 112 © 2008 SAP AG. in a new external session) Reports back to the workflow are made only from the task method. either when it has been successfully executed or when the terminating event has been received.Unit 3: Use Classes in Workflow Architecture BIT611 Please repeat the following notes about synchronous/asynchronous calling of workflow steps: • • • • The task method is always called synchronously (that is. All rights reserved. in the same session as the calling program) Previous methods and subsequent methods are always called synchronously Secondary methods are always called asynchronously (that is. An explicit confirmation can be modeled in the step definition for both synchronous and asynchronous tasks. the terminating event cannot be triggered within the associated object method. using the system menu Usually. The task is then terminated. tasks are started automatically through the step definition when a workflow is processed. Options for Starting Tasks • • • • • Automatically through the workflow system when you reach a step within a multistep task Directly using the workflow development environment Program-driven through the API of the work item manager Using a triggering event Directly. In this case. 2008 . Synchronous tasks can also have terminating events. copying or deleting on individual steps (for example. 113 . 2008 © 2008 SAP AG. for example) that depends on this step.BIT611 Lesson: Using Classes in Workflow Architecture Workflow Definition Steps Figure 38: Workflow Definition Steps All block-oriented modeling constructs such as branches and loops are available. the “loop” step type) always affect the entire block (the entire loop contents. The steps can be arranged in sequence or parallel. All rights reserved. Operations such as. Each step is a determining component of its own block. The modeling interface (“Workflow Builder”) contains the relevant graphical operators for handling blocks. Unit 3: Use Classes in Workflow Architecture BIT611 Container and Binding Definition Figure 39: Using the Workflow Container The workflow container stores the data available throughout the process. It is used to perform the following tasks: • Specify the import and export parameters for the entire workflow (elements with the property “Import” or “Export”) Exchange data between individual steps • (1) When the workflow is started, data from a triggering event is transferred to the workflow container as input parameters. (2) In a container operation, data in the workflow container can be changed by an allocation or a calculation. (3) The expressions in a condition refer to data belonging to the workflow container. (4) In a wait step, data is read from the workflow container (for example, to create the instance linkage for the event being received), whereas the event parameters are written to the workflow container with a binding. (5)+(6) Data from the workflow container is read in an activity (binding for the task) and written (the output parameters of the task are transferred to the workflow container with binding). In addition, data is read from the workflow container to resolve the rule used in the step for agent determination and determine any dates (6) defined on the step (such as the deadline) with an expression. 114 © 2008 SAP AG. All rights reserved. 2008 BIT611 Lesson: Using Classes in Workflow Architecture Figure 40: Binding in Workflow Execution (1)(11) The event container is filled when the event is created using the container macro (that is, before the event is triggered). (2) Binding from the triggering event to the workflow. This binding is absolutely essential; usually, the reference of the triggering object and the user name (or “event initiator”) are transferred to the workflow container. (3) (8) Binding from the workflow container to the rule: This sets the input parameters for the rule if one is defined for agent determination in the step. If there is a default rule in the task definition, the parameters are supplied from the work item container. (4) Binding between the workflow container and task container (work (7) (9) item container) for setting the input parameters (during the call) and (13) reading the output parameters of the task (once the task is completed). The Workflow Builder generates a proposal for this binding in the step definition. (5) (6) Binding between the task and the method container. There is a (10) binding for synchronous tasks in import (5) and export (6) direction. (12) In asynchronous tasks, the import binding is directly defined (10), whereas the return binding is defined during the terminating event (12). The runtime system copies the entire container if no binding is defined between the task and method. 2008 © 2008 SAP AG. All rights reserved. 115 Unit 3: Use Classes in Workflow Architecture BIT611 Components of Class in Workflow Architecture Figure 41: Using ABAP Objects in Workflow I Figure 42: Using ABAP Objects in Workflow II 116 © 2008 SAP AG. All rights reserved. 2008 All rights reserved.BIT611 Lesson: Using Classes in Workflow Architecture Figure 43: Using ABAP Objects in Workflow III 2008 © 2008 SAP AG. 117 . Unit 3: Use Classes in Workflow Architecture 118 © 2008 SAP AG. All rights reserved. BIT611 2008 . 3. Section object methods: Object category: CL ABAP class Enter the class ZBIT611_## and the method required in the exercise. Call transaction PFTS and choose Create. 119 . Hint: It is a prerequisite for the course that participants know how to create and maintain tasks. you will be able to: • Create standard tasks with ABAP classes • Create process flows with ABAP classes Business Example You have either found or created all the classes that you want to use in your business process with the associated attributes and methods in the Class Builder. Input data on the basic screen: ID: As specified in the exercise Name: As appropriate for the required task Work item text: As specified in the exercise Enter the material number in the text using the “Insert variables” button underneath the text. transfer elements that are not available from the object method. The solution therefore only refers to created sample tasks. you want to create single-step tasks based on the object methods. Press Enter to confirm. 1. The following pages give a brief description of how to avoid problems when creating and maintaining tasks. Now. All tasks are based on the class ZBIT611_##. When prompted. 2. All rights reserved. Create a Standard Task.BIT611 Lesson: Using Classes in Workflow Architecture Exercise 5: Create and Test Workflow Functions with ABAP Classes Exercise Objectives After completing this exercise. Enter the task description: Description tab page 2008 © 2008 SAP AG. which you can use later in your workflow definition. Enter the possible agents: Possible agents are the users who are authorized to carry out the task in a business context. 7. 9. enter the following: TSxxxxxxxx Transfer test data: Click on the line containing the expression _WI_OBJECT_ID An input line opens on the bottom edge of the screen. Display the instance data 120 © 2008 SAP AG. 2008 . Enter a terminating event: Terminating Events tab page Entry in the ELEMENT field: Using the F4 help. Test a task Call transaction SWUS. Enter a default value for the input parameter MaterialView/Maintenancestatus On the basic screen for the task: Container tab page Double click on the line containing MaterialView/Maintenancestatus Initial Value tab page Enter the value K for the Basic Data 1 view. select the terminating event. Maintenance: On the Task maintenance basic screen. Again. All rights reserved. choose the menu path: Additional Data -> Maintain Agent Assignment. Enter texts for missed deadlines/completion: Description tab page Text type: Required texts (latest end text/completion text) Text: As specified in the exercise 6. Select the task ID and choose the Properties button.Unit 3: Use Classes in Workflow Architecture BIT611 Task description text type Choose the Change button Text: As specified in the exercise Enter the material number by choosing the menu option Include . Then select General Task. using the F4 help. 5. select the element _WI_OBJECT_ID.Expression 4. Use the F4 help to select the material that you want to test. Under Task. 8. Display the material number with view. Create the task ZCL##MatDisV with the method DisplayView. Select the required work item and choose the Display icon. In addition to the material number.BIT611 Lesson: Using Classes in Workflow Architecture Call the Workplace (transaction SBWP or Office . 121 . Choose Goto -> Technical Work Item Display Choose Extras -> Instance Linkage 10.Workplace) Open the Inbox folder Click on the Workflow folder. 1. you can view the number of the work item that was terminated by the event. Use the following texts: Continued on next page 2008 © 2008 SAP AG. Enter a work item text. In the detailed data (double-click on Event). Specify a work item text. Define the view K (corresponds to the Basic data 1 view) as default value for parameter “IM_MATERIALVIEW” to control the view initially called for the material. All rights reserved. Task 2: Create a new standard task for changing a material master. 1. Define the task as a general task. also issue the number and name of a plant for this material in all texts. Task 1: Create a new standard task for displaying a material master from a predetermined view. 2. Display the material number in the work item text. Create the ZCL##Change task with the Change method. Test the task by starting it in the workflow development environment (transaction SWUS). a text for latest end and a text for completion. Define the task as a general task. Display the event trace Call transaction SWEL Enter your object type ZBIT611_## Choose Execute The triggered terminating event is displayed. Text:Display Material < Material number from object>. Test the task by starting it in the workflow development environment using transaction SWUS. Test the task by starting it in the workflow development environment using transaction SWUS. Continued on next page 122 © 2008 SAP AG. Integrate the standard tasks as specified in the exercise. The following pages give a brief description of how to avoid problems when creating and maintaining tasks. 3. 2. 1. Task 3: Create a new standard task for creating a material master. 2008 . Hint: It is a prerequisite for the course that participants know how to create and maintain a task. All rights reserved. the event does not require a binding definition. Use the event BasicMaterialChanged. Create the workflow as a local object. Select the undetermined step in the Workflow Builder. you must define at least one terminating event. 2. Enter the following text as the work item text and description: Create a material master record. Choose the Create step icon. In this case. Define the task as a general task. The solution therefore only refers to created sample tasks. As this task is asynchronous. Creating a Workflow: Call transaction SWDD Choose the Save button. Task 4: Define a workflow with a triggering event.Unit 3: Use Classes in Workflow Architecture BIT611 Text: Change material <Material number from object> 2. Create the ZCL##Create task with the Create method. Enter the required workflow ID. 1. The description follows the tasks. Workflow definition. Incorporate the single-step task ZCL##Change into your workflow definition. (Event linkage active/inactive) 7. Link a triggering event On the Workflow Builder basic screen: Click on the Workflow Container tab page (on the left of the screen). Continued on next page 2008 © 2008 SAP AG. Select the Workflow initiator expression.click the Test icon. All rights reserved. Select the responsible agents from the possible agents: Section Agents. Create a workflow template called ZCL##MSIPROC1 for creating and displaying a material master. Double-click reference variables for your material on the Properties tab page.. choose: Goto → Basic Data. 3. 1. 123 . Define recipients for notification of completion: Notification tab page.BIT611 Lesson: Using Classes in Workflow Architecture Click on the step type Activity. On the basic screen of the Workflow Builder. Define a missed deadline Latest End tab page. Activate the event linkage by clicking on the button under A. Testing the workflow On the Workflow Builder basic screen . Select the Import indicator. Enter your task. 5.. Remember to maintain the test data. 4. The workflow automatically switches to the test transaction SWUS. Reference time: Generate work item Action: Send text Recipient: Select the Workflow initiator expression. 6. 2. Choose Users followed by the required users. tab page Start Events Enter your object type and select the event. 4. © 2008 SAP AG. Check. Define another input parameter MaterialView for your workflow. All rights reserved.Unit 3: Use Classes in Workflow Architecture 124 BIT611 3. 2008 . Add the single-step task ZCL##MatDisV to your workflow definition after the ZCL##Change step. save. and activate your workflow definition. Test your workflow with your material by starting it from the workflow development environment. Define OldMaterialChanged as the triggering event for your workflow. 5. This parameter is used to control the view in the display step of the process. Implement the binding between the triggering event and the workflow and activate the event linkage. Assign the value of the MaterialView parameter from the workflow container to the step parameter for controlling the display view. 6. Define view “K” as the default for this parameter. 2. Continued on next page 2008 © 2008 SAP AG. 1. see general description. 1. Define the view K (corresponds to the Basic data 1 view) as default value for parameter “IM_MATERIALVIEW” to control the view initially called for the material. Use the following texts: Text: Change material <Material number from object> a) Refer to the following task definition as a solution: TS99700175 . see general description. Task 2: Create a new standard task for changing a material master. In addition to the material number. 125 . Display the material number with view. Enter a work item text. Define the task as a general task. All rights reserved.ZCL00MatDisV Use the following path to display the task (starting from SAP Easy Access): Tools→ Business Workflow→ Development→ Definition Tools→ Tasks/Task Groups→ Create. Specify a work item text. For further details see general description. also issue the number and name of a plant for this material in all texts.BIT611 Lesson: Using Classes in Workflow Architecture Solution 5: Create and Test Workflow Functions with ABAP Classes Task 1: Create a new standard task for displaying a material master from a predetermined view. Create the task ZCL##MatDisV with the method DisplayView. a text for latest end and a text for completion. a) For further details. Display the material number in the work item text. Text:Display Material < Material number from object>. Test the task by starting it in the workflow development environment (transaction SWUS). Define the task as a general task.ZCL00Change For further details. a) Refer to the following task definition as a solution: TS99700174 . Create the ZCL##Change task with the Change method. a) Refer to the following task definition as a solution: TS99700176 . a) For further details see general description. Task 3: Create a new standard task for creating a material master. The solution therefore only refers to created sample tasks. In this case. you must define at least one terminating event. a) For further details. Creating a Workflow: Call transaction SWDD Choose the Save button. Enter the terminating event in the task definition. Workflow definition. Test the task by starting it in the workflow development environment using transaction SWUS. Task 4: Define a workflow with a triggering event. the event does not require a binding definition. 2. 1. Create the ZCL##Create task with the Create method. see general description. The description follows the tasks.ZCL00Create For further details. All rights reserved. Test the task by starting it in the workflow development environment using transaction SWUS. see general description. The following pages give a brief description of how to avoid problems when creating and maintaining tasks. a) 3.Unit 3: Use Classes in Workflow Architecture 2. Define the task as a general task. 2008 . BIT611 As this task is asynchronous. Use the event BasicMaterialChanged. Continued on next page 126 © 2008 SAP AG. Enter the following text as the work item text and description: Create a material master record. Hint: It is a prerequisite for the course that participants know how to create and maintain a task. 1. 6. Testing the workflow On the Workflow Builder basic screen ..BIT611 Lesson: Using Classes in Workflow Architecture Enter the required workflow ID. Select the Import indicator. The workflow automatically switches to the test transaction SWUS. All rights reserved. 3. Continued on next page 2008 © 2008 SAP AG. Activate the event linkage by clicking on the button under A. Choose the Create step icon. Define recipients for notification of completion: Notification tab page. choose: Goto → Basic Data. Integrate the standard tasks as specified in the exercise. Double-click reference variables for your material on the Properties tab page. Select the Workflow initiator expression. Reference time: Generate work item Action: Send text Recipient: Select the Workflow initiator expression. tab page Start Events Enter your object type and select the event. Create the workflow as a local object. Define a missed deadline Latest End tab page. Enter your task.. Select the undetermined step in the Workflow Builder. On the basic screen of the Workflow Builder. 127 . 2. 4.click the Test icon. (Event linkage active/inactive) 7. Click on the step type Activity. Link a triggering event On the Workflow Builder basic screen: Click on the Workflow Container tab page (on the left of the screen). 5. Select the responsible agents from the possible agents: Section Agents. Choose Users followed by the required users. ZCL00MSIPROC Path (starting from SAP Easy Access):Tools→ Business Workflow→ Development→ Definition Tools→ Workflow Builder→ Create 2. Incorporate the single-step task ZCL##Change into your workflow definition. 2008 . a) 128 see task 4-1a) Define another input parameter MaterialView for your workflow. This parameter is used to control the view in the display step of the process. a) 6. a) 3. see task 4-1a) see task 4-1a) © 2008 SAP AG. a) 5. Test your workflow with your material by starting it from the workflow development environment. Define OldMaterialChanged as the triggering event for your workflow. see task 4-1a) Add the single-step task ZCL##MatDisV to your workflow definition after the ZCL##Change step. see task 4-1a) Check. a) Define a workflow with a triggering event. All rights reserved. a) 4. Create a workflow template called ZCL##MSIPROC1 for creating and displaying a material master. 1. Define view “K” as the default for this parameter. save. WS99700306 .Unit 3: Use Classes in Workflow Architecture BIT611 Remember to maintain the test data. and activate your workflow definition. Assign the value of the MaterialView parameter from the workflow container to the step parameter for controlling the display view. Implement the binding between the triggering event and the workflow and activate the event linkage. All rights reserved. 129 .BIT611 Lesson: Using Classes in Workflow Architecture Lesson Summary You should now be able to: • Define and start single-step tasks and multistep tasks • Explain and define bindings within a multistep task • Use class components in workflow architecture 2008 © 2008 SAP AG. 2008 .Unit Summary BIT611 Unit Summary You should now be able to: • Understand the exception techniques in workflow classes and their handling in the workflow engine • Define events and trigger them to start processes • Use API functions to affect workflow functions based on classes • Define and start single-step tasks and multistep tasks • Explain and define bindings within a multistep task • Use class components in workflow architecture 130 © 2008 SAP AG. All rights reserved. and so on) Related Information • • • 2008 Use information in SAP Help Portal Use information in release notes Use information in Service Marketplace and Notes © 2008 SAP AG. receiver type.BIT611 Course Summary Course Summary You should now be able to: • • • Identify all points in the workflow system at which programming is possible or necessary Create your own classes and use them in the workflow architecture Use “Container Parameter Interface” as the new application programming interface (API) for workflow related functions (check. 131 . All rights reserved. All rights reserved.Course Summary 132 BIT611 © 2008 SAP AG. 2008 . If you have any corrections or suggestions for improvement.Feedback SAP AG has made every effort in the preparation of this course to ensure the accuracy and completeness of the materials. 2008 © 2008 SAP AG. All rights reserved. please record them in the appropriate place in the course evaluation. 133 .
Copyright © 2024 DOKUMEN.SITE Inc.