Professional Documents
Culture Documents
We consider the transaction data in Profitability Analysis to include the segment table CE4xxxx (the profitability segments), the segment level CE3xxxx (the period values for the profitability segments) and the two line item tables CE1xxxx (actual line items) and CE2xxxx (plan line items). In these table names, xxxx stands for the name of the operating concern. In other contexts, the profitability segments have more the character of master data.
Date: 30.01.2003 08:30:00 vorm.
Page 1 of 40
SAP AG
transaction data in summarized form. Summarize2 means to group the original profitability segments together into new segments that no longer contain some characteristics: profitability segments from the original dataset that have the same definition after the values of these characteristics are replaced by the INITIAL value are grouped together in the summarization level as one segment. The system adds up the values in the value fields of the involved segment level records. Example: Let us look at an operating concern E001, which contains the characteristics Customer and Product and the value field Revenue. The segment table CE4E001 contains the following profitability segments: (PS = profitability segment): PS 1 Customer 1 Product 1 PS 2 Customer 1 Product 2 PS 3 Customer 1 Product 3 PS 4 Customer 2 Product 4 The segment level CE3E001 contains the following period values:3 PS 1 Period 001/1997 Revenue USD 100.00 PS 1 Period 002/1997 Revenue USD 90.00 PS 2 Period 002/1997 Revenue USD 80.00 PS 3 Period 002/1997 Revenue USD 70.00 PS 4 Period 002/1997 Revenue USD 110.00 If this dataset is summarized across the characteristic Product (i.e. if the product is ignored), we obtain the following summarized segments:4 PS 5 Customer 1 Product INITIAL PS 6 Customer 2 Product INITIAL and the periods PS 5 Period 001/1997 Revenue USD 100.00 PS 5 Period 002/1997 Revenue USD 240.00 PS 6 Period 002/1997 Revenue USD 110.00
The terms aggregate and aggregation also appear frequently in the literature. The characteristics Plan/actual indicator, Record type and Plan version are also included in the segment level. However, this information is irrelevant to helping you understand the subject matter and was therefore excluded. These could also be the profitability segments in operating concern E001 if Product had not been included as a segment-level characteristic. See the chapter under Tools Summarization levels in the online documentation and in Customizing. The terms that are explained there will be used in this document without further explanation.
Date: 30.01.2003 08:30:00 vorm.
Page 2 of 40
SAP AG
assessment of cost center costs to CO-PA (for the purpose of determining the tracing factor based on variable shares) You could also use summarization levels in drill-down reporting by activating the Information system button in Customizing6 when defining the summarization levels. If this flag is active (Use summarization levels in reports), the system reads summarization levels when you execute reports. If the flag is not active (Use summarization data (as in Release 2.2)), the summarization levels are not used for reports. Instead, the system reads the summarization stored separately for each report, a technique that was already available in Release 2.2 and is explained in detail in OSS note 21773. Note that the decision to use summarization levels in reports only can be made once for each operating concern, whereas you can decide separately for each report whether or not you want to use summarization data (provided that the flag Information system is set to Use summarization data (as in Release 2.2)). This means that you cannot store summarization data for any individual reports once you have set the flag to Use summarization levels in reports.7 This does not affect the option to freeze report data.8 Note: For operating concerns created in Release 3.0C or higher, the Information system flag is set to Use summarization levels in reports by default. For operating concerns from Release 3.0B or earlier, the default setting is Use summarization data (as in Release 2.2) even after an upgrade to Release 3.0C or higher. In many of these operating concerns, the customers have optimized their reports for the use of summarization data. This presetting was chosen so that the customer can easily continue using the system as before after the upgrade. You can switch to Use summarization levels at any point in time. It is also possible to switch back to using summarization data at any time. If you want to do this, see OSS note 70339.
Data Structure
Every summarization level consists of two tables (similar to the data basis itself9): the key table corresponds to the segment table and contains those market-oriented characteristics10
6 7
8 9 10
Transaction KEDV In some customer projects both summarization levels and summarization data are being used simultaneously with the support of the SAP development team. For more information, see note 82468 (not released for customers). See the online documentation or note 21773. See note 21773 in OSS, section 3. Market-oriented characteristics in this documentation are those characteristics that are stored in the segment table CE4xxxx. This includes the characteristics to which values can be assigned. In addition to
Date: 30.01.2003 08:30:00 vorm.
Page 3 of 40
SAP AG
that were selected for the summarization level, plus the plan/actual indicator and plan version. The summary table contains the transaction-specific characteristics Period, Fiscal year and Record type, plus the value fields and quantity unit fields.11 Example: Let us look at operating concern E001 again. If we define a summarization level 0001 that contains the characteristic Customer, but not Product, the key table will look like this: Key no. 1 Customer 1 Product INITIAL Key no. 2 Customer 2 Product INITIAL and the summary table will look like this: Key no. 1 Period 001/1997 Revenue USD 100.00 Key no. 1 Period 002/1997 Revenue USD 240.00 Key no. 2 Period 002/1997 Revenue USD 110.00
Read Access
A Formula for Measuring Reading Speed
The system reads the summarization levels the same way it reads the data basis (see section ). Take R to be the reading performance in records per second. This value is a constant which also depends on the hardware one is using. This value needs to be redetermined for each installation.12 The following formula yields the time needed to read a report from a summarization level: Tread [sec] = N Pv ( 1 + Pp ) / R The letters in this formula mean the following: N is the number of combinations of values of the required market-oriented characteristics in the key table. Pv is the number of plan versions being read (actual data counts as one version in this context). Pp is the number of combinations of periods and record types (including the full number of periods for each fiscal year in the report). The appendix (section ) contains a detailed description of how the system accesses the data,
the market-oriented characteristics, there are also transaction-specific ones -- Record type, Plan/actual indicator, Plan version and Period that are stored in the segment level CE3xxxx. Furthermore, there are technical characteristics that are only updated in the CO-PA line item (Cost object, WBS element, and so on) but are not included in the segment table or the segment level. Using the settings in Customizing (transaction KEDV), you can only influence the structure of the key table. As an initial estimate for reading performance, you can expect approx. 500.000 records per hour (approx. R=140 records per second). In contrast to the practice recommended in note 21773, it makes sense to calculate the read time in seconds, because we are interested in how long it takes to read online. Reading from summarization levels yields better performance than reading from the segment level because the data structures contain fewer fields and are designed more for the purpose of allowing efficient access than for business functionality.
Date: 30.01.2003 08:30:00 vorm.
11
12
Page 4 of 40
SAP AG
how the above formula was deduced, and briefly how to find the reading performance that applies for your system. The formula was referred to here only to show which parameters you can influence if the read times are too long.
Calculating the Runtime As described in section , summarization level 000001 can be used to select this report. Let us now apply the formula from section : As we have said earlier, all the combinations of customer group and product group have received postings in all periods. Thus N = number of customer groups number of product groups = 1000. Furthermore, it is clear that Pv = 2 (one for the actual data plus the plan version) and Pp = 24 (2 years 12 periods and only one record type). The read time required for this report is: Tread [sec] = 1.000 2 ( 1 + 25 ) / R Page 5 of 40 SAP AG
If we assume that R = 140/s (our first estimate above), we obtain a read time of 371 seconds, or about 6:11 minutes. This amount of time is surely not acceptable in most cases. Potential for Optimization Assume we have a second summarization level 000002 which contains the characteristics Customer group, Fiscal year, period, Plan/actual indicator, and Record type. If we reduce our requirements so that it is no longer possible to drill down to the product group level in the same report, we can read the report data from summarization level 000002, and the number of combinations of characteristics is reduced to 10. The time needed to read a report defined in this way (SALES2) would be less than four seconds. As you will see in section , you can then jump to report SALES1 for a single customer group. In this case, however, the customer group serves as a selection criterion. This reduces the number of combinations of characteristic values that the system has to read to 100 (every possible product group for that customer group). The time the system needs to read this data for SALES1 is thus reduced to about 37 seconds. Read times of this length are usually acceptable. From the users point of view, the system displays the first list (customer groups) on the screen almost immediately. When the user double-clicks on a customer group to see the product group level, he or she has to wait 37 seconds.
SAP AG
the characteristics in the general data selection (header) the characteristics specified in the lead columns (or rows and lead columns) the characteristics that occur in the value columns13 For the complete planning functions (such as Copy complete plan), these are the characteristics Period (or Week), Plan version, Record type and Plan/actual indicator, which appear on the initial screen of the functions the characteristics specified in the selection criteria with either an asterisk (*) or a fixed value (on the Characteristics screen). (For top-down distribution, this also includes the characteristics in the distribution level!) If you enter a fixed value for a characteristic in the definition of the summarization level14 (instead of an asterisk (*)), exactly this value of the characteristic must be selected by the selection criteria. For example, if you have defined a summarization level for controlling area 0001, this controlling area must appear explicitly in the report, planning layout, etc. (for example, in the general data selection), even if the database contains no other data. If this selection criterion is not specified in the report, etc., the system cannot use the summarization level. Furthermore: 1. If a characteristic is a constant, i.e. if it only has one possible value in the entire operating concern, you should either exclude this characteristic entirely from your summarization levels or include it with an asterisk (*). 2. It normally does not make sense to enter fixed values for characteristics in summarization levels. This is designed solely for when you want to access separate datasets of very different size. Example: There is no advantage in defining four separate summarization levels for four separate company codes 0001, 0002, 0003 and 0004 of similar size if the summarization levels differ only in the fixed value for the company code. Example: However, if one of the company codes (0001) is very large in comparison to the others, and if you do not need a summarization level to analyze this company code, it may make sense to create one summarization level each for company codes 0002, 0003 and 0004.
14
If you display characteristics as attributes in the value columns, the system determines these via characteristic derivation instead of reading them from the summarization level. However, these characteristics should still occur in the summarization level, as you will see in section . See also the section Defining Summarization Levels in the Extended Help for the maintenance transaction (transaction KEDV).
Date: 30.01.2003 08:30:00 vorm.
Page 7 of 40
SAP AG
012/1997, Record type F. The form has two columns: Actual data is to be compared with plan version 001. It also contains several rows displaying individual products. The detail screen looks something like this:
Actual revenues Dr. Miller's Spot-Be-Gone 0.2L Wishy Washy Sponge small Hair-o-fix Hair Restoring Powder 200g Fixolan Fast-Drying Glue 5g 9,968,745.00 6,622,343.00 2,097,509.00 2,588,045.00 Plan revenues (version 001) 10,000,000.00 7,000,000.00 2,000,000.00 2,500,000.00
We now want to create a report based on this form. We want to make the following settings: Characteristics screen: Customer district, Customer group Characteristic Values screen: local variable ($1) for the customer group, nothing for the customer district Variables screen: fixed value 01 for the customer group A summarization level can only be used for this report if it contains the characteristics Period Record type Plan/actual indicator Plan version Product Customer group Customer district (from the general data selection in the form) (from the general data selection in the form) (from the definition of the columns in the form) (from the definition of the second column in the form) (from the definition of the rows in the form) (from the selection criteria for the report) (as a drill-down characteristic in the report)
The characteristics Record type and Customer group can be specified with either an asterisk (*) or the fixed values F and 01.15
As stated earlier, this is not generally recommended. This strategy for choosing the summarization level is not a released R/3 interface. It can be changed in a later R/3 release without further notice.
Date: 30.01.2003 08:30:00 vorm.
Page 8 of 40
SAP AG
This strategy was defined in accordance with the basic rule for customizing summarization levels that When you include a characteristic in a summarization level, you should also include all the characteristics that can be derived by this one!17 This will not increase the size of the level. Example: If a summarization level contains the characteristic Customer, it should also contain all the characteristics that were taken from the customer master records for your operating concern.18
18
19
There are other dependencies between characteristics apart from derivation, such as the relationship between levels of the product hierarchy MARA-PRDAH in Profitability Analysis in Release R/3 3.0/3.1. Here the characteristics (WWPH1, WWPH2, WWPH3) are read from the field MARA-PRDHA using the derivation table technique: WWPH1 = MARA-PRDHA+0(5) WWPH2 = MARA-PRDHA+0(10) WWPH3 = MARA-PRDHA+0(18). In such an instance, if a summarization level contains the characteristic WWPH2, it should also contain WWPH1, even if the later is not technically derived from WWPH2. If the summarization level contains characteristics from the SD table KNVV of the customer master, the level should also contain the fields that make up the sales area (fields VKORG, VTWEG and SPART) in all practical instances. Once defined, each summarization level has the status Active, without data. The next thing you have to do is fill this summarization level with data, or build the summarization level! Only then can this level be updated. This also is true if you defined the summarization level before going live with your system and want to clear the data in Profitability Analysis when you go live (delete the contents of the segment
Date: 30.01.2003 08:30:00 vorm.
Page 9 of 40
SAP AG
to build the summarization levels. The system builds summarization levels the same way it selects data from the data basis (CE3xxxx, CE4xxxx) for reports, namely using a nested select (see section ) and then summarizing the selected data according to the definition of the summarization level. The time required for reading the data can be estimated using the formula in section . Unlike with reports, however, for summarization levels the system also has to insert the data read in the tables for the summarization level. The additional time required to insert and update the data in the database thus also needs to be included in the total time required.
20
21
22
table, segment level and line item tables). In Release 3.0C an incoming buffer is used, which imports a few thousand data records, summarizes them for all summarization levels and then writes them to the database. The default setting allows 20 MB of space for the outgoing buffer. If you use the expert mode (program RKETRERV, also accessible from transaction KEDW from R/3 Release 4.0 onward), you can also specify a different size. in the structure of the key and summary tables.
Date: 30.01.2003 08:30:00 vorm.
Page 10 of 40
SAP AG
# of Updates
size of CE3xxxx
size of buffer
size of SL
These results for summarization levels that are larger than the available buffer yield the following rule: Create as few summarization levels as possible. A summarization level should be regarded as large if the size of the key and summary tables together exceeds 20 MB.23
23
Calculate the number of records in the key table record length in key table + number of records in summary table record length in summary table. If you use the expert mode RKETRERV, this limit can be raised considerably. Please keep in mind the total amount of memory in your application server, especially if you want to run multiple instances the program in parallel.
Date: 30.01.2003 08:30:00 vorm.
Page 11 of 40
SAP AG
1. Build all the small summarization levels together in the first run. 2. Then build the large summarization levels individually, one after the other (or simultaneously on different application servers). 3. Once all the summarization levels have been built, update them again in one final run. This procedure has the following advantages: Small summarization levels that are summarized to a high degree are immediately available for online use. If the long jobs for large summarization level abend due to database problems (database is full, snapshot too old in ORACLE 7.2, etc.), you can still run reports that display summarized data. The detail reports can be run later. If the data is distributed favorably across the available hard drives24, you can run the jobs for large summarization levels simultaneously. When you update all the levels together at the end, you achieve the same currentness in all levels, so that any two reports always have consistent data even when they read it from different levels.
Update Times
Since summarization levels are updated in a similar fashion to the way they are initially build, the time required for performing inserts is also similar. In the graphic above (), the text for the horizontal asymptote should simply be replaced with number of line items to be processed (new line items not already contained in the level). The update is similar to the update of summarization data in the so-called delta read method available in R/3 Release 2.2.25 Thus the same restriction applies: When building and updating summarization levels, you should always allow a safety period of 30 minutes between the build or updated and any jobs that post mass data to Profitability Analysis.26 Otherwise some of the new line items may not make it into the summarization level, meaning that the level does not have the state that should be expected after the update. In most practical situations, it makes sense to update the summarization levels on a daily basis.
24 25 26
For example, using striping techniques. For more information, see OSS note 35288. See also section 4.3 and chapter 9 in note 21773 in OSS. Especially monthly billing runs, external data transfers, mass postings in FI, and order settlement. Problems may also occur with long-running updates if manual postings are also constantly being made (such as when orders are posted).
Date: 30.01.2003 08:30:00 vorm.
Page 12 of 40
SAP AG
Levels 000001 through 000004 form a stack, with 000001 being at the top and 000004 at the bottom. We can represent this stack in a graphic as follows:
Page 13 of 40
SAP AG
Summarization level 000001: Plan/Actual Indicator, Fiscal Year, Period, Version, Record type Summarization level 000002: Plan/Actual Indicator, Fiscal Year, Period, Version, Record Type Assortment Summarization level 000003: Plan/Actual Indicator, Fiscal Year, Period, Version, Record Type Assortment, Brand Summarization level 000004: Plan/Actual Indicator, Fiscal Year, Period, Version, Record Type Assortment, Brand, Product Group
First we will only look at the profitability segments, i.e. table CE4xxxx. Later we will also consider the duplication caused by the segment level CE3xxxx (new key fields for period, record type, plan/actual indicator, version, or period values). The effects of occasionally adding new line items will also not be considered here.
Date: 30.01.2003 08:30:00 vorm.
Page 14 of 40
SAP AG
The report contains those records from the segment table that for the base of the triangle extended downward (light green). Internally, the report only stores the data in summarized for, without the characteristics not used in the report. This level corresponds to the base of the report triangle.
Selection
Drill down
Summarization
CE4 to be read
28
We also assume that characteristics included in the selection criteria (general data selection, initial screen, variables, etc.) are not selected for drilling down. Later, it will become clear why this limitation also need not play a role.
Date: 30.01.2003 08:30:00 vorm.
Page 15 of 40
SAP AG
Actual 1-3/1997 Sales quantity Revenues Discounts Cash discounts Net revenues Sales commission Goods usage Var. production costs Contribution margin I Fixed production costs Fixed material costs Contribution margin II Administrative costs Gen. marketing costs Sales costs Research & development Profit Profit / Unit sold 345,253 2,002,467.40 68,083.89 36,044.41 1,898,339.10 160,197.39 552,404.80 40,049.35 1,145,687.56 56,800.00 21,565.00 1,067,322.56 79,788.00 110,345.00 324,445.00 55,677.00 497,067.56 1.44
Plan 1-3/1997 300,000 1,740,000.00 60,900.00 34,800.00 1,644,300.00 174,000.00 450,000.00 31,320.00 988,980.00 60,000.00 20,000.00 908,980.00 80,000.00 120,000.00 300,000.00 60,000.00 348,980.00 1.16
Var. % 15.1% 15.1% 11.8% 3.6% 15.4% -7.9% 22.8% 27.9% 15.8% -5.3% 7.8% 17.4% -0.3% -8.0% 8.1% -7.2% 42.4%
Previous periods Current period Sales Plan Met Prev.yr Sales Plan Met Prev.yr 1000 l 1000 l % % 1000 l 1000 l % % 10,034 10,000 100.4 105.7 5,340 5,000 106.8 111.3 15,134 15,000 100.9 110.5 4,356 7,500 58.1 65.4 12,024 13,000 92.5 100.3 5,003 6,500 77.0 93.5 12,890 13,000 99.2 92.5 6,934 6,500 106.7 101.0 17,375 14,000 124.1 130.7 6,083 7,000 86.9 91.4
Exercise
Create a number of summarization levels for any report (green in the graphic in section ) a series of summarization levels for the structure shown in . It should be acceptable for a user to run this report online. Hint: Split the report into two or more stages (yellow) that are linked using the report/report interface (red). Create suitable summarization levels (blue) for each of the stages.
Page 16 of 40
SAP AG
Stack
S1
Stages Summarization Levels
R1=S2
R2
Note: Every report created is based on the same form. The function Split report splits a report into two new reports: a sender report and a receiver report. If you want to create a stack with several stages, you should proceed from top to bottom. Your flexibility in drilling down through the report is somewhat reduced when you split the report. Consequently, performance optimization often conflicts to a degree with the users requirements. In many cases, however, tenable compromises can be achieved. A summarization level can be considered optimal for a report if it contains exactly those characteristics that the report needs as selection criteria or drill-down characteristics (and, of course, those characteristics that are derived from those). Compare this approach with the representation in section !
SAP AG
(because all the values of these characteristics are aggregated). Then specify those characteristics that are used as selection criteria for the first sender report (the initial report). We will refer to these characteristics as SEL. The other characteristics are drill-down characteristics and are referred to as DRI. Now sort the characteristics DRI into the desired order. We will number these characteristics according to the sort order: M1, M2, M3, M4, ...
You can now start with M1 and add characteristics from DRI to the initial report in the order specified for the drill-down sequence in until the above formula yields a read time that you consider acceptable for an online report. In summary: Starting with any report, you have sorted the drill-down characteristics (= DRI) into the desired order and then successively added characteristics to the initial report in this order until you obtain the longest acceptable read time for an online report.
Defining Jumps
A good way to divide a whole report into a stack of sender and receiver report is to use the method described in section , repeating it as often as necessary. For the report that follows the initial report, the only things that change are the available drill-down characteristics and the fixed selection criteria: The characteristic chosen for the summarization level for the first report are taken out of DRI and included in SEL. Then you can use the same method again to choose characteristics for the receiver report in the second stage. Based on the graphics in sections and , this would yield the following graphic showing how each stage is constructed:
Top Stage 2nd Stage 3rd Stage
SEL
SEL
SEL
S1
DRI
R1=S2
DRI
R2
DRI AGG
AGG
AGG
For the stages lying further down, the quantity of DRI keeps becoming smaller, as characteristics are removed from DRI and included in SEL. You now have to create a summarization level for each report in the stack. In each case, the summarization level should contain the same characteristics as in SEL and DRI.
Page 19 of 40
SAP AG
Data Currentness
When you define reports, you can choose from the following options regarded how current the displayed data should be: current data (up to the second, i.e. realtime) or last update of the summarization level In the latter case, the system reads and displays the data for the report from the most suitable29 summarization level. If you choose to display the current data, the system also has to read those line items that have been entered since the last time the summarization level was updated (delta read method, as described in note 21773, section 4.3). The runtime required for this depends on how many new line items have been entered since the last time the summarization level was updated. You should define most reports so that they do not read any line items in addition to the summarization level. The delta read method should only be used if it is absolutely necessary that you have the most up-to-the-minute data. Normally you will use the report/report interface to jump back and forth between a number of different reports, each of which has read the data from a different summarization level. In order to receive consistent data in all of these reports, you need to make sure that all the reports in the stack contain the current data or all the summarization levels from which the data is read were updated at the same time. 1. In most cases, the only simple solution is to update all summarization levels at the same time. 2. It almost always makes sense to update the summarization levels on a daily basis.30
Page 20 of 40
SAP AG
Revenue Product groups Hair tonic Bubble bath Moth powder Toothpaste Soap Baby powder Total Strategic products Schwipps 3000 Airosan 2,0 l Dr. Miller's Anti-moth
Customer groups Wholesale 4,533,508.00 5,453,372.00 835,482.00 343,554.00 56,578.00 2,342.00 11,224,836.00 3,944,151.96 3,653,759.24 634,966.32
Retail 5,453,412.00 5,237,866.00 246,584.00 545,432.00 74,743.00 7,653.00 11,565,690.00 5,289,809.64 2,566,554.34 192,335.52
Customer Miller 3,334,587.00 4,956,798.00 67,364.00 456,875.00 61,070.00 4,008.00 8,880,702.00 3,001,128.30 2,478,399.00 40,418.40
Share of RE 61.1% 94.6% 27.3% 83.8% 81.7% 52.4% 76.8% 56.7% 96.6% 21.0%
To obtain the data contained in the lower right-hand corner (highlighted in red), the system needs to read the data at the customer/product level. Regardless of the other selection criteria in the report and the selected drill-down characteristics, the report has to read the data at the most detailed level. Using the report/report interface and summarization levels, you can hardly improve this. for this report it makes the most sense to run the report in the background and freeze the data. Detailed characteristics in rows or columns can dominate the system runtime. Where possible, define rows and columns using only key figures and transaction-oriented characteristics, such as Period, Record type, Plan/actual indicator and Plan version. Try to use multiple reports and the report/report interface to fulfill such requirements.
Chapter describes a system for supporting almost any report with an appropriate stack of summarization levels so that it can be executed online.
Date: 30.01.2003 08:30:00 vorm.
Page 21 of 40
SAP AG
that are designed in such a way that the characteristic combinations are nested within one another, i.e. one of the two summarization levels is always the larger one that contains all the characteristics of the smaller one. These summarization levels are then used by reports that require data at exactly the level of detail contained in the summarization levels. The user jumps from higher (i.e. less detailed) sender reports to the more detailed receiver reports: The sender report reads from the less detailed summarization level. The user navigates through the characteristics in that report until all have a specified value, and these values then serve as selection criteria for the receiver report, which reads the data from the more detailed summarization level.
For more on this method, see section as well as the method described in section . The yellow summarization level (small pyramid) in the above graphic corresponds to summarization level 000002 in section , which primarily contains the customer group. The red summarization level (large pyramid) corresponds to summarization level 000001 from section , which contains the customer group and product group. Appendix contains a description of how you can use the Split report function to create reports easily that are linked in this manner.
contain some of the characteristics. The transaction-oriented characteristics32 are not shown. They are contained in all the summarization levels.
Category Product Class 000001 000002 Chain 000003 Account National Account
Zone
Product
Customer
If we sort the characteristics into a fixed sort order (see section ) and switch to a representation using pyramids, we get the following picture:
000001
000002 000003
000004
32
Page 23 of 40
SAP AG
The summarization levels are stacked according to the characteristic hierarchy. If all the characteristics in one summarization level have a specific characteristic value, you can always use these characteristic values as selection criteria for reading the next summarization level. If, on the other hand, you create summarization levels that are not sorted according to the hierarchy of characteristics, it will not be possible to jump to the next summarization level, i.e. the receiver report will not be able to read the correct level because characteristic values needed for the data selection are missing.
000006
000005
000007
000008
WRONG!
Page 24 of 40
SAP AG
000005
000006
000007
000008
SAP AG
defined for all the characteristics in the higher (smaller) one.33 This is to ensure that the summarization levels for a report are not too close to one another. When two summarization levels of similar size are arranged hierarchically, you should check whether or not the smaller one is absolutely necessary. The small performance gain when you execute the reports may not be worth the extra performance required to update the smaller summarization level. In many cases, you can use the following rule of thumb: The difference in the size of the summary tables of two hierarchically arranged summarization levels should be a factor of at least 5.
Unfortunately, there are disadvantages to creating secondary indexes for summarization levels after you have used the levels. When you make the change in Customizing, the level is given the status Active, without data and therefore needs to be built again from the segment level.35 One way around this would be to create the secondary indexes directly in the database, thereby avoiding the changes in Customizing and the ABAP/4 Dictionary. In this case, you should then create the index in Customizing immediately before the next time you rebuild the level.
33
34
35
This method was developed assuming that we were only dealing with one report. As a result, the number of periods was taken into account when we developed the stack, i.e. if you only need a few periods, the distance (difference in size) between two hierarchically arranged levels will be larger than when you need a large number of periods. For the segment table of your operating concern, a suitable index is needed for updating the segment level. For more information, see OSS note 35288 (Chapter 1) or the first topic in the chapter Technical Documentation in the online documentation CO-PA Profitability Analysis. Valid at least for R/3 Releases up to 3.1H and 4.0A.
Date: 30.01.2003 08:30:00 vorm.
Page 26 of 40
SAP AG
Special Problems
Record Not Found When Reading the Segment Level
It may occur that the segment table (CE4xxxx) contains profitability segments for which there are no records in the segment level. When this happens, the system can fail to find a record when it reads the segment level. In these cases the selection may take longer than when records are actually found. Example: The sales order number is updated in the segment table (occurs frequently in sales-order-related manufacturing). The average processing time of an order is six months. The data basis in CO-PA contains data for the last three years. As a result, for any specific period approx. 5/6 of the profitability segments do not have any postings. When you run a report that selects the data for a specific company code, the system also has to read the profitability segments for those orders that were not processed during the period you want to analyze. However, the system does not realize that no values exist for these segments in that period until it reads the segment table. Example: You store your CO-PA data at the customer/product/week level. But the customers do not buy the products very frequently -- say, once per quarter. when you execute a report for a specific weeks, the system finds no values in this week for most combinations of customer and product. Example: When you assign internal orders to CO-PA (by creating a settlement profile) without specifying a quantity unit for the sales quantity, you create a profitability segment for which the characteristic ABSMG_ME (Quantity unit for sales quantity) has no characteristic value. The postings you create when you settle the order usually have a quantity unit and are therefore posted to a different (new) profitability segment. The profitability segment created by the assignment of the order never receives any postings, and thus no corresponding records exist in the segment level.36 Consequently, a report would spend about half the time required to read the segment level looking for records that do not exist. In contrast to the segment table, the key tables for summarization levels do not contain records for combinations of characteristic values that do not receive any postings. For the situation described in Example 1 above, this means that the segments for which no values exist no longer exist when the system reads the key table. This yields the conclusion: If an operating concern contains many profitability segments for which no records exist in the segment level, you should create a summarization level that contains all the characteristics. There are also a number of situations, however, where this technique does not help:
36
Still, these profitability segments cannot be regarded as superfluous, because they contain the posting information of the order. You therefore cannot simply delete them, since this would negate the integration functions of the R/3 System.
Date: 30.01.2003 08:30:00 vorm.
Page 27 of 40
SAP AG
Example: If some profitability segments rarely receive postings (or perhaps only once),37 and you have a report that only analyzes a narrow time frame, the system will only find records in the segment level for a few of the profitability segments that meet the selection criteria. Such a report would likewise spend a lot of time looking for nonexistent records in the segment level.
38
39
40
This typically occurs in the following situations: 1. The sales order number is not deactivated from the segment-level characteristics. 2. Records in the segment level for discontinued products are not archived and deleted from the database. 3. Business transactions (customer X buys product Y) rarely recur. 4. You post your CO-PA data in very detailed time frames. I.e. the attempt to return the hit list as it was at the beginning of the selection. If a search query (open cursor) runs a long time, the database will encounter changed records. In this case, the database tries to restore the state of the data at the beginning of the selection by reading rollback segments. If this is unsuccessful, the process is terminated by error ORA-1555 (snapshot too old). ORACLE does not write changed data blocks immediately to the hard drive. The physical write only takes place the next time the data block is read. This action is controlled by a flag for each data block that is not reset until the next read step. This attribute can be deactivated from Release 7.3 onward. A table scan reads the data blocks of the table sequentially from the hard drive. This is the fastest way to achieve the desired result using ORACLE.
Date: 30.01.2003 08:30:00 vorm.
Page 28 of 40
SAP AG
FORM F. ENDFORM. On the whole, error ORA-1555 is a database trait that you can only prevent by increasing the number or the size of the rollback segments. You cannot influence the error within R/3.
Appendix
Drill-Down Reports
Data Structure in Profitability Analysis
(see Chapter 3 in note 21773 and the example found there)
41
...and a few additional technical fields: Record type, Plan/actual indicator and Plan version.
Date: 30.01.2003 08:30:00 vorm.
Page 29 of 40
SAP AG
Query
CE4
PAOBJNR Criteria
CE3
"Join" PAOBJNR Period... Value fields
Criteria
Value fields
Hit set
In standard installations, the read performance can yield a throughput of about 200,000 data records per hour. We will use this figure for all calculations in the following section. Actual performance can be improved considerably through fine-tuning. For your own calculations, you need to determine the read performance of your system. If no characteristic values (in particular, no time frame) are specified for a report, the system has to read all the records in the segment table CE4xxxx and all the records in the segment level CE3xxxx. Thus, if you know the size of your data basis, you can determine how long it will take to run a report that reads all the data using the following formula: T read [in hours] ( PS + SL ) / 200,000
where the read time is determined by the number of profitability segments (PS) and the number of records in the segment level (SL). Otherwise, you need to estimate how many records will be read from the segment table and the segment level based on the specific data content of your installation. You can then insert these Page 30 of 40 SAP AG
42
The combination WWV03=3000, WWP04=200 is missing in the report data because no data was posted for this combination in the example.
Date: 30.01.2003 08:30:00 vorm.
Page 31 of 40
SAP AG
WWV03 1000 1000 1000 2000 2000 2000 3000 3000 4000 4000 4000 5000 5000 5000
WWP04 100 200 300 100 200 300 100 300 100 200 300 100 200 300
VVREV 101,368 115,045 30,198 131,234 150,946 41,547 79,546 19,302 110,234 159,002 11,419 198,436 251,032 51,001
To display this data in summarized form, the system selects and aggregates the values from the internal table as needed. When you freeze the report data, the entire internal table is saved in table COIX_DATA in clustered form (in blocks).43 When you later display this frozen report data, the system exports this table again. Typical read times run about 200 kB of report data per second. Similar times can be observed for WRITE operations. From Release 3.0D on, R/3 compresses the data to be written to the database for SAP cluster tables. Consequently, the amount of main memory actually required may be reduced. Factors of around 2 have been observed. The storage form described above gives us a simple formula for estimating the amount of space needed for the report data. For each row of the internal table, space is required for all the characteristics in the report and for all the value fields (or cells) that are to be displayed. We must calculate the actual length of the characteristics (according to the ABAP/4 Dictionary) and 8 bytes for the value fields. Calculating the required number of table rows is usually more difficult. If the report selects all the data and does not summarize any, the number of rows must correspond to the number of profitability segments. However, if one of these criteria does not hold, we need to use more complex assumptions for our estimate, since this requires more detailed knowledge about the content of the data. If the data is summarized to a high degree, we can normally conclude that (almost) all the possible combinations of values of the selected characteristics actually exist, and estimate the number of rows in the internal table by multiplying the number of values of these characteristics. This gives us the following formula for calculating the size of the report data: Assume that N is the number of rows in the most detailed level of the drill-down list, B is the number of cells in the form (detail list), and S is the size of the report data. Then if we take the size of the space required for the characteristics and the technical information for each report line to be about 50, we obtain the following:
43
In Release 3.0 the table is named COIX_DATA. Up to and including Release 2.2, frozen report data was stored in table COIX, which now only contains the report definitions (since Release 3.0). With release 4.0 the table is named COIX_DATA40.
Date: 30.01.2003 08:30:00 vorm.
Page 32 of 40
SAP AG
S [in bytes]
N ( 8 B + 50 )
44
For our purposes, it is irrelevant whether the summarization level being used is optimized for the report or whether the data needs to be summarized further. All that matters is the number of combinations of characteristic values that have to be read from the segment table for the characteristics (which are always stored in the key table).
Date: 30.01.2003 08:30:00 vorm.
Page 33 of 40
SAP AG
Page 34 of 40
SAP AG
First, the required combinations of market-oriented characteristics (red), plan/actual indicator, and plan version (gray) need to be read from the key table -- let us say N Pv records. For each of these combinations, the system then needs to read the corresponding records with all the necessary periods45 and record types (olive green) from the summary table46 -- let us say Pp records per record of the key table. The subscript next to P indicates whether this refers to versions (actual data counts as one version) or periods ( x record types), which increase the number of records that need to be read. The total number of records is thus N Pv ( 1 + Pp ). Example: The two example reports from show actual data and one plan version (presumably for a large record type). For these reports, the system has to read N 24 and N 48 period values, respectively. These figures were found as follows: The contribution margin report shows two versions (one plan version and actual data) for three periods. The sales statistics show the same two versions for two years (or 24 periods).47 With the number of records to be read calculated, we can now use the formula from . It makes sense to measure the read time in seconds, since we are aiming at read operations that can be performed online. In the time is measured in hours because the focus there is on very large read operations for building reports in the background. Tread [sec] = N Pv ( 1 + Pp ) 3.600 / L where the letters mean: N is the number of combinations of values of the required market-oriented characteristics from the key table. Pv is the number of plan versions being read (actual data counts as a version here). Pp is the number of combinations of period and record type (counting the whole number of periods in each fiscal year that appears in the report). L is the installation-specific rate for reading summarization levels per hour. In section , an estimate of 500,000 was given for the read speed L. You need to experiment in your own installation to calculate the read time. Notes: If a large portion of a summarization level is read, and if this level is of moderate size
45
46
47
The number of periods that needs to be read cannot be evaluated precisely. However, the selection is made by fiscal year. The actul join field in the key- and summary table is TRKEYNR, not PAOBJNR. In the picture we left the old term to indicate the correspondece to the read access to the segment level. In Release 3.0, it (unfortunately) does not matter that the plan data from the previous year is not displayed. The system still reads all the combinations of values of period, record type, plan/actual indicator, and plan version.
Date: 30.01.2003 08:30:00 vorm.
Page 35 of 40
SAP AG
(compared to the size of the buffer area of the database), this improves the read performance, since the database's buffer mechanism replaces slow hard disk access operations with faster operations for reading the main memory. In this case, performance is largely dependent on processor capabilities.48
48
With Pentium Pro 200 CPUs under Windows NT, performance of about 1.2 million records per hour (about 330 records per second) were observed in customer systems when the aforementioned prerequisites were fulfilled.
Date: 30.01.2003 08:30:00 vorm.
Page 36 of 40
SAP AG
In this graphic, the two colored triangles represent two reports with the same layout. The dots represent exceptions to which the user drills down. The red dot at the intersection of the two reports has special significance. The "upper" report is already displayed at its lowest level of detail. Thus the user has to execute the "lower" report, the first level of which is this red dot broken down to the next level (the next characteristic). Example: This situation can occur in sales analysis when the upper report contains a sales hierarchy, while the lower report shows the individual customers by salesperson.
Stacking Reports
To create this type of situation, one could proceed as follows: Define a single report layout by creating a form FORM. For this type of report, it would make sense to use a form with one axis and key figure. Global selection criteria (such as the periods to be displayed) should be specified already in the form (general data selection. Using form FORM, define a report SENDER that contains the characteristics WW001, ...., WW004. Likewise, use form FORM to create another report, RECEIVER. This report should contain the characteristics WW001, ..., WW008. For the characteristics WW001, ..., WW004, define local variables. When you execute this report, the system then displays a dialog box in which you can enter values for these variables. Now you can execute report SENDER (also in the background, using program RKEBATCH, if desired). Let us assume that you drill down to the lowest level, where you have one exception remaining. Page 37 of 40 SAP AG
To analyze this exception in greater detail, execute report RECEIVER. In the dialog box "Enter Variables", enter those characteristic values for WW001, ..., WW004 that led to the exception displayed in report SENDER. You can now navigate in report RECEIVER through the characteristics WW005, ..., WW008. This procedure obviously involves some unnecessary actions on the part of the user. First, you need to make a note of the characteristic values at the last level of report SENDER. Then you need to enter these for report RECEIVER. These actions obviously could be performed automatically by the system. The function "Split report" in drill-down reporting makes it easy for you to define this.
Possible Variations
Remember that section was extracted from a document not dealing with summarization levels! All read accesses to CO-PA data are therefore considered to run against the segment level. We have applied the following solution: Page 38 of 40
Date: 30.01.2003 08:30:00 vorm.
SAP AG
A group of characteristics "A" is used for the drill-down characteristics in a sender report. For this report, frozen data is selected and saved in the background. The other characteristics "B" are defined as drill-down characteristics in a receiver report, which can be executed online if desired. If you use the report/report interface as in the example above, you will notice the following: Sender report The time required to select the data for the sender report does not depend on the characteristics chosen for this report (since all data has to be read from the segment level). The report therefore needs to be built in the background using program RKEBATCH. Therefore you will probably make the sender report as large as possible while still making it possible to display the frozen report data in an acceptable amount of time. Size limitation: If you want to be able to display the report in no more than one minute, the report data should not be larger than about 12 MB, according to the formula we postulated earlier. Receiver report Frozen report data can pose problems for the receiver report, since the system stores one set of frozen data for each combination of characteristic values in the sender report that could be necessary for the receiver report. The critical factor for the receiver report is thus the amount of data that has to be read. Size limitation: If you also want to be able to display this report in no more than one minute, the number of sets should be limited to about 3000, according to the formula postulated earlier. By shifting characteristics between groups A and B, you can vary the size of the sender and receiver reports. If the two size limitations cannot both be met, you need to modify this solution.
Page 39 of 40
SAP AG
(a) A
(b) A B C C B
(c) A B CD C BD D BC
B C
For example, you can use the report/report interface more than once. You then have multiple groups of characteristics (A, B, and C in the graphic) and thus have a report stack similar to the one shown in graphic (a). For report B, you thus need to create one set of frozen report data for each combination of characteristic values in A. If your business requirements make it impossible to fix the order in which you can drill down through the characteristics, you need to create multiple stacks of reports (figures (b) and (c)). As indicated in (d), the reports used (given the same selection of drill-down characteristics) differ in which characteristic values are specified.
Page 40 of 40
SAP AG