52
BusinessObjects Integration Kit for SAP - Crystal Reports 2008 Applies to: Crystal Reports 2008, BusinessObjects Integration Kit for SAP Solutions Summary This document outlines the required steps to install and configure BusinessObjects Enterprise in combination with SAP NetWeaver BI. Author: Ingo Hilgefort Company: Business Objects, an SAP company Created on: 01 October 2008 Author Bio Ingo Hilgefort started in 1999 with Seagate Software / Crystal Decisions as a Trainer and Consultant. He moved to Walldorf for Crystal Decisions by end of 2000 and worked with the SAP BI Development team on integrating Crystal Reports with SAP BW. He then relocated to Vancouver in the year 2004 and worked as Product Manager / Program Manager (Engineering) on the integration of Business Objects products with SAP products. He is now focusing on the topic of Embedded Analytics for the SAP Solutions. SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 1

Business objects integration kit for sap crystal reports 2008

Embed Size (px)

Citation preview

Page 1: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Applies to: Crystal Reports 2008, BusinessObjects Integration Kit for SAP Solutions

Summary This document outlines the required steps to install and configure BusinessObjects Enterprise in combination with SAP NetWeaver BI.

Author: Ingo Hilgefort

Company: Business Objects, an SAP company

Created on: 01 October 2008

Author Bio Ingo Hilgefort started in 1999 with Seagate Software / Crystal Decisions as a Trainer and Consultant.

He moved to Walldorf for Crystal Decisions by end of 2000 and worked with the SAP BI Development team on integrating Crystal Reports with SAP BW. He then relocated to Vancouver in the year 2004 and worked as Product Manager / Program Manager (Engineering) on the integration of Business Objects products with SAP products.

He is now focusing on the topic of Embedded Analytics for the SAP Solutions.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 1

Page 2: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Table of Contents SAP as a Datasource for Crystal Reports ..........................................................................................................3 SAP BW Metadata in Crystal Reports ................................................................................................................4

Dimension and Characteristics .......................................................................................................................5 Display attributes and Navigational Attributes ................................................................................................7 Keyfigures, Units, and Currencies ..................................................................................................................9 Hierarchies ....................................................................................................................................................10

Crystal Reports with simple SAP BW queries ..................................................................................................11 Creating Crystal Reports Using the SAP Toolbar.........................................................................................11 Creating Crystal Reports Using the Database Explorer ...............................................................................15

Creating your First Report with Crystal Reports on Top of SAP BI ..................................................................22 Insert a Field .................................................................................................................................................26 Insert Additional Fields..................................................................................................................................27 Preview the Report........................................................................................................................................28 Resize Fields.................................................................................................................................................30 Change Field Headings.................................................................................................................................31 Add Summary Information ............................................................................................................................31 Add a title ......................................................................................................................................................33 Format an Object ..........................................................................................................................................34 Grouping & Charting .....................................................................................................................................36 Save the Report ............................................................................................................................................38

Creating your First Report with Hierarchies from SAP BI.................................................................................39 Formulas for Hierarchical Reporting .............................................................................................................48

Formula Hierarchy Level ............................................................................................................................................48 Count Hierarchical Children .......................................................................................................................................48

Conditional Formatting with Hierarchy Level ................................................................................................49 Copyright...........................................................................................................................................................52

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 2

Page 3: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

SAP as a Datasource for Crystal Reports

The available SAP data sources for Crystal Reports are:

SAP R/3

• Tables and cluster (Open SQL). • ABAP functions. • Classic InfoSets. • SAP queries and InfoSet queries.

SAP BW

• Tables and cluster (Open SQL). • ABAP Functions. • Direct ODS access (without the need for an SAP BW query). • BW queries and BW cubes.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 3

Page 4: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

SAP BW Metadata in Crystal Reports

When connecting to a SAP BI query with Crystal Reports the underlying metadata from the SAP BI query is leveraged and matched to Crystal Reports elements.

The table below shows how SAP BI metadata is used in Crystal Reports.

BW Query element Crystal Reports designer element

Characteristic Separate fields for key and description per characteristic.

Hierarchy Fields representing a parent-child relationship.

Keyfigure Measure element in a grouping called Keyfigure. Each Keyfigure can have up to three elements: numeric value, unit, and formatted value.

Calculated Keyfigure Measure element in the folder Keyfigure. (Information about the details of the calculated keyfigure is not available in Crystal Reports.)

Restricted Keyfigure Measure element in the folder Keyfigure (Information about the details of the restricted keyfigure is not available in Crystal Reports.)

