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
SAP ABAP Advanced Cookbook
SAP ABAP Advanced Cookbook

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
Profile Icon Rehan Zaidi
Arrow right icon
Can$38.99 Can$55.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (7 Ratings)
eBook Dec 2012 316 pages 1st Edition
eBook
Can$38.99 Can$55.99
Paperback
Can$69.99
Subscription
Free Trial
Arrow left icon
Profile Icon Rehan Zaidi
Arrow right icon
Can$38.99 Can$55.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9 (7 Ratings)
eBook Dec 2012 316 pages 1st Edition
eBook
Can$38.99 Can$55.99
Paperback
Can$69.99
Subscription
Free Trial
eBook
Can$38.99 Can$55.99
Paperback
Can$69.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

SAP ABAP Advanced Cookbook

Chapter 2. Dynamic Programming

In this chapter, we will cover recipes related to dynamic programming. This chapter is designed to provide useful recipes related to field symbols and data references, as well as dynamic SQL and ABAP code generation. In this chapter, we will look at the ways of:

  • Using field symbols and data references to print database table contents

  • Applying dynamic Open SQL

  • Dynamic program generation

Introduction


This chapter explores recipes related to dynamic programming. Dynamic programming is a very vast topic. It may be simply defined as a technique whose behavior/effect is only evident at execution time. There are many facets of dynamic programming with ABAP. These include generic programming such as dynamic source code generation. Also specifying parts of the Open SQL statements (clauses) dynamically using string variables, and the creation of data objects based on a type known only at runtime are within the dynamic programming landscape. When using dynamic programming, we may also sometimes need to determine the data type of data objects at runtime. This is called Runtime Type Identification (RTTI).

The ABAP language provides a number of features/options for making programs dynamic or to avoid hardcoding of values. We will start with application of field symbols and references. As an example, we will create a program that will take as input the name of a table and print its contents...

Using field symbols and data references to print database table contents


Field symbols and references are an important combination for dynamic programming. Data references are addresses of data objects stored in reference variables. Field symbols are placeholders, or symbolic representations of these data objects.

This recipe shows how to print all the contents of a particular database table (the name of which is only known at runtime). For simplicity sake, we will only focus on the main logic pertaining to dynamic programming. In addition to data references and field symbols, we will also see some dynamic SQL statement application.

Getting ready

The code will let you create a small data browser program that will take as input the database table name whose contents are to be read, and the number of rows and columns (fields) to be displayed. The output displays the table's field names as column headers along with the data stored in the table.

The knowledge of the describe_by_data method of the...

Applying dynamic Open SQL


The Open SQL statement components may be specified statically or dynamically. This applies to database read statement SELECT, as well as data manipulation statements such as INSERT and UPDATE. The primary emphasis of this recipe will be on dynamic specifications of the various components of the SELECT statement. The previous recipe saw some usage of the dynamic SQL in the SELECT statement, where the table name, the target area internal table (pointed to by a field symbol), and the number rows to read using UP TO addition were specified dynamically. In addition to these, the GROUP BY, the ORDER BY, and WHERE conditions may be specified dynamically.

