Learn how to configure a comparative financial statement trend with one simple fiscal year and a period input variable using advanced Report Painter and Report Writer functionality, as well as some undocumented SAP functionality.
Key Concept
Since the ERP release on SAP’s NetWeaver Platform in 2005 along with the SAP General Ledger module, the underlying table structure has changed. It is now a hybrid Special Purpose Ledger with the addition of a totals table, as well as actual and plan line items table to summarize transactions and to facilitate transaction analysis. This architecture allows for the use of SAP’s Report Writer and Report Painter functionality to build real-time, function-rich reports from the SAP General Ledger. Report Painter and Report Writer functionality was unavailable on the General Ledger prior to the release of the SAP NetWeaver Platform.
Have you ever wondered how you can extract the wealth of information provided by the SAP General Ledger without having to deal with the logic limitations of the drill-down report utility Drilldown Reports (G/L Accounts), write custom ABAP/4 code, or extract non-real-time data to SAP NetWeaver Business Warehouse? Using Report Painter on the SAP General Ledger FAGLFLEXT table with some advanced and undocumented functions can bring you toward that end.
Note
Report Painter is included in SAP’s Best Practices Building Blocks. SAP’s best practices consist of a broad range of implementation methodologies, preconfigured business scenarios, and ERP configuration guides that traverse multiple industries. Over the years, SAP, its customers, and its partners have developed and refined these best practices to make available the best solutions. These solutions are downloadable from SAP’s help portal, with the Report Painter and the Report Writer being recent additions.
To help you learn how to configure a comparative financial statement trend report (the report consists of a three-period backward balance sheet), I describe the steps to construct report components, demonstrate some undocumented functionality, and display the results:
- Build a reporting library while describing how the SAP General Ledger architecture is a mirror of the old FI Special Purpose Ledger
- Build in the Report Writer input and nested variables to calculate a backward trend
- Copy the financial statement version into the FAGLFLEXT reporting table so that the Financial Statement Version can be used in the Report Painter report
- Build and document the report structure
- Create the report group with drill-down configuration
- Show report results and drill down in the Microsoft Excel window
Step 1. Build your reporting library. Go to IMG path Accounting > Financial Accounting > Special Purpose Ledger > Information Systems > Define Libraries. Then from the Menu Bar select Library > Create (GR21). Enter YGL as the Library Name and FAGLFLEXT as the table name (Figure 1). The Y denotes a configured object with the remaining two positions as free form text. Typically, Y or Z is used when you are configuring an object within the SAP system. The library is simply the allowed fields and key figures that your eventual report uses. The T suffix at the end of the FAGLFLEXT table stands for Totals. This suffix is part of SAP’s Special Ledger nomenclature that the SAP General Ledger has adopted and where your report configuration is based. Other Special Ledger suffixes in the SAP General Ledger area include A for actual line items and P for plan line items.

Figure 1
Create the reporting library
Click the Header tab and enter data in the mandatory Description and Component ID fields (Figure 2). In this case the Component ID field is FI-GL to indicate that you are reporting out of the General Ledger.

Figure 2
The Description and Component ID are mandatory in the Library Header
Click the Characteristics tab and ensure that the options listed in Table 1 are selected with the Check Box indicator.

Table 1
Selected characteristics for the report library
Note
The FAGLFLEXT reporting table includes several options for reportable characteristics. For your purposes, you select only what you need for your trend report so as not to potentially degrade performance. If more reportable characteristics are required after you create a report component, adjusting characteristic selection by piecemeal additions is possible.
You have many key figures from which to choose as you create your reporting library within the SAP General Ledger (Figure 3). This flexibility allows you to bring in additional figures for comparison and calculation purposes quickly and efficiently with simple configuration changes.

Figure 3
Key figures available for reporting in the FAGLFLEXT table
Step 2. Before you create the report, you need to build a few variables to assist you in your trend analysis. Follow the IMG menu path Financial Accounting > Special Purpose Ledger > Information Systems > Define Libraries. Then from the Menu Bar: Report Writer > Variable > Create (GS11). Create the variables from the matrix shown in Table 2.