Filter Filters will be applied to the underlying query but are not visible in the Crystal Reports designer.

Navigational attribute Separate fields for key and description per navigational attribute.

Display attribute Each display attribute becomes one field in the field explorer. The display attributes are grouped together with the actual characteristic.

SAP variables Parameters.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 4

Page 5: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Dimension and Characteristics

The image shows an SAP BI query in the BEx Query Designer.

The rows of this query include several characteristics and the columns several keyfigures. On the left side, the actual cube structure is shown with the cube dimensions (not to be confused with characteristics).

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 5

Page 6: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Building a Crystal Report on top of such an SAP BW query will result in the following elements:

• Each characteristic in the query will result in an element in the field explorer with a key and a description item (Example: City Key and City Name).

• In addition each characteristic will also generate a Node ID and a Parent Node ID which can be used for hierarchical reporting.

• Each characteristic will also generate a Member Unique Name field which represents the technical key value.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 6

Page 7: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Display attributes and Navigational Attributes

Display attributes are InfoObjects which are logically assigned or subordinated to a characteristic.

For example:

The characteristic customer has two attributes: • Phone number • Fax number

The following screen shows an SAP BI query in the BEx Query Designer.

The row structure includes a characteristic Customer with four display attributes (Geographical Height, Postal Code, Sector Code, and Area Code).

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 7

Page 8: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

In addition the BW query contains three navigational attributes in the rows: Regional Code, Postal Code, and Area Code.

A navigational attribute can easily be identified by the double underscore (“__”) in the technical name of the navigational attribute.

Building a Crystal Report object on top of such an SAP BW query will result in the following elements:

• Each characteristic in the query will result in an element in the field explorer with a key and a description field.

• Each navigational attribute in the query will result in an element in the field explorer with a key and a description item (for example, Regional Code and Area Code).

• Each display attribute will create an element in the field explorer underneath the corresponding characteristic (for example, Customer number with several display attributes).

• Crystal Reports will include all available display attributes for the characteristic and not only the display attributes that are included in the SAP BW query.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 8

Page 9: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Keyfigures, Units, and Currencies

Each keyfigure used in an SAP BW query can have up to three elements:

• Numeric value of the keyfigure. • Unit or currency information. • Formatted value, representing the user-specific formatting.

The image shows the result of two keyfigures in Crystal Reports:

• Each keyfigure is represented with a field in a group called Key Figures. • In the case the keyfigure is configured in SAP BW with a unit, an additional field will be added

representing the unit information.

• The Formatted Value represents the numeric value formatted as a string value following the user-specific formatting settings.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 9

Page 10: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Hierarchies

Hierarchies can be activated for characteristics in the BEx Query Designer and offer the user the capability to navigate along a hierarchical structure.

The image shows the field explorer in Crystal Reports based on an SAP BW query with a hierarchy.

• A hierarchy results in a parent-child relationship.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 10

Page 11: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Crystal Reports with simple SAP BW queries

Creating Crystal Reports Using the SAP Toolbar

The SAP specific toolbar and the SAP specific menu items offer the user the typical SAP open and save dialogs that are also used in the Business Explorer and allow the user to store the Crystal Report object directly into SAP BW roles.

The following table shows all available menu options of the SAP toolbar:

Button Command Function

Create a new report from SAP BW Query

Creates a new report based on an SAP BW query that is already defined.

Open Report Opens a Crystal Report file from SAP BW.

Save Report Saves the current report to SAP BW.

Save Report as Saves the report to BW with the option to define a new name or choose a different SAP BW role.

Start SAP BW Query Designer

Starts the SAP BW Query Designer.

Disconnect Closes the current connection to SAP BW.

Settings Allows configuring settings for the connectivity to SAP

BW. The settings are specific for the Crystal Reports designer installation.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 11

Page 12: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

As part of the settings available in the SAP toolbar the report designer can choose to use the SAP BW MDX driver for creating new reports against SAP BW.

It is highly recommended to use the BW MDX driver. The BW Query driver does not support multiple structures of a BW query and does not support display attributes.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 12

Page 13: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

To create a new report with the SAP toolbar

1. Start Crystal Reports Designer (Start > Programs > Crystal Reports 2008 > Crystal Reports 2008).

2. Select the menu SAP > Settings.

3. Set the check box Use MDX Driver with support for Multiple structures.

4. Click OK.

5. Select the menu SAP > Create New Report from a Query.

6. Select the SAP server from the SAP Logon.

7. Click OK.

8. Enter the needed details: Client, User, Password, and Language.

9. Click OK.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 13

Page 14: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

