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

Secondary indexes for internal tables


In this recipe, we will see the new concept of secondary keys/index within internal tables. This lets you optimize your programs when accessing data residing within an internal table.

Getting ready

In this recipe, we will create a program that will store all data of table VBAK into an internal table. Then we will use the secondary key in order to fetch a record pertaining to a given order number, aufnr. The primary emphasis of this recipe is on the definition and usage of a secondary key for internal tables.

How to do it...

For creating a program using secondary index in internal tables, follow the steps below:

  1. We first declare a type ty_vbak based on the database table vbak. We create two keys for this table type. The first is a non-unique primary key having vbeln as the key field. We also create a non-unique sorted secondary key sec_key having one field aufnr. An internal table it_vbak is defined based on the type ty_vbak. In addition, a work area wa_vbak...