In this recipe, we will create a program that will take input from the user and create dynamic specifications for the where condition and the order by clause. (For simplicity's sake we emphasize on the dynamic where and order by clauses and keep the table name as spfli).

Getting ready

We will create a program that will contain...

Dynamic program generation


The ABAP language also allows the creation of ABAP programs at runtime. An INSERT REPORT statement may be used for creating a new program specified by the a name in the statement. Dynamic program generation should only be used when there is no alternate option.

Also, you may generate a subroutine pool using a GENERATE subroutine pool statement. A subroutine pool is generated, and is of a temporary nature. The subroutines in the pool may be called from within the generation program.

On the other hand, the programs created via the INSERT REPORT statement are permanent and overwrite any prior existing programs with the same name. Within the generation program, the new program may be called via a SUBMIT statement.

Getting ready

We will use the concepts of dynamic program generation in order to show how a simple requirement may be solved. We will take as input two program names. The code of the first program will be read and then any comments or unwanted blank lines will...

Left arrow icon Right arrow icon

Key benefits

  • Full of illustrations, diagrams, and tips with clear step-by-step instructions and real time examples
  • Get to grips with solving complicated problems using Regular Expressions in ABAP
  • Master the creation of common Design Patterns using ABAP Objects
  • Enhance SAP applications through the use of ABAP programming
  • Covers the newest topics of Adobe Interactive Forms

Description

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.

Who is this book for?

If you are an ABAP developer and/or consultant looking forward to building advanced SAP programming applications with ABAP, then this is the best guide for you. Basic knowledge of ABAP programming is required.

What you will learn

  • Master the advanced features of Web Dynpro programming
  • Experience the latest advancements in FloorPlan Manager design
  • Learn how to use transaction SAT and secondary internal table indexes for performance improvement
  • Explore the world of Simple Transformations and how they solve problems
  • Get step-by-step instructions to create and consume Web Services
  • Optimize program code and find datasource of fields using SQL Trace
  • Get valuable tips and tricks for Smart Forms and Adobe Interactive Forms

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 26, 2012
Length: 316 pages
Edition : 1st
Language : English
ISBN-13 : 9781849684897
Category :
Languages :
Concepts :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 26, 2012
Length: 316 pages
Edition : 1st
Language : English
ISBN-13 : 9781849684897
Category :
Languages :
Concepts :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just Can$6 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total Can$ 223.97
Software Development on the SAP HANA Platform
Can$83.99
SAP ABAP Advanced Cookbook
Can$69.99
SAP HANA Cookbook
Can$69.99
Total Can$ 223.97 Stars icon
Banner background image

Table of Contents

15 Chapters
ABAP Objects Chevron down icon Chevron up icon
Dynamic Programming Chevron down icon Chevron up icon
ALV Tricks Chevron down icon Chevron up icon
Regular Expressions Chevron down icon Chevron up icon
Optimizing Programs Chevron down icon Chevron up icon
Doing More with Selection Screens Chevron down icon Chevron up icon
Smart Forms – Tips and Tricks Chevron down icon Chevron up icon
Working with SQL Trace Chevron down icon Chevron up icon
Code Inspector Chevron down icon Chevron up icon
Simple Transformations Chevron down icon Chevron up icon
Sending E-mail Using BCS Classes Chevron down icon Chevron up icon
Creating and Consuming Web Services Chevron down icon Chevron up icon
SAP Interactive Forms by Adobe Chevron down icon Chevron up icon
Web Dynpro for ABAP Chevron down icon Chevron up icon
Floorplan Manager Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.9
(7 Ratings)
5 star 85.7%
4 star 14.3%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Piotr Stasierski Jan 10, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
It helped me in my office work, gave me few tricks I didn't know them.For me the form of this book is attractive
Amazon Verified review Amazon
Kumar Feb 09, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Hi !Super Buch. Ich habe intensiv das Buch gelesen und die Themen sind exakt so wie in der Industrie auftauchen!Kumar Mitra-Endres
Amazon Verified review Amazon
Gordon Du Mar 21, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Although I am just starting to use ABAP and am a beginner, I reallyappreciate the simplicity found in the SAP ABAP Advanced Cookbook.This book is probably one of the most helpful and most easily understandableguides for any SAP ABAP user. The book has over 80 advanced "recipes" whichillustrate some excellent programming techniques. The book is able to covera broad range of topics which commonly challenges the beginning and thesomewhat experienced ABAP developer; really helps in avoiding some of theheadaches in learning ABAP.The screenshots used in the book are quite intuitive. You can follow theillustrated steps easily to get the job done.No matter if the topic is on ABAP Objects or on ALV tips and tricks or thetopic relates to Design Patterns and Dynamic Programming, this book givesyou all kinds of recipes to work on. You can bypass anything you knowalready, but you are sure to love the tricks which you have not masteredyet.Simple transformations and its application in Excel Downloading will be goodfor you to link SAP with other commonly used applications.I give the book a 5 star rating for its simplicity and usefulness.
Amazon Verified review Amazon
F. Wacker Jun 28, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
very helpful and good. The Author uses very easy to understand code examples, that can be adopted to any other problem
Amazon Verified review Amazon
Ralf Wenzel Jun 05, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Zunächst: Das ist KEINE Übersetzung des ABAP-Kochbuches von Enno Wulff, sondern ein eigenständiges, sehr gutes Werk (sage ich mal nach über 15 Jahren SAP-Erfahrung). Verständlich geschrieben, mit witzigen Pointen drin, fachlich korrekt
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.