The SAP standard open/save dialog will show up and offer the user to select a query from the roles or InfoAreas.

10. Select the SAP BW query.

11. Click OK.

An empty report is created and the SAP BW query is used as data source.

12. Select the fields for your report from the Field Explorer.

13. Preview your report.

14. Save the report to BusinessObjects Enterprise.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 14

Page 15: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Creating Crystal Reports Using the Database Explorer

Crystal Reports lists the two SAP BW query connectivity in the standard Database Explorer.

To create a new report with the Database Explorer

1. Start Crystal Reports Designer (Start > Programs > Crystal Reports 2008 > Crystal Reports 2008).

2. Select the menu File > New > Standard Report.

3. Double-click on Create New Connection.

The SAP connectivity is listed as part of all available connectivity – sorted alphabetically.

4. Double-click SAP BW MDX Query. The SAP BW MDX Query connectivity is the more enhanced version of the Crystal Reports connectivity towards SAP BW cubes and SAP BW queries.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 15

Page 16: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

5. Select the SAP server from the list of available SAP systems.

6. Click Next.

7. Enter Client, Username, and Password.

8. Click Finish.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 16

Page 17: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

9. Click Finish.

10. Right-click the SAP server entry.

11. Select the menu entry Options.

12. Enter the filter in the field Table name LIKE.

13. Click OK.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 17

Page 18: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

14. Double-click the QC (Queries) entry.

15. Select the SAP BW query from the list of available queries

16. Click the right arrow to move the query to the list of selected queries.

17. Click Next.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 18

Page 19: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

18. Select the needed fields and click the right arrow.

19. Click Next.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 19

Page 20: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

20. If required, define grouping by selecting the field and clicking the right arrow.

21. Click Next.

22. If required, define a record selection.

23. Click Next.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 20

Page 21: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

24. Click Finish.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 21

Page 22: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Creating your First Report with Crystal Reports on Top of SAP BI

For this report I am using a SAP BI Query based on the cube 0D_DX_C01 (Demo Scenario DalSegno Company) with the following characteristics:

o Calendar Year o Calendar Year / Month o Product Group o Product o Distribution Channel

And the following keyfigures

o Billed Quantity o Net Sales

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 22

Page 23: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

1. Select Start All Programs Crystal Reports 2008 Crystal Reports 2008 to start Crystal Reports.

The SAP toolbar will appear on the left of the Start Page display.

2. In the SAP menu, select Settings. The Settings dialog appears.

3. Select Use MDX driver with support for Multiple structures and select OK.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 23

Page 24: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

4. Now you want to change the Initial Setup and show only the description of the characteristic and the key

figures of the BEx query.

5. Select the menu File > Options > Database and set the option “‘Show Description’

Now the Field Explorer will show SAP metadata instead of the technical name for the fields.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 24

Page 25: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

6. In the SAP toolbar, select Create new report from a query. The SAP System dialog appears.

7. Select the system and click Next.

8. Select Roles. Expand the folder and select the query.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 25

Page 26: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 26

Insert a Field

9. Expand the Database Fields node in the Field Explorer dialog.

10. Drag Product Group into the Details section of the Design tab. An object frame appears with the Arrow

cursor as you drag the field onto the report:

The object frame represents the object you have just selected for placement.

The size of the object frame approximates the size of the data in the field selected.

Move the object frame as far to the left as you can in the Details section. If you move the field too far to the

left, the Arrow cursor turns into a Stop cursor, indicating that you cannot drag the field that far. Keep in mind

that you cannot place any objects outside the page margin.

The Design tab should look similar to this:

Page 27: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Insert Additional Fields

11. Drag Product (SAP Demo) into the Details section of the Design tab to the right of Product Group.

Note: To select multiple fields, use the Ctrl-click combination to select a non-continuous range of fields. Use the

Shift-click combination to select several fields from the list that are contiguous. The fields appear in the Details

section of the report in the same order as in the Field Explorer dialog box.

12. Expand the Key Figures entry. Drag the Net Sales Value field to the right of Product (SAP Demo).

In the Field Explorer dialog box, the system indicates which items have been selected by placing a check mark ( )

on the fields used.

The Design tab should look similar to this:

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 27

Page 28: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Preview the Report

13. Click Print Preview on the Standard toolbar (or View Print Preview in the menu) to activate the Preview

tab. The Enter Values dialog appears.

Note: The first time you preview a report, you must select Print Preview to activate the Preview tab. The Preview

tab appears to the right of the Design tab. You can then switch between designing and previewing the report by

clicking the corresponding tab.

