• No results found

Using Hierarchies: Sequence (Sort)

Defining Text

Exercise 5: Using Hierarchies: Sequence (Sort)

Exercise Objectives

After completing this exercise, you will be able to:

• Describe the implications of using hierarchies as part of the row structure

• Sort the data after it has been output

Business Example

The management has come to you with an urgent request. They now want to know the details – how much each cost center is spending toward each account.

Task 1:

You have been asked to write another report but need to show a detailed cost breakdown for each cost center. The report should have the following appearance.

Figure 36:

1. The report should provide information for the cost centers listed in the group H1010 and the cost elements in CA705_COST. The general selection criteria throughout the entire report are the controlling area 1000, the current fiscal year, and the periods 1 - 12.

Continued on next page

Name the report Z3##-001 and assign it to the report group Z3##.

Use the library Z## again.

Instructions for defining the report Z3##-001.

- Define Rows - Define Columns

- Define Formula (Variances) Column - Define General Data Selections - Check and Save the Report

- Assign the Report to a Report Group - Execute the Report

2. What explode level did you set for the cost center?

3. What explode level did you set for the cost elements?

4. Modify your report a few times to vary the explode levels for the cost centers and cost elements? Did the report results appear as you expected?

Task 2:

Some employees will want to see the report with emphasis on the cost centers while others will want the emphasis on the cost elements. Create a new report that focuses on the cost elements. The report should have the following structure.

Figure 37:

1. Name the report Z3##-002 and assign it to one of the report groups you created.

2. What did you do to change the sort sequence? What menu path did you choose?

3. In which report group did you place the report Z3##-002? Why?

4. In the report output, how did you switch between reports within the report group?

Continued on next page

Task 3:

For greater flexibility when defining your reports, you use variables for the cost center group, the current fiscal year, the from/to period, and the controlling area.

What impact does this have on the input screen?

Use the following variables:

Char. Variable

Period 1PERIV (From Period)

1PERIB (To Period)

Fiscal year 1GJAHR

1. How do you make reports flexible?

2. Where are you able to use variables in a Report Painter report?

3. Modify the report Z3##-001 to add certain texts. Use the table below as a guide to the information you should display.

Title page Header

Author of report Page x of n

Date of output Controlling area

Report name

Library Fiscal year

Report group Period from, Period to

General Variables:

Characteristic-Related Text Variables (Features):

Solution 5: Using Hierarchies: Sequence (Sort)

Task 1:

You have been asked to write another report but need to show a detailed cost breakdown for each cost center. The report should have the following appearance.

Figure 38:

1. The report should provide information for the cost centers listed in the group H1010 and the cost elements in CA705_COST. The general selection criteria throughout the entire report are the controlling area 1000, the current fiscal year, and the periods 1 - 12.

Name the report Z3##-001 and assign it to the report group Z3##.

Use the library Z## again.

Instructions for defining the report Z3##-001.

- Define Rows - Define Columns

- Define Formula (Variances) Column - Define General Data Selections - Check and Save the Report

Continued on next page

- Assign the Report to a Report Group - Execute the Report

a) Instructions for defining the report Z3##-From the main SAP System menu, choose

Information Systems → Ad-hoc Reports → Report Painter → Report

→ Create or transaction GRR1.

Library: Z##

Report: Z3##-001

Description: Cost ctr. / Cstel

Click Create to access the report definition interface.

Define Rows Double-click row 1.

1. In the Available Characteristic pane, choose Cost Element and Cost Center. Click Move selected to left.

2. In the Selected Characteristics pane, enter the characteristic values for the report. Select for both characteristics. .

Use the following table for the characteristic and the associated values.

Cost element CA705_COST in the From field Cost center H1010 in the From field

3. Select Change Texts. In the Text Maintenance screen, enter the row texts. This text will appear in the Overall Total row. Copy this text to the medium and long text fields. Click Check or Enter.

SelectConfirm.

