Things to Remember
Chapter 9. Creating Basic Calculated Fields with the SAP Query Tool
In this chapter
In earlier chapters, you used the SAP Query tool to create reports. This chapter teaches you how to create basic calculated fields within those reports by using the SAP Query tool. A regular end user can perform the calculations explained in this chapter by using the SAP Query tool; no special ABAP training or security provisions are required.
As discussed in earlier chapters, you can use the SAP Query tool to create robust reports of your SAP data from any application module within SAP R/3. In addition to creating detailed reports, there may be times when you want to perform calculations on your data. A popular method many users use is to take advantage of the built-in integration with the Microsoft applications. A user can download a SAP R/3 report into Microsoft Excel and perform the calculations there, using Excel's easy-to-use formula tool. However, a more efficient and easy-to-learn method of performing calculations in reports is to use the SAP Query tool to do basic calculations.
The following are examples of calculations you might want to perform by using the SAP Query tool:
You can use calculated fields to perform if...then statements. For example, you might want to say that if the order value is greater than $100.00, enter the value $0.00 in the Shipping Cost column. You could also use a field that inserts a fixed value, such as the current date, in a column of your report output.
The ability to perform calculations on SAP data is a remarkable function because it means you are no longer required to extract your data into a third-party application such as Microsoft Excel to perform the calculations. In this chapter you will learn how to create a very basic mathematical calculation within an SAP query. You will also learn how to perform calculations when certain conditions are met (for example, "If X = 100, then multiply Y by 29"). Finally, this chapter shows you how to create a field for output based on real-time, dynamically decided input.
Creating a Basic SAP Query for This Chapter
For the examples in this chapter, you need to follow along in your own SAP system. To do so, you need to create a basic SAP query, using the instructions outlined in Chapter 3, "Creating Basic Reports with the SAP Query Tool," that contains the fields shown in Table 9.1. For my example, I named my report DLS_QUERY_09, where DLS is my initials.
Figure 9.1 shows an example of the report output of this report.
Figure 9.1. Your report output may vary from what is shown here based on your system's data.
When your SAP query is completed and your report output appears in the same format as the example shown in Figure 9.1, you are ready to insert a basic mathematical formula into the report.