Você está na página 1de 10

Welcome, Guest Login Register Getting Started Newsletters Store

Products Services & Support About SCN Downloads Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation

Business Object Delegation


Added by Mamta Verma, last edited by Alon Mizrahi on Nov 02, 2011
Business Object Delegation Applies To: Learners in w orkflow s, Business Object. Summary This document w ill help people to understand business object delegation w hich can be further used in w orkflow s It w ill give a brief idea of w hat is Business Object, its components, properties. And how to delegate a business object and w hat is delegation and w hy w e delegate a std. business object. Author : Mamta Verma, Softw are Engineer, ES-SAP. Com pany: Infosys Technologies Ltd Created on: 6th DEC, 2008

Table of contents 1. Business Object Type - An Introduction.3 2. Role of Business Object types3 3. Business Object Properties3 4. Components of a Business Object4 5. Business Object Statutes5 6. Delegating a Business Object6 7. References13

1.

Business Object Type - An Introduction

Business Object Repository is an object oriented approach used to model Business Objects and processes. It is a collection of Business Object types and Interface types and also their components like attributes, methods and events. Business Object type is a representation of any business entity in an SAP system. Example of entity could be an employee, purchase order, etc. A BO type includes both the data of the entity and the functions it performs. Data is stored in form of BO attributes and functions in form of BO methods. Thus w e can understand BO as an object oriented approach to model business entities and processes.

2.
a. b. c. d. e.

Role of Business Object types


BO reduces the complexity of the SAP system by dividing it into smaller units. At BO level, non-SAP systems can communicate w ith SAP system. This can be done using BAPIs. BO enables various business components to communicate w ith each other. BO types acts as entry points to data and functions for an SAP System. BO's can be used in business w orkflow s, ALE and RFC.

Business Object has the follow ing functions:

3.
a. b. c. d. e. f. g.

Business Object Properties


Object Type ID - It is used for internal identification of the business object. Object Name - It is used for external identification of the business object. Using this property external system can interact w ith SAP system. Super Type - It is the parent object from w hich all the components of the BO are inherited. Name - It is a descriptive name of the BO. Description - It is a brief description of the business object type. Application - The application component to w hich the BO belongs to. Program - Program that w ill contain the ABAP code of the BO.

Each business object has the follow ing properties:

4.

Components of a Business Object

There are 5 components of a business object: a. Key Fields Can be a combination of one or more fields Is a specification of unique object key - to access a specific instance of a BO Is a reference to underlying application table Must be character based Value set w hen creating a BO instance or by a method Can be read from outside. Cannot be changed from outside Maximum length of concatenated key field can be 70 characters b. Attributes Properties and characteristics of a BO Can be read from outside. Cannot be changed from outside Can be single-line or multi-line Can be instance independent (static) or instance dependent Types of attributes: c. Virtual - Set by a method/BO program w hen accessed DB field - Loaded from the database w hen accessed, based on the key fields Events

Indicates the occurrence of a status change of a BO Can have parameters and exceptions like methods Have listeners outside the BO. E.g. Workflow d. Methods These are functions that encapsulates the functionalities of a BO Can be synchronous or asynchronous Can be instance independent or instance dependent Can have parameters (mandatory/optional, single/multi-line, import/export/both) and exceptions The ABAP implementation can be: e. A function module A BAPI A transaction A dialog module (Obsolete) A report Other ABAP forms (Direct implementation, ABAP class methods, system program etc.) Synchronous - Result is returned directly to the calling program. Asynchronous - Result can be returned to the calling program only through an event. Interface Types

Types of methods:

Like models for BO Types Do not have any key fields Cannot be instantiated Do not have development statuses Can be inherited - substitute for multiple inheritance Can have implementation A BO Type can inherit one or more interfaces Methods defined in an interface can be redefined in a BO Type The interface IFSAP and its methods ExistenceCheck and Display are inherited by all BO Types by default

5.
a. b. c. d. 6.

Business Object Statutes


Modeled - Only defined (the method and its signature) Implemented - ABAP implementation is done, can be used for testing or internal use Released - Method ready to be used Obsolete - Attribute / Method / Event not to be used anymore Delegating a Business Object Here w e w ill Discuss how to delegate a Business Object and w hat is Delegation and w hy w e use it?

The follow ing are the different development statuses of a BO/BO Component:

Q1>What is Delegation ? Ans1>Delegation, as the name implies, is a technique of replacing an original object type by its subtype to w hich additional events/methods may be added. Q2> Why w e use Delegation? Ans2> If the standard SAP events don't fulfill your purpose, new events/methods may be added to the given object type. SAP doesn't allow changes to its original object types. It permits changes by using the concept of delegation. Q3>What are the uses of Delegating a BO? Ans3>By delegating a BO, Customers use their ow n object extensions w ith the tasks , events , etc. supplied by SAP. Without having to redefine existing tasks , w e can use standard objects w ith customer extensions. Transaction to be used-------SWO1 (Business Object Builder) 1)Create a business Object using transaction SWO1.

2)Now take super-type as BUS2012 w hich you w ant to delegate.

3)Save it in a 'Z' Package.

4)Click on Object type and go to EDIT. There change the release status of Object type to implement.

5) Again click on Object type and go to EDIT. Now change the release status of Object type to Release.

6)Now click on Methods and press create button. One Pop-up w ill come and here click on 'No'.

Give the method name and description. 8) After this click on method that you have created. Go to EDIT-Change Release Status. Here first implement the object type component and then release it.

Here you can notice both tick mark is coming in front of business object and method w e have created. It means method is created successfully. 10) Now in this method , w e can w rite our ow n code according to our requirement. In my w orkflow I have created one method just to add US w ith DEVHYD. For this I have created tw o parameter---ID , USID (under Parameter Tab)

11) Now click On Program tab for w riting code in our method.

Here I have w ritten Code for adding US w ith DEVHYD. 12)Now save and come back. w e w ill come on SWO1 initial screen.

Here under Setting tab click on Delegate. 13) Choose object type as Bus 2012 and click on Details Tab.

14) In Delegation type , w rite your 'z' object name and then save it.

15) Now w e can use it in any TASK. For this go to transaction PFTC. Write Business object in object type category. Press F4, the method w e have created w ill come. Now choose that. It means that in BO bus2012 delegation is done.

Labels
business_object business_objects_in_workflows delegation workflows

Comments (2)

Follow SCN Contact Us SAP Help Portal Privacy Terms of Use Legal Disclosure Copyright

Você também pode gostar