Thursday, April 25, 2013

SAP BUSINESS OBJECTS



SAP Business Objects (a.k.a. BO, BOBJ) is a French enterprise software company, specializing in business intelligence (BI). Since 2007, it has been a part of SAP AG. The company claimed more than 46,000 customers worldwide in its final earnings release prior to being acquired by SAP.[1] Its flagship product is BusinessObjects XI, with components that provide performance management, planning, reporting, query and analysis and enterprise information management. Business Objects also offers consulting and education services to help customers deploy its business intelligence projects. Other Business Objects toolsets enable universes (the BOBJ name for a semantic layer between the physical data store and the front-end reporting tool) and ready-written reports to be stored centrally and made selectively available to communities of password-protected usernames.

[edit]

Bernard Liautaud co-founded Business Objects in 1990 together with Denis Payre and was chief executive officer until September 2005, then became chairman and chief strategy officer until January 2008. In 1990, the first customer, Coface, was signed. The company went public on NASDAQ in September 1994, making it the first European software company listed in the United States.[citation needed] In 2002, the company made Time Magazine Europe's Digital Top 25 of 2002 and were BusinessWeek Europe Stars of Europe.
History

On 7 October 2007, SAP AG announced[2] that it would acquire Business Objects for $6.8B. As of 22 January 2008, the corporation is fully operated by SAP; this is seen as part of a growing consolidation trend in the business software industry, with Oracle acquiring Hyperion in 2007 and IBM acquiring Cognos in 2008.
Business Objects had two headquarters in San Jose, California, and Paris, France, but their biggest office was in Vancouver, BC. The company's stock was traded on both the Nasdaq and Euronext Paris (BOB) stock exchanges.

[edit]Legal

On April 2, 2007 a lawsuit from Informatica (inherited by BOBJ from the purchase of Acta Technologies in 2002) resulted in an award of $25 million in damages to Informatica forpatent infringement. The lawsuit related to embedded data flows with one input and one output. Informatica asserted that the ActaWorks product (now sold by BOBJ as part of Data Integrator), infringed several Informatica patents including U.S. Patent Nos. 6,014,670 and 6,339,775, both titled "Apparatus and Method for Performing Data Transformations in Data Warehousing." BOBJ subsequently released a new version of Data Integrator (11.7.2) removing the infringing product capability.[3][4]

[edit]Timeline

  • 1990: BusinessObjects launches Skipper SQL 2.0.x.
  • 1994: Launches BusinessObjects v3.0 and goes public on the NASDAQ in September — the first French company listed in the United States.[5]
  • 1996: Enters the OLAP market and launches BusinessObjects v4.0. Bernard Liautaud named one of Business Week's "Hottest Entrepreneurs of the Year."
  • 1997: Introduces WebI thin client, which enables shared information across an extranet.[6]
  • 1999: General Electric (GE) begins working with the company.[citation needed] Business Objects goes public in France on the Premier Marché. Acquires Next Action Technologies.
  • 2000: Acquires OLAP@Work for approximately $15 million[7] and announces MDX Connect from this acquisition.[8]
  • 2001: SAP signs an OEM and reseller agreement to bundle Crystal Reports. Acquires Blue Edge Software.
  • 2001: Signs up its single largest global software licensing transaction with Three formerly known as Hutchison 3G.
  • 2002: Acquires Acta Technologies.[9] Bernard Liautaud named to Business Week's "Stars of Europe," and the company is named one of the "100 Fastest Growing Tech Companies" by Business 2.0.[10] Informatica files a lawsuit against Acta, claiming patent rights infringement.[6]
  • 2003: Acquires Crystal Decisions for $820 million.[11] Business Objects releases Dashboard Manager, BusinessObjects Enterprise 6, and BusinessObjects Performance Manager.
  • 2004: Debuts new combined company with the slogan, "Our Future is Clear, Crystal Clear." Launches Crystal v10 and BusinessObjects v6.5.
  • 2005: Launches BusinessObjects XI. Acquires SRC Software, Infommersion, and Medience. Launches BusinessObjects Enterprise XI Release 2.
  • 2006: Business Objects acquires Firstlogic, Inc and Nsite Software, Inc.
  • 2006: Acquires ALG Software (formerly Armstrong Laing Group). Launches Crystal Xcelsius, which allows users to transform Microsoft Excel spreadsheet data into interactive Flash media files.
  • 2007: Continuing its string of acquisitions, Business Objects acquires Cartesis and Inxight.
  • 2007: In October, SAP AG's Chief Executive Henning Kagermann announced a $6.8 billion deal to acquire Business Objects.
  • 2008: In January, SAP absorbs all of Business Objects' offices, and renames the entity "Business Objects, an SAP company". Following the acquisition of Business Objects by SAP, the founder and CEO of Business Objects, Bernard Liautaud, announces his resignation.
  • 2009: Business Objects becomes a division of SAP instead of a separate company. The portfolio brand "SAP BusinessObjects" was created. All former BO employees now officially work for SAP.