4. Click on row 1 and choose Edit → Rows → Explode. Choose the Expand option for the cost center and single value for the cost element.

Select Confirm.

Now you have defined the row.

Define Columns

Double-click column 1.

1. In the Select Element Type screen, choose Predefined key figure.

Select Confirm or Enter.

2. In the Choose Predefined Column screen, choose Actual costs.

Click Confirm or Enter.

3. Deselect the variable flag and enter 0 in the From field for the Valuation entry. Click Confirm to accept the screen. This screen shows how the key figure is defined. That is, this screen displays the key figures and characteristics and their values that were used to define the key figure.

You have defined the first column. To define the second column (Planned Costs), you can use a predefined key figure or define the column dynamically (Version is 0, Valuation is 0, Value Type is 1.

Select Confirm.

Define Formula (Variance) Column Double-click column 3.

1. In the Select Element Type screen, choose Formula. Click Confirm or Enter.

2. In the Enter Formula screen, use the push-buttons to define the Variance Column as X001 – X002. Click Confirm or Enter.

3. In the Text Maintenance screen, define texts for the Variance column. Click Confirm or Enter.

Define General Data Selections 1. Choose Edit → Gen. data selection.

2. In the Available Characteristics pane, choose the characteristics that are to be included in the general parameters of the report (see table below). Select the characteristics and click Move selected to left.Click Confirm or Enter.

3. In the Selected Characteristics pane, enter the parameter values for the report. Click Confirm .

Use the following table for the characteristic and the associated values.

Controlling area 1000 in the From field

Fiscal year Current fiscal year in the From field

Continued on next page

Period 1 to 12 in the From and To fields respectively You have now defined the general data selections.

Check and Save the Report

1. Check the report for any error or missing characteristics by choosing Report → Check or use Check or F6.

2. Save the Report by choosing Report → Save or use Save or CTRL+S.

Assign the Report to a Report Group

1. To assign the report to a report group, choose the following in the Report Definition environment: Environment → Assign report group.

2. Enter the value Z3## then select continue. Select Yesto create the Report Group.

Execute the Report

Choose or Report → Execute and . again.

2. What explode level did you set for the cost center?

a) Expand

3. What explode level did you set for the cost elements?

a) Single values

4. Modify your report a few times to vary the explode levels for the cost centers and cost elements? Did the report results appear as you expected?

a) Go back to the report definition by selecting twice. Position on the totals row and select Edit → Rows → Explode. Change the settings for the explode characteristics and re-execute the report with .

Task 2:

Some employees will want to see the report with emphasis on the cost centers while others will want the emphasis on the cost elements. Create a new report that focuses on the cost elements. The report should have the following structure.

Figure 39:

1. Name the report Z3##-002 and assign it to one of the report groups you created.

a) Instructions for defining the report Z3##-002.

1. Choose Information Systems → Ad-hoc Reports → Report Painter

→ Report → Create or transaction GRR1.

2. Enter.

Library: Z##

Report: Z3##-002

Description: Celem w/ CCtr detail Copy from: Z3##-001

Click Create to access the report definition environment.

Continued on next page

2. What did you do to change the sort sequence? What menu path did you choose?

a) Choose Edit → Rows → Explode.

Change the numeric field to the left of the characteristic. Cost element should be set to 1 and cost center should be set to 2.

In addition, cost center should be set to single values and cost elements should be set to Expand.

3. In which report group did you place the report Z3##-002? Why?

a) The report Z3##-002 should be assigned to the report group Z3##

because it extracts the same data as Z3##-001. Choose Environment → Report Group. Enter Z3## and select Continue.

b) Save the report with . c) Execute he report with .

4. In the report output, how did you switch between reports within the report group?

a) Use the menu path Goto → Other Report or double click Other Report.

Task 3:

For greater flexibility when defining your reports, you use variables for the cost center group, the current fiscal year, the from/to period, and the controlling area.

