business object delegation

Upload: hayorbahmy

Post on 02-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Business Object Delegation

    1/10

    Added by Mamta Verma, las t edited by Alon Mizrahi on Nov 02, 2011

    Welcome, GuestLoginRegister

    Getting StartedNewslettersStore

    ProductsServices & SupportAbout SCN

    DownloadsIndustriesTraining & EducationPartnershipDeveloper CenterLines of BusinessUniversity AlliancesEvents & WebinarsInnovation

    Business Object Delegation

    Business Object Delegation

    Applies To: Learners in workflow s, Business Object.

    Summary

    This document w ill help people to understand business object delegation w hich can be f urther used in w orkflow s

    It will give a brief idea of w hat is Business Object, its components, properties.

    And how to delegate a business object and what is delegation and w hy w e delegate a std. business object.

    Author : Mamta Verma, Softw are Engineer, ES-SAP.

    Company: 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 we can understand BO as an object

    oriented approach to model business entities and processes.

    2. Role of Business Object types

    Business Object has the f ollow ing functions:

    a. BO reduces the complexity of the SAP system by dividing it into smaller units.

    b. At BO level, non-SAP systems can communicate w ith SAP sys tem. This can be done using BAPIs.

    c. BO enables various business components to communicate with each other.

    d. BO types acts as entry points to data and functions for an SAP System.

    e. BO's can be used in business w orkflow s, ALE and RFC.

    3. Business Object Properties

    Each business object has the f ollow ing properties:

    a. Object Type ID - It is used for internal identification of the business object.

    b. Object Name - It is used for external identification of the business object. Using this property external sys tem can interact w ith SAP system.

    c. Super Type - It is the parent object from which all the components of the BO are inherited.d. Name - It is a descr iptive name of the BO.

    e. Description - It is a brief description of the business object type.

    f. Application - The application component to which the BO belongs to.

    g. Program - Program that will contain the ABAP code of the BO.

    4. Components of a Business Object

    http://wiki.sdn.sap.com/wiki/display/~z2snd8nhttp://wiki.sdn.sap.com/wiki/display/~xxsi20thttp://wiki.sdn.sap.com/wiki/display/BOBJ/Business+Object+Delegationhttp://scn.sap.com/community/developer-centerhttp://scn.sap.com/community/developer-centerhttp://www.sapstore.com/http://scn.sap.com/community/newslettershttp://www.sdn.sap.com/irj/scn/logon?redirect=/irj/scn/wiki?path=/pages/viewpage.action?pageId=66388005http://wiki.sdn.sap.com/wiki/display/BOBJ/Business+Object+Delegationhttp://scn.sap.com/community/uachttp://scn.sap.com/community/developer-centerhttp://www.sapstore.com/http://scn.sap.com/community/newslettershttp://scn.sap.com/community/getting-startedhttp://www.sdn.sap.com/irj/scn/registerhttp://www.sdn.sap.com/irj/scn/logon?redirect=/irj/scn/wiki?path=/pages/viewpage.action?pageId=66388005http://wiki.sdn.sap.com/wiki/display/~xxsi20thttp://wiki.sdn.sap.com/wiki/display/~z2snd8n
  • 7/27/2019 Business Object Delegation

    2/10

    There are 5 components of a business object:

    a. Key Fields

    Can be a combination of one or more f ields

    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 f rom outside. Cannot be changed from outside

    Maximum length of concatenated key f ield can be 70 characters

    b. Attributes

    Properties and characteristics of a BO

    Can be read f rom outside. Cannot be changed from outside

    Can be single-line or multi-line

    Can be instance independent (stat ic) or instance dependent

    Types of attributes:

    Virtual - Set by a method/BO program w hen accessed

    DB field - Loaded from the database w hen acces sed, based on the key fields

    c. 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:

    A func tion module

    A BAPI

    A transaction

    A dialog module (Obsolete)

    A report

    Other ABAP forms (Direct implementation, ABAP class methods, sys tem program etc.)

    Types of methods:

    Synchronous - Result is returned directly to the calling program.

    Asynchronous - Result can be returned to the calling program only through an event.

    e. Interface Types

    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. Business Object Statutes

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

    a. Modeled - Only defined (the method and its signature)

    b. Implemented - ABAP implementation is done, can be used for tes ting or internal use

    c. Released - Method ready to be used

    d. Obsolete - Attribute / Method / Event not to be used anymore

    6. Delegating a Busines s 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?

    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 we 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 ofdelegation.

    Q3>What are the use s of Delegating a BO?

    Ans3>By delegating a BO,

    Customers use their ow n object extensions w ith the tasks , events , etc. s upplied by SAP.

    Without having to redefine existing tasks , w e can use s tandard objects w ith customer extensions.

    Transaction to be us ed------- SWO1 (Business Object Builder)

    1)Create a business Object using transaction SWO1.

  • 7/27/2019 Business Object Delegation

    3/10

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

    3)Save it in a 'Z' Package.

  • 7/27/2019 Business Object Delegation

    4/10

    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 c hange the release status of Object type to Release.

  • 7/27/2019 Business Object Delegation

    5/10

    6)Now click on Methods and press c reate 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.

  • 7/27/2019 Business Object Delegation

    6/10

    Here you can notice both tick mark is coming in front of business object and method we 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)

  • 7/27/2019 Business Object Delegation

    7/10

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

  • 7/27/2019 Business Object Delegation

    8/10

    Here I have written Code for adding US w ith DEVHYD.

    12)Now save and come back. we w ill come on SWO1 initial scr een.

    Here under Setting tab click on Delegate.

    13) Choose object type as Bus 2012 and click on Details Tab.

  • 7/27/2019 Business Object Delegation

    9/10

    14) In Delegation type , wr ite 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 c hoose that. It means that in BO bus2012 delegation is done.

  • 7/27/2019 Business Object Delegation

    10/10

    Labels

    Comments (2)

    Follow SCN

    Contact UsSAP Help Portal

    PrivacyTerms of UseLegal DisclosureCopyright

    business_object business_objects_in_workflows delegation workflows

    http://wiki.sdn.sap.com/wiki/label/BOBJ/workflowshttp://wiki.sdn.sap.com/wiki/label/BOBJ/delegationhttp://wiki.sdn.sap.com/wiki/label/BOBJ/business_objects_in_workflowshttp://wiki.sdn.sap.com/wiki/label/BOBJ/business_objecthttp://www.sap.com/corporate-en/our-company/legal/copyright/index.epxhttp://www.sap.com/corporate-en/our-company/legal/impressum.epxhttp://www.sdn.sap.com/irj/scn/policyhttp://www.sdn.sap.com/irj/scn/policy?view=PPhttp://help.sap.com/http://scn.sap.com/docs/DOC-18476http://bit.ly/SCNLnIhttp://bit.ly/SCNyouThttp://bit.ly/SCNFBhttp://bit.ly/SCNTwR