14. Use the Shift-click combination to select the Bag & Outdoor, Accessories, and Office product groups in the

Available Values list. Select the > button to transfer these values to the Selected Values list and select OK.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 28

Page 29: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

The system populates the Preview tab based on your selections. The screen should look similar to this:

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 29

Page 30: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Resize Fields

15. You can see that the Net Sales field is too small. Return to the Design tab to resize the field.

16. Click the Net Sales field in the Details section to select it. Press the Ctrl key and click the field heading to

select both objects.

17. Move the cursor over the resizing handle on the right edge of the fields until the cursor turns into a Resizing

cursor. Resize the fields to the right until they are approximately 1.5 inches in length.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 30

Page 31: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Change Field Headings

18. You need to edit the “(SAP Demo)” information out of the headings. Select the Preview tab. Right-click on the

Product Group field and select Edit Text (you can also use double-click) from the shortcut menu. Remove

the extra test so that the heading contains only the Product Group text. Repeat for the Product heading.

Note: You can perform the same function in the Design tab.

Add Summary Information

The next step is to add summary information to your report. Adding summary information allows you to specify the

author, title, and subject of the report, as well as any keywords or comments related to the report. When you add

summary information, users can find information related to the report quickly.

19. On the File menu, click Summary Info. The Document Properties dialog box appears with the Summary tab

active.

20. Enter information about your report in the text boxes provided. Be sure to complete the Author and Title

fields.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 31

Page 32: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 32

Page 33: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Add a title

As you can see, the report looks incomplete without a title. Although you can add a title using a text object, you can

also tell the program to take the title information directly from the Title text box in the Document Properties dialog

box.

21. Select the Design tab. Expand Special Fields in the Field Explorer.

22. Drag and drop Report Title to the upper left corner of the Page Header section of the report.

23. Drag and drop File Author to the lower left corner of the Page Footer section of the report.

24. Select the Preview tab to review your changes.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 33

Page 34: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Format an Object

25. You now need to format the title. To center the title, first expand the Title field to the same width as the data in

your report. To do this, select the object by clicking it. Position the cursor on the right edge of the object until

the cursor turns into a Resizing cursor. Drag the right edge of the field box until it is even with the right edge

of the data in the Net Sales field object.

26. You have created a large field that extends from the left edge to the right edge of the report. With the report

title object still selected, click Align Center on the Formatting toolbar.

27. Right-click the object and choose Format Field from the shortcut menu.

28. When the Format Editor appears, click the Font tab. Set the report title to a larger, bolder version of the active

font by selecting Bold from the Style list and 16 (or a point size suitable to the font you are using) from the

Size list.

29. Change the color of the text by selecting a new color from the Color palette. Notice that the Sample box shows

an example of how the text will look. Click OK when finished.

30. Drag the bottom edge of the field box down to resize the report title object vertically and accommodate the

increased size of the title.

You should get the following result:

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 34

Page 35: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

The report should look similar to this:

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 35

Page 36: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Grouping & Charting 31. Select the menu Insert > Group and select Distribution Channel as the grouping field.

32. Select the Net Sales Keyfigure and right click on the field.

33. Select Insert > Summary and select a “Sum” for Group #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 36

Page 37: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

34. Right Click the “Detail Section” in the Preview or Design view and select “Hide (Drill down ok)”.

35. Select the menu Insert > Chart

36. Place the chart to the Report Header (RH).

37. Double-click on one of the distribution channels in the chart to drill-down to the details.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 37

Page 38: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Save the Report

38. Select Save on the SAP toolbar (or use the menu SAP > Save) to save your work. The system displays the

“Save a Crystal Report to BW” dialog.

39. Select the role and enter your report Description.

40. Select Save. The system displays the “Save to BW options” dialog. Select OK to save your report to the SAP

NetWeaver BI system.

41. Click OK to save the report to SAP BI.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 38

Page 39: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Creating your First Report with Hierarchies from SAP BI

For this report I am using a SAP BI Query based on the cube 0D_DX_C01 (Demo Scenario DalSegno Company) with the following characteristics:

o Customer with an activated hierarchy

and the following keyfigures

o Billed Quantity o Net Sales

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 39

Page 40: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

1. Select Start All Programs Crystal Reports 2008 Crystal Reports 2008 to start Crystal Reports.

The SAP toolbar will appear on the left of the Start Page display.

2. In the SAP menu, select Settings. The Settings dialog appears.

3. Select Use MDX driver with support for Multiple structures and select OK.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 40

Page 41: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

4. Now you want to change the Initial Setup and show only the description of the characteristic and the key

