SAP Query Reporting
As discussed in Chapter 3, "Creating Basic Reports with the SAP Query Tool," creating basic lists with the SAP Query tool involves five basic screens. To create a statistics list, you follow the same steps, except that instead of clicking the Basic List button on the Selections screen, you click the Statistics button instead to bring up the Statistics Structure screen instead of the Basic List Structure screen. To create a statistics list report by using the SAP Query tool, follow these steps:
Helpful Hint You can use the Next Statistic button to create an additional statistic for the same query. You can define up to nine statistics for each query.
Details of the Options Available on the Statistics Structure Screen
The following sections describe the options that are available on the Statistics Line Structure screen (refer to Figure 12.2) of the SAP Query tool. Title
This entry field allows you to enter a name for your first list. This title is used as the list header. Field
All fields selected during the report creation process are listed here. No (Sequence Number)
This column defines the sequence of fields within a statistic. You can assign sequence numbers between 1 and 98. When you define a statistic, the data is usually summarized (that is, several data records are processed to determine one line). With numeric fields, only the total is output. Note Statistics that do not contain numeric fields do not make sense, because there is no data summarization. No (Sequence)
This column defines the sort sequence in the statistic. You assign a sequence number for sorting to every field on which you want to sort. The highest sort criterion must have the lowest sequence number, the next sort criterion a higher sequence number, and so on. It makes sense to assign the sequence numbers starting with 1 and in ascending order, without breaks (that is, the highest sort criterion should receive number 1), but this is not required. De (Descending)
You can select this check box to sort the field in descending order. Su (Subtotal)
If you select this field, ABAP/4 Query generates subtotals for the sort criterion in the statistic. (That is, whenever the sort criterion changes, a line containing the relevant subtotals is output.) If you want to calculate subtotals for a field (sort criterion) in a statistic, you should be aware of three conditions:
Thus, if you want to generate a subtotal for the third field (Sequence Number 3), you must sort by this field and by both preceding fields. Because the sort sequence must also be in ascending order, the first field must have the sort number 1, the second field the sort number 2, and the third field the sort number 3. For example, you cannot calculate subtotals if the first field (Sequence Number 1) of a statistic has the sort number 2 and one of the following fields has the sort number 1. In that case, no subtotals can be calculated for any of the fieldsnot even the first. NS (Page Break)
When you select this field, page breaks are inserted in your statistic for each sort string; that is, each time the sort string changes, a new page is displayed. To use this page break function for a particular field, three conditions must be met:
For example, if you want to insert page breaks for Field Number 3 (Position 3 in the sort sequence), this field and both of the fields preceding it must be sort fields (that is, the system must sort according to them). Because the sort order must be ascending, the first field must have sort number 1, the second field sort number 2, and the third field sort number 3. In the example described in this chapter, you may not display with page breaks. If the first field contained in the statistic (Sequence Number 1) has sort number 2 and one of its subsequent fields has been assigned sort number 1, page breaks may not be displayed for any of these fieldsnot even for the first one. No (Display)
This field is for retrieval of information about processed data records. This field appears only for fields in the database that are tied to numbers (for example, Currency is tied to a currency code such as USD. 1). Suppose you want to create a country sales statistic, and you choose the fields Country UD and Sales. If you want to see the total sales for each country, you simply select the column Display for the field Sales. Av (Average)
If you select this field, an average value is calculated for the field entered on the left for the individual summands. % (Percentage)
If you select this field, the percentage of the field of the sum total is output. Len (Length)
When you select this check box, the field is output in the list with its standard output length. You can alter the field width (length) in this field to improve the layout of a list. Rnd (Rounding Factor)
You use this field to specify the number of decimal places to be used when rounding. For example, if you specify 3, the resulting amounts have three places before the decimal point (that is, round to the nearest thousand). Init (Unit of Measurement)
This field appears for any field tied to a unit of measurement (for example, currency, weight). Text
If you select this field, the values of the field specified on the left are used to generate the text for SAP Business Graphics. If you select several fields, their values are used in the sequence in which they occur. SAP Business Graphics processes up to 30 characters of text per value. |