What impact does this have on the input screen?

Use the following variables:

Char. Variable

Period 1PERIV (From Period)

1PERIB (To Period)

Fiscal year 1GJAHR

1. How do you make reports flexible?

a) Use variables to prompt inputs from the user at runtime.

To use variables in the general data selections, choose Edit → Gen.

data selection.

Select the Variable tick box for Period and Fiscal Year.

Enter the corresponding variables from the table above.

Select Confirm and Save . b) Re-execute the report with .

Enter the following Values

Char. Value

Period From 1To 12

Fiscal year Current Year

2. Where are you able to use variables in a Report Painter report?

a) Variables can be used for characteristics in rows, general data selections, or for characteristics used to define key figure columns.

3. Modify the report Z3##-001 to add certain texts. Use the table below as a guide to the information you should display.

Title page Header

Author of report Page x of n

Date of output Controlling area

Continued on next page

Report name

Library Fiscal year

Report group Period from, Period to

General Variables:

Characteristic-Related Text Variables (Features):

a) Choose Information Systems → Ad-hoc Reports → Report Painter → Report → Change or transaction GRR2

Double click on Report: Z3##-001 in Library: Z##

To enter text on the Title page choose Extras → Report Texts → Title Page.

General Variables: Position your cursor where you would like the text to be displayed on the Title Page. Click on Gen. Variables or choose Insert → Standard Variables. Choose your variables. They are marked on the Title Page with a < > symbol. Repeat this procedure for all the standard variables you require.

Note: If you want a description to appear before a standard variable, type the text directly on the page. Go back to the report with .

To put text in a Header choose Extras → Report Texts → Headers.

Characteristic-related text variables (Features): Position your cursor where you would like the selection information to be displayed on the header page. Click Characteristics or choose Insert→

Characteristics. Save the header page tests.

Note: Text type value will give the key and Other text types will give descriptions. e.g. For Controlling Area Value might return 1000 whilst Text would return CO Europe.

Repeat this procedure to define more header texts.

b) Execute the Report with .

Lesson Summary

You should now be able to:

• Explain how report groups are used to generate and execute reports

• Use variables for report definition

• Enter text in reports

Unit Summary

You should now be able to:

• Define the structure of a Report Painter report

• Define rows in a Report Painter report

• Define columns in a Report Painter report

• Define general data selections in a Report Painter report

• Explain how report groups are used to generate and execute reports

• Use variables for report definition

• Enter text in reports

Test Your Knowledge

1. The additional criteria defined for a report restrict the data processed in that report.

Determine whether this statement is true or false.

□ True

□ False

2. You can use the to define formula rows.

Fill in the blanks to complete the sentence.

3. To restrict the characteristics in a column, you can enter intervals or as you do in the case defining single values for rows.

Fill in the blanks to complete the sentence.

4. What are the components of a Report Painter report?

5. List the points in a report where text can be defined.

6. When a report group is generated, the system creates that can be executed.

Fill in the blanks to complete the sentence.

7. When you execute a report group that has reports defined with variables, an appears on the report selection screen for each variable used.

Fill in the blanks to complete the sentence.

Answers

1. The additional criteria defined for a report restrict the data processed in that report.

Answer: True

The additional criteria defined for a report restrict the data processed in that report.

2. You can use the formula editor to define formula rows.

Answer: formula editor

3. To restrict the characteristics in a column, you can enter intervals or groups as you do in the case defining single values for rows.

Answer: groups

4. What are the components of a Report Painter report?

Answer: The components of a Report Painter report are:

• Rows

• Columns

• General data selections

5. List the points in a report where text can be defined.

Answer: Text can be defined at the following points in a report:

• Title page

• Header

• Footer

• Final page

6. When a report group is generated, the system creates ABAP reports that can be executed.

Answer: ABAP reports

7. When you execute a report group that has reports defined with variables, an input field appears on the report selection screen for each variable used.

Answer: input field

Unit 3