[edit]Products

  • Common services for deployment and management of BI tools
  • Reporting
    • Query and analysis tools for self-service reporting, including DeskI (Full Client, which is being retired) and Web Intelligence (for ad-hoc reporting).
    • Enterprise Reporting (SAP Crystal Reports) access, format, and deliver information to large populations of users.
  • Data Visualization (Dashboard Design/Xcelsius) supports creation of flash dashboards and dynamic charts and graphics with data from BO XI, databases, or Excel spreadsheets.
  • Universe Designer: An administrator tool used to construct Universes or abstracted end-user views of the database; allows pre-defining table joins, object descriptions, and measure object behavior during aggregation. This tool is succeeded by "Information Design Tool" (IDT) in SAP BusinessObjects 4.0
  • Enterprise Information Management (EIM) integrates and improves data to create a trusted foundation for business decisions. Creates a basis for querying and analysis throughETL or EII.
  • Enterprise Performance Management (EPM) helps users align with strategy by tracking and analyzing key business metrics and goals via management dashboards,scorecards, analytics, and alerting.
  • InfoView web portal, which is succeeded by BI Launch pad in SAP BusinessObjects 4.0[16]
  • BusinessObjects Planning and Consolidation (formerly OutlookSoft) a corporate performance management tool which runs within Microsoft Excel[17]
    • On-demand BI software (Business Intelligence OnDemand), hosted on the web.

DefinitionBusiness object technology and business object programming are based on the concept of "business objects". Real world objects, for example an employee or a sales order, are modeled as business objects in business application systems, such as the R/3 System.
You can visualize the SAP Business Objects as "black boxes" that encapsulate R/3 data and business processes, thus hiding the details of the structure and implementation of the underlying data.
StructureTo achieve this encapsulation, the SAP Business Objects are constructed as entities with multiple layers:
  • At the core of an SAP Business Object is the kernel, which represents the object's inherent data.

  • The second layer, the integrity layer, represents the business logic of the object. It comprises the business rules and constraints that apply to the Business Object.
  • The third layer, the interface layer, describes the implementation and structure of the SAP Business Object, and defines the object's interface to the outside world.
  • The fourth and outermost layer of a Business Object is the access layer, which defines the technologies that can be used to obtain external access to the object's data, for example COM/DCOM (Component Object Model/Distributed Component Object Model).
