Book Image

SAP ABAP Advanced Cookbook

By : Rehan Zaidi
Book Image

SAP ABAP Advanced Cookbook

By: Rehan Zaidi

Overview of this book

ABAP (Advanced Business Application Programming) is SAP's proprietary 4th Generation Language (4GL). SAP core is written almost entirely in ABAP.ABAP is a high level programming language used in SAP for development and other customization processes."SAP ABAP Advanced Cookbook"ù covers advanced SAP programming applications with ABAP. It teaches you to enhance SAP applications by developing custom reports and interfaces with ABAP programming. This cookbook has quick and advanced real world recipes for programming ABAP.It begins with the applications of ABAP Objects and ALV tips and tricks. It then covers Design Patterns and Dynamic Programming in detail.You will also learn the usage of quality improvement tools such as transaction SAT, SQL Trace, and the Code Inspector.Simple transformations and its application in Excel Downloading will also be discussed, as well as the newest topics of Adobe Interactive Forms and the consumption and creation of Web services. The book comes to an end by covering advanced usage of Web Dynpro for ABAP and the latest advancement in Floorplan Manager.
Table of Contents (22 chapters)
SAP ABAP Advanced Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding hints in SELECT clause


If there are many indexes that contain common fields (or for any other reason), the database optimizer cannot decide the right index to be used for a particular query, and then use a wrong index that may not be of optimal performance. From SAP Release 4.5, hints can be provided using the %_HINTS parameter. In this recipe, we will see the syntax for specifying HINTS within your SELECT clause in order for a particular index to be used by the database optimizer. We will see how the hints may be specified when the underlying database is MS SQL Server.

Getting ready

In this recipe, we will have a small program that runs a SELECT statement on the table ZST9_VBAK. We will use the index (Z12) that we created in the previous Creating Secondary Indexes in Database Tables recipe.

How to do it...

For creating the program containing the SELECT clause with the HINT parameter, proceed as follows:

  1. A parameter P_AUFNR is declared for taking as input an order number.

  2. Next, a data variable...