Table 2
The variable creation matrix for the Trend Report
I have trended back as many as 12 periods across fiscal years in my experience. Building on the variable logic in Table 2 can accomplish this by creating additional variables to return an additional 10 period/year results for the POPER and RYEAR dimensions (YVPER3…12 and YVYEAR3...12, for example) and following the Boolean logic in Table 2.
Figures 4 and 5 show examples of variable creation fromTable 2. Figure 4 shows the YVPER variable, which calls a system-provided algorithm to return the current posting period. Figure 5 shows the creation of YVPER1, which calls the YVPER variable in the syntax and adds Boolean logic to return the proper prior period. The YVPER variable is created and saved prior to the creation of the YVPER1 variable.

Figure 4
A period variable that pulls the current posting period from the fiscal year variant via the Formula exit button

Figure 5
A period variable that calculates the prior period based on the inputted value from the variable in Figure 4
Step 3. Now that you have created the variables for your eventual report construction, you can build your report rows. In this instance you use some undocumented functionality that leverages the Financial Statement Version created with transaction code OB58. The configuration of a Financial Statement Version is simply a general ledger-based, hierarchical arrangement of accounts for reporting purposes (Figure 6). The chart of accounts is analyzed outside of the system and then classified into financials statement line items. You can create or copy multiple Financial Statement versions to suit either external or managerial reporting needs.

Figure 6
An example of a Financial Statement Version within General Ledger Configuration
Previously, accounts or cost elements were grouped independently in their own areas of reporting within the system (such as Cost Center Accounting [CCA] or Profit Center Accounting [PCA]), thus creating the risk of reporting inconsistencies. For example, CCA reports may have their own rows of cost elements or accounts defined for operating expenses, and the general ledger might have its own rows of accounts for operating expense that differ. When you copy the Financial Statement Version from the general ledger into differing modules, the classification of accounts should be consistent. You can maintain managerial report account classifications centrally in the Financial Statement Version and copy them to other reporting tables. This feature offers advantages and disadvantages as far as flexibility and potential recopying if classifications change.
Note
The advantage of copying the Financial Statement Version out to other SAP modules is the central control of the account classifications within the General Ledger for internal and external reporting. That is, the accounts are classified centrally in the SAP General Ledger and propagated out to the reporting tables in Cost Center Accounting, for example. This copying saves the steps and inconsistencies of creating account classifications in the individual reporting areas themselves. One disadvantage of this method of copying is when the Financial Statement Version classification changes within the General Ledger, a recopy of the Financial Statement Version to the FAGLFLEXT and CO (Controlling) tables must occur to ensure consistency in reporting.
To copy the Financial Statement Version into the SAP General Ledger reporting table, execute program RGSBIL00 with transaction code SA38 (Figure 7). Populate the Financial Statement Version (Fin.Stmt.version). Select the Set radio button. Input YGL as a prefix to distinguish the entry in matchcode selection. The table is FAGLFLEXT. The Field Name is RACCT, which denotes the account number. Click the execute icon
to execute.

Figure 7
The program to copy a Financial Statement Version to the SAP General Ledger reporting table
Once the program is executed, the results are returned in Figure 8 in a Report Writer set creation screen. Ensure that you save the results by clicking the save icon.

Figure 8
Results of a copy program (a “set” of accounts is created)
Step 4. Now you execute the Trend Report Creation. The report that you are configuring consists of a three-period backward balance sheet trend. The fiscal period and fiscal year are inputted by the user and the configuration counts a total of two periods back along with the applicable fiscal year from the inputted values and return year to date results of balance sheet figures for each period/year.
Go to the implementation guide to build your report. Follow IMG path Financial Accounting > Special Purpose Ledger > Information Systems > Define Libraries. Then from the menu bar select Report Writer > Report Painter > Create Report (GRR1). Input the library from step 1 by typing or using the dropdown box with the wildcard *Y*. The input screen is shown in Figure 9.

Figure 9
The report creation screen
You now see the report shell screen (Figure 10), which you navigate to assemble your three-period backward Balance Sheet Trend.

Figure 10
The report shell
Place your row sets into the report shell. These row sets were created in Step 3 by copying the Financial Statement Version into the FAGLFLEXT reporting table. Double-click Row 1 from Figure 10 and enter the Assets and Liabilities set names in separate rows via the dropdown box or by typing as shown in Figure 11.