figures of the BEx query.

5. Select the menu File > Options > Database and set the option “‘Show Description’

Now the Field Explorer will show SAP metadata instead of the technical name for the fields.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 41

Page 42: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

6. In the SAP toolbar, select Create new report from a query. The SAP System dialog appears.

7. Select the system and click Next. Enter your logon information and select OK. The Select Query dialog

appears.

8. Select Roles. Expand the folder and select the query.

The activated hierarchy from the underlying SAP BW query will result in a parent-child

relationship being represented in Crystal Reports.

9. Select the menu Insert > Group.

10. Select the Node ID field from the hierarchy.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 42

Page 43: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

11. Navigate to the Options tab.

12. Select the Customize Group Name Field option.

13. Select the description value for the hierarchy to the Medium Name from the characteristic Customer

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 43

Page 44: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

14. Click OK.

15. Select the menu Report > Hierarchical Grouping options.

16. Select the Sort Data Hierarchically option.

17. Select the Parent Node ID field of the Customer Hierarchy.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 44

Page 45: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

18. Define the Group Indent.

19. Click OK.

20. Hide the detail section of your report.

21. Select the menu View > Print Preview.

22. Enter a date for the keydate variable (use the date of today)

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 45

Page 46: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

23. Navigate to the Design tab.

24. Add a keyfigure to the details section of the report.

25. Right-click the added keyfigure.

26. Select the menu Insert > Summary.

27. Select Sum as the calculation option.

28. Select Group #1 for the summary location.

The option “Summarize across hierarchy” allows creating a group summary by adding values from the

lower level of a hierarchy up to a higher aggregated level. An example would be to summarize salary figures

from the lowest level of an organization hierarchy up to the top level of the hierarchy. In the case of an SAP

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 46

Page 47: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

BW query as a data source the option “Summarize across hierarchy” is not necessary because the underlying

SAP BW query returns the aggregated values for all hierarchy nodes to Crystal Reports.

29. Move the summary to the Group Header #1.

30. Hide the Group Footer #1 in the report design.

31. Preview the report.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 47

Page 48: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Formulas for Hierarchical Reporting

Crystal Reports designer offers some additional formulas and functions that allow the user to create a better report design and provide conditional formatting even in the context of a hierarchy.

Formula Hierarchy Level

The first formula for hierarchical reporting is the formula HierarchyLevel(). The formula HierarchyLevel() allows retrieving the level of the hierarchical grouping.

The formula needs a GroupLevel as input.

The following is an example for the formula syntax assuming Country Node ID is the grouping field in the report:

HierarchyLevel (

GroupingLevel ( {Country Node ID})

)

Count Hierarchical Children

The second formula is CountHierarchicalChildren() which allows counting the number of children of a hierarchy level. The formula needs a GroupLevel as input.

The following is an example for the formula syntax assuming Country Node ID is the grouping field in the report:

CountHierarchicalChildren (

GroupingLevel ({Country Node ID})

)

The count of children refers to the number of children in the hierarchy level.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 48

Page 49: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

Conditional Formatting with Hierarchy Level

With the formulas the report can be conditionally formatted so that the group headings follow an indentation and the keyfigures stay aligned.

To change the formatting of the group headings

1. Start Crystal Reports Designer (Start > Programs > Crystal Reports 2008 > Crystal Reports 2008).

2. Open the report from the previous activity.

3. Navigate to the Design tab.

4. Select the menu Report > Hierarchical Grouping Options.

5. Set the option Group Indent to 0.

6. Click OK.

7. Right-click the Group #1 Name field.

8. Select the menu Size and Position.

9. Click the icon for conditional formatting for the X-axis value.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 49

Page 50: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

10. Enter the following formula:

(HierarchyLevel

(GroupingLevel ({Hierarchy Node ID} )

)

)

*150

In our example the formula would look like the following:

HierarchyLevel

(GroupingLevel

({0D_DX_C01_BUSINESSOBJECTS_QRY_HIERARCHY.[0D_CUSTOMER TEMPORAL JOIN HIERARCHY]-NodeId}))

*

150

11. Click Save and close.

12. Click OK.

13. Select the menu View > Print Preview.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 50

Page 51: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 51

Page 52: Business objects integration kit for sap   crystal reports 2008

BusinessObjects Integration Kit for SAP - Crystal Reports 2008

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 52

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.

Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, System i, System i5, System p, System p5, System x, System z, System z9, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C 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.

MaxDB is a trademark of MySQL AB, Sweden.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.

SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials.

SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages.

Any software coding and/or code lines/strings (“Code”) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent.