Show TOC

 Reusing Report SectionsLocate this document in the navigation structure

Use

You can use report sections that you create in a report in other reports as well. For example, you can insert a page header that you designed in one report in other reports. To do so, you must edit the XML of the report in which an existing report section is to be integrated.

Note the following when editing the XML:

  • A report is stored as an XML file in the BI system, whereby there are two types of XML files: the design time and the runtime XML. You can edit these files directly using ABAP program RS_REPORT_MAINTAIN in the corresponding BI system.
  • The runtime XML should not be edited manually; you should edit the design time XML instead.
  • If you edited the design time XML of a report, you can open and save the corresponding report in the Report Designer in order to refresh it.
Prerequisites

Note that if you use the ABAP program RS_REPORT_MAINTAIN, the following important information is not saved:

  • Reference to data provider
  • Versioning of report
  • Language-dependent texts

This information is only saved if the Report Designer is used to edit the report.

You therefore can only use the ABAP program RS_REPORT_MAINTAIN if you created a report initial with the Report Designer.

To make sure that the above-mentioned information is not stored incompletely, with the ABAP program you can only edit the XML areas of the report that do not contain any BI fields. A report that was edited incorrectly otherwise could not be loaded into the Report Designer.

Procedure

The following example describes how to create two simple reports and then copy the header page of the one report to the other report.

Create First Report

  1. Open the Report Designer by choosing Start → Programs → Business Explorer → Report Designer.
  2. Log onto the BI system.
  3. Choose Insert Data Provider…in the toolbar of the Report Designer and select the required data provider from the Open dialog.
  4. Save the report under a meaningful name, such as Z_REP_EXERCISE_1B, by choosing Report  →Savein the menu bar of the Report Designer.

Create Second Report

You opened the first report you created or, if you closed it in the meantime, open it again.

  1. Choose Insert →Page Headerin the menu bar of the Report Designer.
  2. Choose Insert Image...from the context menu on the cell of the page header. The BEx MIME Browser appears.
  3. Select the image you want to insert or enter the link to the image and choose Insert. More information: Inserting Images into Reports
  4. Save the report under a meaningful name, such as Z_REP_EXERCISE_1A, by choosing Report  →Savein the menu bar of the Report Designer.
  5. Close the report by choosing Report →Close in the menu bar of the Report Designer. This ensures that you do not lock the report.
  6. You now want to copy the page header of this report to insert it in the first report you created. To do so, edit the design time XML of the first report you created.

Edit XML File

  1. Start the corresponding BI system from the SAP GUI and log onto it.
  2. Choose SAP Menu → Tools → ABAP Workbench → Development → ABAP Editor from the SAP Easy Access screen (transaction se38).
  3. Enter RS_REPORT_MAINTAIN in the Program field and choose Execute.
  4. Under Report Name select the report that you last created (in our example Z_REP_EXERCISE_1A) and make sure that you select DT as Report Type.
  5. Choose Execute. The XML view on the report appears.
  6. Choose Edit XML.
  7. Scroll through the XML view until you find the XML section <Page Header>or find this section with the Find/Replace function.
  8. Copy the entire XML section that starts with <Page/Header>and ends with </Page/Header>to a text editor such as Notepad.
  9. Start another session in the BI system and repeat steps 1 to 6, but under Report Name enter the report that you created first (in our example Z_REP_EXERCISE_1B).
  10. Choose Edit XML.
  11. Find the XML tag </BEx Theme>.
  12. Copy the code section inserted in Notepad to the end of the XML tag </BEx Theme>and save the XML file.
  13. Leave the transaction in both sessions of the BI system.
  14. When you now call the report you first created in the Report Designer (in our example Z_REP_EXERCISE_1B), you see that a page header was inserted in the report.
  15. Save and execute the report to see the changes.
Result

You inserted the report section Page Header that you designed for a certain report into another report by making the corresponding changes to the design time XML.