IntegrationAccessing Business ObjectsAs the graphic shows, the interface layer separates a Business Object's data and the applications and technologies that can be used to access it. To the outside, the SAP Business Objects reveal only their interface, which consists of a set of clearly defined methods. Applications can only access the Business Object data by the object's methods.
An application program that accesses an SAP Business Object and its data only needs the information required to execute the methods. Therefore, an application programmer can work with the SAP Business Objects and invoke their methods without having to know or consider the object's underlying implementation details.
The set of methods that is associated with a Business Object represents the object's behavior. When a method is executed on a Business Object, the method can change the object's internal state, that is, the object's data.
For example, one method that you can use on the Business Object "Employee" is to "check for the employee's existence".
All SAP Business Object types and their methods are identified and described in the Business Object Repository (BOR).
See also:Introduction to the Business Object Repository
Introduction to BAPIs
Object Types and Object InstancesEach individual Business Object belongs to a specific object class, depending on the nature and general characteristics of the object. These object classes are called object types. For example, the individual employees working in an organization are all part of the "Employee" object type.
The object types are descriptions of the actual SAP Business Objects that can exist in R/3; that is, each individual SAP Business Object is a representation, or instance, of its object type. For example, the employee with the name Charles Jones and the employee number 1234 is an instance of the "Employee" object type.
When writing object-oriented application programs, application developers identify the object types that are to be used and operated on by their programs. At runtime, the application program accesses the specific instances of the defined object types.
When an instance of a Business Object is used by an application program, the object instance responds only to the set of characteristics and methods defined for its own object type. The SAP Business Object types are defined by the following:

  • Object type The object type describes the features common to all instances of that object type. This includes information such as the unique name of the object type, its classification, and the data model.
  • Key fieldsThe key fields determine the structure of an identifying key, which allows an application to access a specific instance of the object type. The object type "Employee" and the key field "Employee.Number" are examples of an object type and a corresponding key field.
  • Methods 
    A method is an operation that can be performed on a Business Object and that provides access to the object data. A method is defined by a name and a set of parameters and exceptions, which can or must be provided by the calling program in order to use the method. BAPIs are examples of such methods.
  • AttributesAn attribute contains data about a Business Object, thus describing a particular object property. For example, "Employee.Name" is an attribute of the "Employee" object type.
  • Events
    An event indicates the occurrence of a status change of a Business Object.
  • Interfaces
    Interfaces are groups of related methods associated with an object type.
Inheritance and PolymorphismOne objective and the main benefit of object-oriented technology is software reusability.
The reuse of software code is achieved by deriving new object types from existing ones. When an object type is generated from an existing object type, the new object type is called the subtype and the existing object type is called the supertype. For example, the object type "Employee" is a subtype which has been derived from the supertype "Person". Note that "subtype" and "supertype" are sometimes referred to as "subclass" and "superclass".
A subtype inherits all the properties and methods defined for the supertype from which it descends, but can also have additional properties and methods. A subtype may also implement a different behavior for the methods inherited from the supertype. Polymorphism is the term used to describe when the same method triggers different types of behavior in different Business Object types.

Business Object type contains methods, attributes and events which give a component based view of any Business Process. 
For example we have a Purchase Order business process. This process includes various small functionalities. It will have process of changing Purchase orders based upon requirements, functionality to retrieve the details of purchase order etc. Each of these functionalities is encapsulated inside a method. The method can call the function modules present in R3 system or can have there own code to execute some functionality. So if we consider Purchase Order as a Business Object then it will be identified by key field Purchase Order number. Each purchase order business object based upon key field purchase order number is different. It’s so because each purchase order is different and will contain different details. 
So the methods contain business functionality. Attributes are just like properties of the Business object. For example for any purchase order Purchasing Group, Purchasing Organization etc are attributes. 
Technically we can say that business object types are just like any template. At runtime we instantiate or create runtime objects for any BO (Business Object) type based upon the key fields we pass. Two runtime Business objects of same BO type are different from each other based upon the key fields we pass. So the key field is the differentiating factor for two or more runtime business objects of same BO type. 
To Browse for BO open tcode SWO2 (Path -> Tools ->ABAP Workbench->Overview->Business Object Browser). 
                       
You can expand the nodes and can check various business objects in BOR. You can double click on the BO node and it will take you to BO display (SWO1).   

1           Working with Business Object in our programs 

For creating a Business Object and its attributes there are many already existing tutorials.  So in this tutorial we will not discuss creation of BO and its attributes.

1.1          To create instance of a BO

To create an instance of BO we need to have the key fields of that BO. Key fields will be used to uniquely identify the BO. We can use the FM 'SWO_CREATE' to create an instance of BO in any report program. 
DATA:
    i_objtype TYPE swo_objtyp,
    i_objkey TYPE swo_typeid,
    object TYPE swo_objhnd.
i_objtype = <Business Object>
i_objkey = <BO key>
CALL FUNCTION 'SWO_CREATE'
  EXPORTING
    objtype = i_objtype
    objkey  = i_objkey
  IMPORTING
    object  = object.
