Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
SAP ABAP Advanced Cookbook

You're reading from   SAP ABAP Advanced Cookbook Featuring over 80 sophisticated recipes, this is a superb tutorial for ABAP developers and consultants. It teaches you advanced SAP programming using the high level language through diagrams, step-by-step instructions, and real-time examples.

Arrow left icon
Product type Paperback
Published in Dec 2012
Publisher Packt
ISBN-13 9781849684880
Length 316 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Rehan Zaidi Rehan Zaidi
Author Profile Icon Rehan Zaidi
Rehan Zaidi
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

SAP ABAP Advanced Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. ABAP Objects 2. Dynamic Programming FREE CHAPTER 3. ALV Tricks 4. Regular Expressions 5. Optimizing Programs 6. Doing More with Selection Screens 7. Smart Forms – Tips and Tricks 8. Working with SQL Trace 9. Code Inspector 10. Simple Transformations 11. Sending E-mail Using BCS Classes 12. Creating and Consuming Web Services 13. SAP Interactive Forms by Adobe 14. Web Dynpro for ABAP 15. Floorplan Manager 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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image