Figure 11
Create a row using account groups copied from the Financial Statement Version
Now you create your columns in the report shell. Each column that you create returns a year-to-date balance that is restricted by a fiscal period. Because you are building a trend report, the first period and year will be the base, and the remaining two columns will trend backward from the base without user intervention by the design of your variables in Table 2. Double-click Column 1 (Figure 10) and select the YVYEAR and YVPER variables that you created in step 2 (Figure 12). Note the Record Type and Version Selections that are coded in Figure 12 correspond to actual data. The Record Type and Version values are required to retrieve actual data, and if these values were not accounted for, an error message would be returned. You can create columns that display plan data by changing the values in the Record Type and Version Selections to those that correspond to plan data.

Figure 12
Column creation using Fiscal Year, Record Type, Version, and Posting period selections
Add two additional columns by repeating the Record Type and Version selections along with the variable combinations YVPER1, YVYEAR1, and YVPER2, YVYEAR2 from Table 2. This step completes the column creation for the remaining two period/year combinations in your trend.
Now you are ready for the General data selection (Figure 13). The selections you make here affect the report globally and account for the dimensions that are not already accounted for in the column selection. For instance, you could choose Profit Center within the general data selection to globally run the report by profit centers while the time selection is being restricted in the column definitions (Figure 12).

Figure 13
General data selection for the report
Step 5. The final configuration step is to insert the report into a report group so that you can execute the report that you just created to review your results. Go to IMG menu path Financial Accounting > Special Purpose Ledger > Information Systems > Define Libraries. Then from the menu bar Report Writer > Report Group > Create (GR51). Input the library from step 1 as this is a requirement of the system and matches the dimensions and key figures of the library to the report definition. Enter a description. Click the first Configure button under the Report/report interface to populate the drill-down transaction (Figure 14).

Figure 14
The Header screen of the report library
A pop-up appears (Figure 15) after you click the first Configure button under the Report/report interface tab. Clicking the insert row icon and then the Other Report Type button brings you to the pop-up where the RT ABAP report program is selected and the FAGL_ACCOUNT_ITEMS_GL program is entered. The results are shown in Figure 15. This program adds the functionality to drill back to the original accounting documents and then to the originating transactions from the accounting interface. There are other options for drill back, such as other Report Painter reports or Drilldown Reports, but for your purposes, you display the line items on the General Ledger Accounts.

Figure 15
Drill-back report pop-up and configuration within the report group
You now add the report created in step 4 to the Report Group. Click the Reports button from Figure 15 and add the report name from Step 4 (Figure 16). To execute any Report Painter or Report Writer report. By SAP rule, the report must be included in a report group.

Figure 16
Population of the report in the report group (multiple reports can be contained in one report group)
Step 6. You are finally ready to run the report. Go to IMG menu path Financial Accounting > Special Purpose Ledger > Information Systems > Define Libraries. Then from the Menu Bar Report Writer > Report Group > Execute (GR55).
Note
The execution of a report group is available in many different menu paths within the ERP environment. Custom transaction codes can be created quite easily for report execution, but this topic is beyond the scope of this article.
You now execute the Report Group by clicking the execute icon
(Figure 17).

Figure 17
Report Group execution screen
Upon execution, the selection screen is displayed (Figure 18). In this case, you are calling the Current Fiscal Year and Current Posting Period data. The data is defaulted from your variable creation in Step 2 and inclusion of these variables in the report column definition in Step 4. The variable values can be changed at runtime to output a differing fiscal year and period trend result.
Note
If required, you can open dimensions such as Company Code and Profit Center for user input.

Figure 18
Report variable input
Click the execute icon once again to display the results in an Excel window (Figure 19). You do have the option of displaying the output in the SAP GUI or a spreadsheet interface by clicking the options icon
. Notice the crossing of fiscal years in the backward trend in the right window of Figure 19.

Figure 19
A balance sheet trend
Double-click a figure that is highlighted in white to drill down online and in real time to a fully customizable SAP List Viewer (ALV) grid. Further drill down to the document is available by double-clicking the display document icon
once (Figure 20).

Figure 20
Drill down to a configurable ALV grid
Additional configuration can be done to compare actual data against plan data, open additional variables for user selection, add mathematical operations, and even add fields to the SAP General Ledger from which you can report.
Justin Gurski
Justin Gurski has more than 17 years of experience implementing SAP solutions in the finance, controlling, and business intelligence areas. Prior to becoming an SAP consultant, Justin worked within various industries in finance, cost accounting operations, and system areas with increasing responsibility. He holds a CPA license, a BBA in accounting and management sciences, and an MBA in strategy and information systems.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.