The variable ‘object’ will hold runtime instance of the object type.
 The other way is to use the macros defined in include <cntn01> 
INCLUDE <cntn01>.
DATA:
    i_objtype TYPE swo_objtyp,
    i_objkey TYPE swo_typeid,
    object TYPE swc_object.
*Create instance of Object type
swc_create_object object  i_objtype i_objkey.
 Internally the macro calls the FM SWO_CREATE. So you can either go for direct FM call or the macro call.

1.2          Container 

Basically the term Container is used with reference to Business Objects and Workflows. The Container actually holds import and export parameters associated with any method of Business Object at runtime. When ever we are calling any method of Business Object we need to populate container for import parameters and after the method gets executed it returns the values (export parameters) in Container. 
Business Object container is technically of type SWCONT structure. 
 
Here ‘ELEMENT’ will be name of the variable/internal table which container holds and ‘VALUE’ will have corresponding value. For multi line variable or internal tables, the container will hold multiple values with same element name. 

1.2.1          Lets take an example to check what Container is 

For example let’s create a Business Object ‘ZSWE1’ with only one method ‘READ’. We will discuss the creation of BO in very brief. 
Key field will be Purchase Order number (EKKO_EBELN) for BO. 
Method READ will take Purchase Order number as input and will give all the Purchase Line items in it in an internal table. 
Step 1 : Create BO ZSWE1 for test purpose. You can give it any name. 
 
Step 2 : Now create a method READ
                            
Save the method. Now we will create the parameters of the method. 
Import Parameters
PurchaseDocument
EKKO-EBELN
Export Parameter
ITEM
EKKO-EBELP (multi line)
 PurchasingDocument will be a import parameter of type EKKO_EBELN.
ITEM will be a export parameter of type EKKO_EBELP and will be a multi line variable(internal table ) 
 



Save the method and then Click on the Program button to implement the method. In the method just read all ebeln (Purchase line items) corresponding to PO number into internal table ITEM and pass it on to container in the method. Check the snapshot below. 
 
Check the whole code of the BO program here.  
*****           Implementation of object type ZSWE1                *****
INCLUDE <OBJECT>.
BEGIN_DATA OBJECT. " Do not change.. DATA is generated
* only private members may be inserted into structure private
DATA:
" begin of private,
"   to declare private attributes remove comments and
"   insert private attributes here ...
" end of private,
  BEGIN OF KEY,
      PURCHASINGDOCUMENT LIKE EKKO-EBELN,
  END OF KEY.
END_DATA OBJECT. " Do not change.. DATA is generated
BEGIN_METHOD READ CHANGING CONTAINER.
DATA:
      PURCHASINGDOCUMENT TYPE EKKO-EBELN,
      ITEM TYPE EKPO-EBELP OCCURS 0.
  SWC_GET_ELEMENT CONTAINER 'PurchasingDocument' PURCHASINGDOCUMENT.
  select ebelp into table item from ekpo
  where ebeln = PURCHASINGDOCUMENT.
  SWC_SET_TABLE CONTAINER 'Item' ITEM.
END_METHOD. 

Step 1 : Save the changes and make the status of the BO to implemented for testing purpose. Also generate the BO. 
Step 2 : Now let’s test the BO. For this put a break point in the method READ at the select query. Also take any PO number which will have multiple line items. You can check EKKO and EKPO tables. In my case I am taking PO ‘4200000017’. In my R3 system this particular PO contains 4 line items in EKPO table. Let’s put a break point and check the method. 
 
Step 3 : Execute the BO with key ‘4200000017’ 
 
Execute the method with import parameter as ‘420000017’ 
 
It will take you to debugging mode. Now check the container. 
In debug mode before the select statement the CONTAINER will hold only import variable 
 
Now execute the last statement in the method and see the contents of CONTAINER (just before exiting the method. 
 
So we have seen how the CONTAINER holds values while we are working with Business Objects at runtime. 

1.2.2          Some common macros defined in include <CNTN01> for working with Containers 

Functionality
Macro
To write a single line variable in Container
SWC_SET_ELEMENT
To read a single line variable from Container
SWC_GET_ELEMENT
To write a multi line variable or internal table in Container
SWC_SET_TABLE
To read a multi line variable or internal table from Container
SWC_GET_TABLE
To clear the container
SWC_CLEAR_CONTAINER
Further you can check the include <CNTN01> for more macros. Also check the macros. These macros call some specific function modules that you can use directly in your code. 

1.3          Calling a BO Method/Attribute in report programs 

We can create a instance of BO method using FM  'SWO_CREATE' or macro ‘SWC_CREATE_OBJECT’. 
First of all lets consider a BO 'BUS1001006'  (StandardMaterial). We will call the method ‘DISPLAY’. For this we will instantiate the BO with key ‘ZSHUKSWE20’( material number). 
To call a method or attribute of any BO we can use the FM 'SWO_INVOKE'. We have to take care while we call this FM. Suppose if we want to call an attribute defined in the method, then we need to populate the import parameter ACCESS with ‘G’. If we need to call the method of the BO then we need to populate the import parameter ACCESS with ‘C’. 
Lets create a report program and check step by step. We will fetch details of attribute “MATERIALTYPE” of BO 'BUS1001006' 
*&---------------------------------------------------------------------*
*& Report  ZSWET_BO1
*&
*&---------------------------------------------------------------------*
*& To get attributes of BO instance in report
*&
*&---------------------------------------------------------------------*
REPORT  zswet_bo1.
PARAMETERS: p_busobj(10) TYPE c DEFAULT 'BUS1001006',
            p_key(70) TYPE c DEFAULT 'ZSHUKSWE20' ,
            p_attr(32) TYPE c DEFAULT 'MATERIALTYPE',
            p_access TYPE c DEFAULT 'G'. "To call method put 'C'
DATA:
    i_objtype TYPE swo_objtyp,
    i_objkey TYPE swo_typeid,
    i_element TYPE swo_verb.
DATA object TYPE swo_objhnd.
DATA verb TYPE swo_verb.
DATA return TYPE swotreturn.
DATA lt_container TYPE STANDARD TABLE OF swcont.
DATA line TYPE swcont.
i_objtype = p_busobj.
i_element = p_attr.
i_objkey = p_key.
*  Instantiate the business object. i.e give it a key and create it.
CALL FUNCTION 'SWO_CREATE'
  EXPORTING
    objtype = i_objtype
    objkey  = i_objkey
  IMPORTING
    object  = object.
* Return attribute.
CALL FUNCTION 'SWO_INVOKE'
  EXPORTING
    access    = p_access
    object    = object
    verb      = i_element
  IMPORTING
    return    = return
    verb      = verb
  TABLES
    container = lt_container.
* The attribute value is in the container returned from FM.
IF return-code = 0.
  LOOP AT lt_container INTO line.
    WRITE: / 'Attribute MATERIAL TYPE is : ',
              line-value.
  ENDLOOP.
ENDIF. 

Lets execute the report and see the output: 

Now lets see how to call a method of BO. The Method DISPLAY will display the material passed in BO container.
*&---------------------------------------------------------------*
*& Report  ZSWET_BO1
*&
*&---------------------------------------------------------------*
*& To call method with import parameters
*&
*&---------------------------------------------------------------*
REPORT  zswet_bo1.
* Get an attribute of a business object.
PARAMETERS: p_busobj(10) TYPE c DEFAULT 'BUS1001006',
            p_key(70) TYPE c DEFAULT 'ZSHUKSWE20' ,
            p_attr(32) TYPE c DEFAULT 'DISPLAY',
            p_access TYPE c DEFAULT 'C'. "To call method put 'C'
DATA:
    i_objtype TYPE swo_objtyp,
    i_objkey TYPE swo_typeid,
    i_element TYPE swo_verb.
DATA object TYPE swo_objhnd.
DATA verb TYPE swo_verb.
DATA return TYPE swotreturn.
DATA lt_container TYPE STANDARD TABLE OF swcont.
i_objtype = p_busobj.
i_element = p_attr.
i_objkey = p_key.
*To call the method we need to populate the Container of the
*BO with importing parameters
CALL FUNCTION 'SWC_ELEMENT_SET'
  EXPORTING
    element   = 'MATERIAL'
    field     = p_key(18)    "Material Number
  TABLES
    container = lt_container
  EXCEPTIONS
    OTHERS    = 1.
*Instantiate the business object. I.e give it a key and create it.
CALL FUNCTION 'SWO_CREATE'
  EXPORTING
    objtype = i_objtype
    objkey  = i_objkey
  IMPORTING
    object  = object.
* To call the Method of the BO.
CALL FUNCTION 'SWO_INVOKE'
  EXPORTING
    access    = p_access
    object    = object
    verb      = i_element
  IMPORTING
    return    = return
    verb      = verb
  TABLES
    container = lt_container.
The Output will be:- 
                        
Lets see an example below on How  to Call the methods using the macros defined in include <CNTN01>. 
*&----------------------------------------------------------------*
*& Report  ZSWET_BO1
*&
*&----------------------------------------------------------------*
*& Using macros defined in CNTN01 include. To call method of BO
*& For reference check FM DNO_DB_APPENDIX_INSERT
*&----------------------------------------------------------------*
REPORT  zswet_bo1.
INCLUDE <cntn01>.
* Get an attribute of a business object.
PARAMETERS: p_busobj(10) TYPE c DEFAULT 'BUS1001006',
            p_key(70) TYPE c DEFAULT 'ZSHUKSWE20',
            p_attr(32) TYPE c DEFAULT 'DISPLAY',
            p_access TYPE c DEFAULT 'C'. "To call method put 'C'
DATA:
    i_objtype TYPE swo_objtyp,
    i_objkey TYPE swo_typeid,
    i_element TYPE swo_verb.
DATA: gv_mat TYPE swc_object.
i_objtype = p_busobj.
i_element = p_attr.
i_objkey = p_key.
*Define container
swc_container container.
*Create instance of Object type
swc_create_object gv_mat i_objtype i_objkey.
**gv_mat will contain instance of the BO
*To clear a continer
swc_clear_container container.
*Now to call a method fill up container with import parameters for method
swc_set_element container 'MATERIAL' p_key(18). "'MATERIAL' ->import parameter
*For container of type table use swc_set_table.
***If any more import parameter are there for the object then populate them
***also using swc_set_element and swc_set_table
*In this case no more import parameters
*To call a method stored in p_attr
swc_call_method gv_mat p_attr container.
*If there are any export parameter, then CONTAINER will have the values
*and we can read from container
The Output will be:- 
                        

1.4          To trigger an Event of BO 

We can use the FM ‘SWE_EVENT_CREATE’  to raise an event in any report program. An explicit commit work is required after the FM call to trigger the event, other wise event will not be raised. 
*&---------------------------------------------------------------*
*& Report  ZSWET_BO1
*&
*&---------------------------------------------------------------*
REPORT  zswet_bo1.
INCLUDE <cntn01>.
* Get an attribute of a business object.
PARAMETERS: p_busobj(10) TYPE c DEFAULT 'BUS1001006',
            p_key(70) TYPE c DEFAULT 'ZSHUKSWE20'.
DATA:
    i_objtype TYPE swo_objtyp,
    i_objkey TYPE swo_typeid.
i_objtype = p_busobj.
i_objkey = p_key.
*Define container
swc_container container.
*To clear a continer
swc_clear_container container.
*You can populate the Container if required
*To generate event
CALL FUNCTION 'SWE_EVENT_CREATE'
  EXPORTING
    objtype           = i_objtype
    objkey            = i_objkey
    event             = 'CREATED'
  TABLES
    event_container   = container
  EXCEPTIONS
    objtype_not_found = 1
    OTHERS            = 2.
IF sy-subrc <> 0.
  " MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  "         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
  "         RAISING OBJTYPE_NOT_FOUND.
ENDIF.
COMMIT WORK.
 
Just triggering an event does not makes any sense until and unless a proper event receiver id is linked to the event. This event receiver can be a FM or can be any workflow. Event linkage can be done in SWE2 or SWETYPV transactions.



No comments:

Post a Comment