32,36 €
Take your SAP ABAP skills to the next level by mastering ABAP programming techniques with the help of real-world examples
Key Features
Book Description
Advanced Business Application Programming (ABAP) is an established and complex programming language in the IT industry. This book is designed to help you use the latest ABAP techniques and apply legacy constructions using practical examples.
You'll start with a quick refresher on language and database concepts, followed by agile techniques for adding custom code to a modern ABAP system. After this, you will get up to speed with the complete ABAP toolset for importing data to and from different environments. Next, you'll learn how to print forms and work with the different ABAP tools for Extensible Markup Language (XML) manipulation. While covering further chapters, you'll gain insights into building stunning UI5 interfaces, in addition to learning how to develop simple apps using the Business Object Processing Framework (BOPF). You will also pick up the technique of handling exceptions and performing testing in ABAP. In the concluding chapters, you can look forward to grasping various techniques for optimizing the performance of programs using a variety of performance analysis tools.
By the end of this book, you will have the expertise you need to confidently build maintainable programs in Systems, Applications, and Products (SAP).
What you will learn
Who this book is for
This book is for developers who want to learn and use ABAP skills to become an industry expert. Familiarity with object-oriented programming concepts is expected.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 441
Veröffentlichungsjahr: 2019
Copyright © 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor:Aaron LazarAcquisition Editor:Shahnish KhanContent Development Editor:Akshita BillavaTechnical Editor:Ashi Singh, Neha PandeCopy Editor: Safis EditingLanguage Support Editor: Storm MannProject Coordinator:Vaidehi SawantProofreader: Safis EditingIndexer: Pratik ShirodkarGraphics:Jisha ChirayilProduction Coordinator:Aparna Bhagat
First published: May 2019
Production reference: 1280519
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-78728-894-2
www.packtpub.com
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Paweł Grześkowiak has been passionate about programming from his early years, and since 2012 he has been a SAP technical consultant—mainly in the ABAP area. He has expertise in boosting implementations in the rail transport industry, the chemical industry, media, government administration, the wood industry, and banking. Currently, he designs extensions to SAP S4/HANA systems in ABAP and Java. He is an active member of the SAP community and a three-time SAP Inside Track conference organizer.
Wojciech Ciesielski graduated from the Wroclaw University of Technology with an Engineering degree in Automation and Robotics, and he has a master's degree in Management in WSB Universities. Since then, he has been tightly connected with the SAP environment, working as an ABAP consultant. He has several years of business background in ABAP development and the use of modern technologies in business. He is experienced in working with ERP and CRM systems and integrating them with third-party solutions—from single companies to multinational corporations. He is a co-creator of innovative solutions delivered to the wide international audience of SAP events. He is currently focused on new technologies and solutions in the SAP portfolio: SAP Cloud Platform, Internet of Things, and artificial intelligence; but he is also increasing his expertise indevelopment with other languages.
Wojciech Ćwik has been a certified ABAP consultant for several years, with a specialty in mobile solutions, especially in creating interfaces between SAP and frontend solutions from Fiori and third-party platforms; he also enjoys creating architectures in SAP ERP ecosystems. He is a co-originator of an unconventional system linking new solutions from the SAP portfolio such as IoT, SAP Cloud, and SAP blockchain services.
Dariusz Pacynko graduated from Wroclaw University of Technology with an MSc degree in Optical Engineering. Since then, he has been tightly connected with the SAP environment, working as an ABAP consultant. He has multiple certifications, such as ABAP with SAP Netweaver 7.40 Development Associate, and several years of business background including experience with ABAP development, OData services, and SAPUI5 applications. He is experienced in working with ERP and CRM systems, integrating them with third-party solutions, and opening them to the mobile philosophy. He is a co-creator of innovative solutions delivered to the wide international audience of SAP events. He is currently focused on the new technologies and solutions in the SAP portfolio, such as SAP Cloud and IoT, but he is also increasing his expertise in Fiori development.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Title Page
Copyright and Credits
Mastering SAP ABAP
Dedication
About Packt
Why subscribe?
Packt.com
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Code in action
Conventions used
Get in touch
Reviews
Creating Custom Code
Technical requirements
Making changes
Design thinking
BDUF/LDUF
Designing for quality and use
Designing the UI
Designing services
Designing the business logic
Designing the database
Agile principles
DevOps
Continuous delivery
Summary
Questions
The Basic Structure of ABAP
Technical requirements
The Data Dictionary
Domains
Data elements
Structures
Search helps
Table types
Databases
Data declaration
Field symbol
Summary
Questions 
Database Access in ABAP
Technical requirements
Starting with OpenSQL
Basics
Possibilities with SELECT - the first part of the SQL statement
Possibilities with INTO - the third part of the SQL statement
The WHERE condition
How to see data selected from a database
More advanced possibilities in OpenSQL
WHERE conditions
Dynamic SELECT in WHERE
SINGLE FOR UPDATE
GROUP BY
ORDER BY
UP TO and ROWS
SELECT and ENDSELECT
FOR ALL ENTRIES
Subqueries
Reading data from several tables
Identifying and saving the changes
Creating datasets
Updating datasets
Deleting datasets
The optimization of reading big datasets
The new SQL syntax
Inline declaration
SQL expression
Using the SQL Trace tool for performance analysis
Summary
Questions
Import and Export to Document Formats
Technical requirements
Client-side file processing
Reading files from the local PC using gui_upload
Writing files to the local PC using gui_download
Server-side file processing
Basic transactions related to server-side files
Writing files to the application server
Reading files from the application server
Working with Microsoft Office files
Reading data from Microsoft Excel
Saving a table to a Microsoft Excel file
Working with Microsoft Word
Using DOI to integrate Microsoft Office applications into ABAP reports
Summary
Questions
Further reading
Exposing Data to Print Forms
Technical requirements
Introduction to printouts in SAP
SAPScript - the great-grandfather of all printouts
Creating our first SmartForm
Adobe Forms
Creating our first Adobe Form
Summary
Questions
Further reading
ABAP and XML
Technical requirements
Using the CL_XML_DOCUMENT class for XML
Reading and parsing XML files to ABAP
Changing XML data
Simple transformations in ABAP
Serialization using ST
Deserialization using ST
sXML library for XML and JSON
Converting XML to JSON
Summary
Questions
Further reading
Building User Interfaces
Technical requirements
Classic DynPro
Screen painter
Selection screens
More advanced options of the selection screen
Checkbox
Radiobutton
Blocks in selection screens
Selection screen event model
ALV
Basics
Advanced capabilities of ALV sand screens
Zebra
Coloring
Event of an ALV, exemplified by a button click 
Icons in the ALV
Text fields and translations
Input/output field
Radiobuttons and checkbox
Button
Dynamic display possibilities for individual elements and groups
Summary
Questions
Creating Stunning UI5 Interfaces
Technical requirements
Development tools
Layouts and floorplans
SAP Fiori elements
The analytical list page
The list report
The object page
The overview page
The worklist
Layouts
Floorplans
The initial page floorplan
The multi-instance floorplan
The wizard floorplan
Basic templates
The SAPUI5 library
Control documentation page and inheritance
Contextual info
Overview
Constructor
Properties
Associations
Aggregations
Events
Methods
Inheritance
Main controls
Custom controls
Creating our first mobile app
Application and project structure
index.html
The standard variant
The content delivery network
The miscellaneous variants
Component.js
manifest.json
Views and controllers
MainView.view.xml
SearchView.view.xml
SearchView.controller.js
i18n.properties
Testing SAPUI5 apps
Mock Server
Unit tests
Integration tests
Summary
Questions
Further reading
Business Object Processing Framework
Technical requirements
An introduction to BOPF
Transaction
Nodes and entities
First BOPF example 
Creating the object
Displaying an object
Summary
Questions
Further reading
Modification and Customization Techniques
Technical requirements
Legacy ways of changing the standard
Customer Exits
Using BTE to extend FI functionality
Modifications
FQEVENTS
Appends
Classical BAdl
Enhancement framework and its components
Enhancement sections and Enhancement points
Implicit enhancements
Summary
Questions
Further reading
Handling Exceptions in ABAP
Technical requirements
Classic exception handling
Handling
Raising
Class-based exceptions
Handling
Raising
Assertions
Building a checkpoint group
Defining assertions
Using assertions
Runtime errors
ABAP dump analysis tool
Error log
System environment
User View
ABAP developer View
BASIS developer View
Summary
Questions
Testing ABAP programs
Technical requirements
Testing the quality of code
Static testing with Code Inspector and ABAP Test Cockpit
Testing and troubleshooting
ABAP Memory Inspector
Advanced ABAP debugger techniques
Testing with eCATT
Summary
Questions
Further reading
Advanced Techniques in ABAP Objects
Technical requirements
Global versus local classes
Creating a local class
Creating a global class
The static method versus the instance method
Nested classes
A class as an attribute of the class
Inheritance
Interfaces
The event concept
ABAP Objects design patterns
Prototype - creation pattern
Singleton - creation pattern
Facade - structural pattern
Decorator - structural pattern
Observer - behavioral pattern
Strategy - behavioral pattern
Summary
Questions
Integrating SAP with Third-Party Systems
Technical requirements
IDoc 
IDoc overview
The construction of IDoc
The EDI system
ALE
Differentiating ALE from EDI
BAPI
Implementing BAPI
SAP Gateway
Deployment variants
Embedded
Hub
Hub (with development)
Main tools
Gateway Service Maintenance
Gateway Client
Error Log
Gateway Service Builder
The OData protocol
Characteristics
The service definition
Developing our first OData application
Design time
Providing data
Summary
Questions
The Background Processing of ABAP Programs
Technical requirements
Background processing in SAP
Background remote function call
Scheduling background jobs
Creating a background job
Recording batch input sessions
Summary
Questions
Performance and Optimization of ABAP Code
Technical requirements
Ways of measuring ABAP programs performance
ABAP runtime analysis
ABAP trace analysis
ABAP SAT transactions
Best practice techniques
Summary
Questions
Assessments
Answers
Chapter 1 - Creating Custom Code
Chapter 2 - The Basic Structures of ABAP
Chapter 3 - Database Access in ABAP
Chapter 4 - Import and Export to Document Formats
Chapter 5 - Exposing Data to Print Forms
Chapter 6 - ABAP and XML
Chapter 7 - Building User Interfaces
Chapter 8 - Creating Stunning UI5 Interfaces
Chapter 9 - Business Object Processing Framework
Chapter 10 - Modification and Customization Techniques
Chapter 11 - Handling Exceptions in ABAP
Chapter 12 - Testing ABAP Programs
Chapter 13 - Advanced Techniques in ABAP Objects
Chapter 14 - Integrating SAP with Third-Party Systems
Chapter 15 - Background Processing of ABAP Programs
Chapter 16 - Performance and Optimization of ABAP Code
Additional tutorials
Creating a report from the template
Uploading graphics to SE78
Another Book You May Enjoy
Leave a review - let other readers know what you think
Advanced Business Application Programming (ABAP) is an established and complex programming language in the IT industry. This book will be your guide to becoming an industry expert in Systems, Applications, Products (SAP) ABAP. You will learn how to write custom code that is suited for the latest version of SAP ABAP as well as the older versions of SAP. By exploring practical examples, you will learn how to make user-friendly interfaces and will uncover various ways to optimize your ABAP code.
This book is for developers who want to learn and use ABAP skills in order to become an industry expert. Familiarity with object-oriented programming concepts is expected.
Chapter 1, Creating Custom Code, focuses on available actions for changing SAP systems within the modern and ever-changing SAP wold.
Chapter 2, The Basic Structure of ABAP, focuses on the distinction between ABAP and modern programming languages.
Chapter 3, Database Access in ABAP, describes how to extract data from a database in ABAP.
Chapter 4, Import and Export to Document Formats, focuses on the toolset the ABAP developer has for importing and exporting data to/from different environments.
Chapter 5, Exposing Data to Print Forms, explains how to represent extracted data in a user-friendly print form, how to make it clearly readable, and how to make its maintenance less time-consuming.
Chapter 6, ABAP and XML, deals with the different tools ABAP has for XML manipulation, their performance features, and what real-life scenarios they are intended for.
Chapter 7, Building User Interfaces, focuses on how to build classical Dynpro with the help of ABAP tools. It explains what screen types exist and how they are interconnected with each other, what GUI controls ABAP developers have in their toolset, and which of them are recommended and which are not. It also describes ABAP List Viewer (ALV) controls and the ALV component model.
Chapter 8, Creating Stunning UI5 Interfaces, places UI5 in the family of SAP interfaces and explains how to use it in the most efficient way.
Chapter 9, Business Object Processing Framework, gives an overview of Business Object Processing Framework (BOPF) and explains why it is important in SAP environments for the acceleration of development, easier maintenance, and supportability.
Chapter 10, Modification and Customization Techniques, describes the customization techniques across SAP modules, explaining which techniques are recommended to use and which are outdated.
Chapter 11, Handling Exceptions in ABAP, covers testing exceptions in ABAP, the types of exception that have existed from the beginning, and the types we have now. It also recommends the proper way of handling exceptions, explaining in which situations it is strongly required, and those in which it is not recommended.
Chapter 12, Testing ABAP Programs, explains how to test ABAP programs for performance without sacrificing the clarity of ABAP code and how to use the ABAP Debugger correctly to find bottlenecks and speed up ABAP programs.
Chapter 13, Advanced Techniques in ABAP Objects, deals with the advantages ABAP objects bring to the development process.
Chapter 14, Integrating SAP with Third-Party Systems, focuses on how to build a stable and error-prone connection of a SAP system with non-SAP software.
Chapter 15, Background Processing of ABAP Programs, reveals all the ins and outs of background data processing in SAP that you may face, and the approaches that are used to handle with them.
Chapter 16, Performance and Optimization of ABAP, provides a thorough review of the available ABAP toolset for testing the performance of ABAP apps and tuning their execution. It also gives some best practice tips and tricks of internal ABAP statements and focuses on tracing and tuning OpenSQL selections.
The reader should know the basics of programming, as well as the basics of SQL and operations on databases. Basic knowledge of business processes will also be helpful. This book also deals with the subject of UI5; therefore, it is worth the reader knowing the basics of JavaScript.
To create code in ABAP, the readers also need access to SAP systems with the developer key.
To create applications in UI5, the readers should create a trial account in the SAP Cloud Platform. The SAP Web IDE Full-Stack developer environment is available there. The programming environment allows you to create and extend SAP applications on a full stack for browsers and mobile devices.
You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at
www.packt.com
.
Select the
SUPPORT
tab.
Click on
Code Downloads & Errata
.
Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR/7-Zip for Windows
Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Mastering-SAP-ABAP. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://www.packtpub.com/sites/default/files/downloads/9781787288942_ColorImages.pdf.
Visit the following link to check out videos of the code being run: http://bit.ly/2M4ILyK.
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in the text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "In the Details window, create lines %C1 and %C2 with the values that are shown in the following screenshot."
A block of code is set as follows:
<script id="sap-ui-bootstrap" src="resources/sap-ui-core.js" data-sap-ui-libs="sap.m" data-sap-ui-theme="sap_belize"></script>
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
data-sap-ui-bindingSyntaxt="complex"data-sap-ui-resourceroots='{
"my.namespace":"./"
}'
Any command-line input or output is written as follows:
$ mkdir css
$ cd css
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packt.com.
The chapter is an introduction to the Systems, Applications, Products (SAP) system. You will learn how to organize their daily work, how to act within SAP systems, how to add custom code, and how to change software features of SAP systems. This chapter presents modern techniques of cooperation within a company. Basic knowledge of these issues is required to work with the SAP system. This chapter is an introduction to the more complex and difficult topics contained in this book.
The following topics will be covered in this chapter:
Making changes
Design thinking
Big Design Up Front
/
Little Design Up Front
(
BDUF
/
LDUF
)
Designing for quality and use
Designing the
User Interface
(
UI
)
Designing the services
Designing the business logic
Designing the database
Agile principles
DevOps
Continuous Delivery
This chapter does not have complex technical requirements. To check the solutions and examples, it is worth having user access to the SAP system. Other information (for example, agile designing the UI) can be better understood by IT employees. However, it is worthwhile for everyone who's interested in working with SAP systems to read the information contained in this chapter.
All the code used in this chapter can be downloaded from the following GitHub link: https://github.com/PacktPublishing/Mastering-SAP-ABAP/tree/master/Chapter01.
There are several ways in SAP to make changes. Some of them are configuration changes, and some are purely programmatical changes.
SAP systems can be enhanced in five ways:
Customizing
: Specific business and functional process configuration according to the implementation guide. The need to make these changes is predicted by SAP and the procedure of implementation has been developed.
Personalization
: Setting up global attributes to display certain fields (such as default values or switching off the display of a field).
Modification
: These are changes SAP Repository objects make at the client side. SAP also can deliver a new version of those objects, and customers need to reflect these changes in the system. Before version 4.0B, customers needed to make this adjustment manually using upgrade utilities. From 4.5A, customers can use the Modification Assistant to automate this procedure.
Enhancement
: Creating a repository object inside a standard SAP program. More details about enhancement will be in
Chapter 10
,
Modification and Customization Techniques
.
Custom development
: This means creating
objects that are
unique to the client repository, which is created in the specified namespace, such as
Y*
or
Z*
, for all new objects.
In your daily work as an ABAP programmer, your most common work is creating custom developments and enhancements. Since we have a chapter on enhancements, we will focus here on custom development.
In custom development, we can create a custom program and dictionary elements. There will be more about creating dictionary elements in Chapter 2, The Basic Structure of ABAP.
As an example, we will show you how to create one of the most basic programs: Hello World.
In the first step, we need to open one of the most commonly used transactions in our daily work—SE80. This transaction is called Object Navigator, and is a transaction where we can create, change, and delete most ABAP objects.
The main window for the SE80 transaction looks like this:
First, to open the SE80 transaction, we need to put the name of the transaction in the search box, as shown in the following screenshot:
Press enter, or click on .
After opening a transaction, we need to choose the Program option in the drop-down list on the left and enter the name Z_HELLO_WORLD in the window, as shown in the following example, and press Enter:
In the next window, choose Yes:
Confirm the name of a new program in the next window. Click on or press Enter:
In the next window, define the attributes of the program, and now press Enter or click on :
After this, choose a package. We need to create a program as a local object, so click on :
After this, we get a window like this:
Now change the mode to Change by clicking on the icon or pressing Ctrl + F1. The background color of the window with the code will change to white. Now we put the code there.
To print Hello world on the screen, we just need to add this:
WRITE 'Hello World'.
The program looks similar to the following screenshot:
The program now needs to be activated. To activate it, click on or press Ctrl + F3. When an object has been activated, a message will be shown: .
To execute the program, click on or press F8:
The result of the program is shown in the preceding screenshot.
Design thinking is a method of creative problem-solving. This method is designed to deliver innovative solutions by using a specific work method. The motto of this method is doing, not talking, so going over every detail of the project is changed into a multi stage division of tasks in order to extend and refine subsequent tasks.
The process of design thinking is divided into five steps:
Empathy
: All of the new solutions are created for people. Therefore, the needs of a given group of people should be known, and this is why empathy is the starting point of all projects created by design thinking. To find the optimal solution, we need to see how this solution will help the common user.
Define the problem
: In this stage, we need to define the exact problem to solve. We need to remember not to define problems in too narrow or too wide a range so that the solution will not be limited by rigid frames.
Ideas
: This stage consists of creating as many ideas as possible for solutions relating to the previously defined problem. In this step, a brainstorm is very useful. The important thing is not to stick to your own ideas, and not to judge others. These sessions should be ended by choosing a concrete solution, which will be picked from the previously selected ideas.
Prototypes
: Creating the prototypes is an indispensable step. Building prototypes should not be a very complicated process. The most important thing is to make a preliminary visualization of the idea, because only in that way can the idea be tested naturally. Every subsequent prototype should be created by thinking of the user and answering concrete questions.
Tests
: This step is extremely important. In this step, the product is tested in a real environment, so you can check that it functions correctly. Every prototype can be evaluated by the group
(for example, the project group)
, and the best one will be chosen for further improvements. Testing should be repeated until a satisfactory result is obtained.
LDUF is the process of modeling a small subsystem before coding, and BDUF is also a process of modeling, but in BDUF, the whole system needs to be modeled before implementation. BDUF can also be an anti-pattern for many reasons, but LDUF (or many occurrences of LDUF within a project) is often helpful.
BDUF occurs in one of two categories:
A document of the high-level architecture, which determines the key features of architecture, but the rest of the things are unspecified and/or unclear.
General documentation
should describe everything from high-level architecture to the smallest detail of the system. These documents are often incoherent as there are no automatic ways to cross-check them.
LDUF can be precise and concise, and many programmers/architects can check/verify LDUF and detect any inconsistencies.
Generating and changing BDUF is often hard and expensive. It requires teams of analysts, consultants, and architects, and support from many layers of management. LDUF is light and informal—often, a programmer can do a mock-up, and if it's checked, it can be checked by a small team.
These are the main aspects of LDUF:
Highly informal; it can be made by yourself or with a small team of programmers.
Code is created in a small subsystem, which can be as small as even one class, function, or package.
Often not prescriptive—the results are to be used as advice, not requirements.
BDUF is prescriptive—the code must be consistent with the paper project; all exceptions require management intervention. Additionally, it is anti-productive for many of the reasons mentioned in the preceding points.
When designing new software, it is not only a matter of creating functional code. The eventual outcome is going to be a product that serves its purpose, but is also possible to improve, is robust, is easily maintained, and can be used for a long time. From the user's perspective, once the product is paid for, it won't require much more cost in terms of funds, man effort, or any other measurable value.
In order to fulfill these goals and achieve user satisfaction, the philosophy of quality engineering was introduced. In principle, it defines product quality as the ratio of the result of efforts and the total cost; however, in detail, it considers various factors, such as reliability, maintainability, continuous improvement, corrective actions, and risk management.
Particularly in software engineering, there is a need to estimate the quality through an end-to-end view. It requires the collaboration of various actors, whose roles are mostly independent—business architects, security officers, project managers, and more.
One of the basic steps in designing for quality is to determine quality objectives that describe the requirements for software quality. The software quality should be considered in two areas:
How it complies with functional requirements—whether the developed product is actually doing what it is supposed to do
How it meets the non-functional requirements—whether it reaches its goals in the correct way
Once the objectives are defined, they can be measured with help of appropriate models and various methods, such as Goal Question Metric (GQM), Balanced Scoreboard (BS), or Practical Software Measurement (PSM).
There is no universal way to measure and control the value of quality in all environments. From the vast list of factors, several apply to SAP systems, and should always be considered when developing new code:
Understandability
: Both the code and all the documentation should be readable by peers.
Conciseness
: Not only
should
the code be kept small, but it
also
should not process unnecessary data.
Consistency
: The software should follow the notation conventions present in the system.
Maintainability
: It should be well documented and not complex (modularized as needed) to allow for future updates.
Testability
: The software should be written in a way that allows tests to check its correctness and performance.
Reliability
: The code should behave properly (non-erroneously) in all conditions.
Security
: It should always consider preventive measures to avoid unauthorized access to important data.
Depending on the level of interaction with the user, there are several additional factors that should be considered:
The intuitiveness of the UI
Ease of use
Sensibleness of messages, for example, errors
Responsiveness of the interface
Although these terms tend to be subjective and, in general, hard to determine in the design phase, they have a major impact on the quality of the software as seen by the end user, and therefore, cannot be neglected.
The practical approach of building and implementing user interfaces will be shown in Chapter 7, Building User Interfaces, and Chapter 8, Creating Stunning UI5 Interfaces. There are, however, some ground rules and guidelines that should be followed when designing UIs:
Use written words
: As a rule, the software should be as self-descriptive as possible. Although graphical interfaces use images or any other means of communication, it is still encouraged to give the user appropriate and relevant information with text.
Use the user's language
: All messages, field names, and texts should be defined in the user’s language (if possible).
Use consistent terminology
: The same objects should be named the same way throughout the environment.
Creating a user interface for R/3 transactions requires a few decisions to be taken up front. One of the most important decisions is to determine the basic type of application:
With screen changes
:
None, or a few areas on the page
Simple, sequential navigation
With multiple areas
:
Few or no changes to the main screen; several areas with lot of interaction between them
Provides stable context
Both types have pros and cons, and the choice depends on several criteria—length of processing, the amount of detail required, the user type (such as casual or expert), and the data type (such as a flat structure or volume).
The main goal of the design is to facilitate the user's focus on the current task, while more or less ignoring irrelevant details. In order to do so, use expand and collapse areas and splitters.
When designing R/3 screens in detail, there are several effects—psychological principles—that should be considered to improve the perception of information:
The effect of proximity
: Items that are close together tend to be
grouped
in our perception.
The effect of similarity
: Items of the same size, shape, or quality are likely to be viewed as a group or pattern.
The effect of closure
: Lines that enclose areas are perceived as units.
The effect of continuity
: Items arranged into a unified layout are perceived as a unit.
Services, in principle, are meant to be consumed by some other part of the system, or even by an external system. It is required to keep in mind that the service may not, and most likely will not, be able to determine where and when it is used. This is why this type of development needs to be particularly robust and reliable, as various areas of the system may depend on its correct functioning.
When designing the services, aside from their scenario-specific implementation needs, there are several things that should be considered in order to minimize upgrade and maintenance costs:
Keep services singular-task oriented
: Even if the service is supposed to perform many actions on the system, one entry point should perform one consistent end-to-end task (for example, creating a business object, or deleting one). Avoid mixing multiple tasks in a single service call.
Avoid direct database manipulation in services
: Delegate all logic to the business logic layer.
Expect, but check
: Do not assume that all the required data is provided by the caller, and always verify its consistency.
Provide consistent and explanatory responses
, especially when errors occur, so the caller can react accordingly.
Keep the service well documented
, so it is clear from the consumer's perspective what to expect when calling a particular part of it.
If possible, keep the service's interface unchanged
: Even small changes to the interface will require adjustments in the consumer's implementation. Utilize optional parameters to keep backward compatibility.
The business logic layer is meant to handle business objects and the interaction between them. Decouple it from the service and database layers—it should know as little about the database access or user interaction as possible, yet exchange information with them as needed using a level of abstraction, such as interfaces or base classes. The business logic should focus on transforming and calculating data, leaving other tasks to other layers.
Minimize the complexity of the business logic itself by separating concerns into different areas. Keep the processing, workflow, and business entities separated and loosely coupled. The separation will make the implementation easier to follow, whereas loose coupling will allow modification with a relatively low cost. Then, make sure you avoid the duplication of functionalities in different areas by reusing common parts of business logic.
Identify the consumers of the business layer so that the data can be exposed in the desired way. This will prevent the additional effort of converting data from one format to another. Having consumers in mind, make sure you have prepared not only the functional logic, but also various auxiliary aspects, such as security requirements, validations, exception management, and concurrency—keep them consistent and manage them centrally if possible.
Do not forget about unexpected situations and audits—use logs to store the history of critical changes or errors, yet without business-sensitive data. Ensure that errors in the logging process itself do not affect the normal functionality of the system—keep it as a separate logical unit. Make sure that the logged information is sufficient to track the root causes of any problems.
Designing the database is an essential part of the company's organization. This is a definition that covers data organization according to the model adopted. Designing the database prepares how data is to be linked in tables. It is also necessary to specify which data should be stored. Designing the database provides easier design, expansion, and maintenance of the SAP system. The correct design of the database greatly influences the optimization and quality of the system.
Creating logical and physical models of the database system is the target in designing databases. It is a complicated and complex process due to the use of relational databases in SAP systems. This architecture has its own great advantages, and a proper design simplifies the implementation of the ABAP language.
The logical model contains information on data storage, but there is no information on how it will be stored. This model makes it easier to analyze the structure of an information system that's unrelated to a specific database implementation. A physical data model enables us to analyze the tables, views, and other objects in a database. The physical data design model includes changing the logical database design to a physical layer. The designer uses software systems for this purpose, such as database management systems (DBMSes). A DBMS is system software for creating and managing databases.
In the SAP system, it is possible to graphically show connections using foreign keys. Using this tool is extremely simple. The user enters the table, for example, through SE11 transactions.
After clicking on the button shown in the following screenshot, the SAP system will display the tool in a separate window:
An example of how to connect to the SFLIGHT table is shown in the following screenshot:
This allows the user to view all the tables that are associated with a foreign key. A double-click on one of the related tables moves the user to this table. Information on the types of relationship between tables is also included here.
In 2001, the Manifesto for Agile Software Development was created. This is an alternative to the cascaded way of generating software. The manifesto describes agile as a philosophy for carrying out various projects, including IT projects.
The basis of the Agile Manifesto includes four basic principles:
Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan
The manifesto means that the values described on the left are more important than the ones on the right. It's no coincidence that people are placed first. The success of each project depends on them. If the team has the right skills and a lot of commitment, there is a good chance that each project will be successfully completed. Interactions between team members speed up the work and allow the use of maximally positive aspects of teamwork. The second point indicates what is most important from the point of view of the software recipient. Even the best documentation cannot replace properly working software. The working end product is the basis for considering whether the project has been successful.
A quick response to changes causes the team to be able to deliver the ideal product to the recipient. It builds a sense of professionalism and can contribute to the expansion of business cooperation with the current investor. Agile is a great project management tool that helps to eliminate the likelihood of an IT project failure.
Work based on agile methodologies takes advantage of an iterative and incremental approach. This means that the team of programmers is focused on the fast, cyclic, and orderly delivery of product elements. The result of this is greater flexibility. This is very important due to the high frequency of changes, along with building solutions. Agile methodologies of software development do not have rigid conditions and assumptions regarding every aspect of the project.
DevOps is an organizational culture whose assumption is to combine the work of software development teams and operations teams. DevOps is an innovative approach to software development. The benefits of using this approach are, among others, as follows:
Time and cost savings
Shortening the time of product implementation
Quick changes in products
Better-fitting functionalities
More accurate verification of correctness
Advantage over competitors
Better team cooperation
DevOps uses iterative work growth in accordance with agile methodologies. This gives the product recipient the opportunity to quickly read the results of the work. DevOps characterizes a fast and visible change in the company's operations. Teams carry out projects that are more suited to the needs of users.
DevOps assumes smooth communication between technical teams and, at the same time, assumes the following:
The product is built from the perspective of the whole.
Accurate testing from the initial functionality.
Relying on reliable data.
Reducing the time of software development.
Continuous delivery is a concept of software development. It is based on the assumption that software is created in short intervals of time. This approach allows you to create solutions tailored to the current business needs of recipients. A very important feature of this method of sharing the finished product is the need to accept the possibility of running the software on the main (production) system. The remaining elements of the implementation process are automated. The process is also characterized by a repetitive delivery cycle.
Continuous delivery is similar to the method of continuous implementation, in which software is also produced in short cycles, but with the help of an automatic process in terms of production transfer.
This chapter describes how the user can organize their daily work and operate in a broader context. We've looked at some ideas for becoming a more attentive developer or architect. At an advanced level, readers will be able to organize several topics within complex projects, including managing stakeholders. At a basic level, the user should be familiar with the daily activities of a project manager or architect and has learned how to integrate with the complex configuration of the project.
The next chapter will describe the world of modern SAP systems, with a basic outline of the ABAP language and gives you a view on older syntactic data and their equivalents, which are used in modern ABAP systems.
The following questions will allow you to consolidate the information contained in this chapter:
What are the positive aspects of using agile methods?
What are the principles of the agile manifesto?
What is the difference between a logical model and a physical model when designing a database?
List the possible programming changes in SAP.
What is the motto of design thinking, and why is it coherent with the design thinking methodology?
In which categories does BDUF occur?
What aspects of development impact the quality of the design?
Why should business logic be loosely coupled?
This chapter will provide you with a quick introduction into the world of modern systems applications products (SAP) systems, along with a basic outline of the advanced business application programming (ABAP) language. We will take a look at legacy syntax figures and their counterparts, which are often used in modern ABAP systems.
In this chapter, we will explain basic data structures, the principles of data manipulation, and also typical hardware and software features of SAP systems. This knowledge is necessary for navigating the SAP system and creating applications.
In this chapter, we will cover the following topics:
The Data Dictionary
Domains
Data elements
Structures
Table types
All the code used in this chapter can be downloaded from the following GitHub link: https://github.com/PacktPublishing/Mastering-SAP-ABAP/tree/master/Chapter02.
The Data Dictionary is a set of information describing the objects of a database and the relationship between its elements.
The Data Dictionary includes a domain, Types (StRUCTURES, DATA TYPE, and TABLE TYPE), tables, views, search helps, and lock objects.
The following diagram explains the division of objects in a Data Dictionary:
To create an object for the Data Dictionary, we need to use the SE11 transaction. The transaction code is usually only a few characters long and guides you directly to the screen of the task that the user wants to perform. This screen is shown in the following screenshot:
Data elements are objects that describe the unitary fields in the Data Dictionary. It should be emphasized that the domain is used to define technical parameters, while the data element is more function-oriented (because it has labels explaining its purpose). This object is used to define the type of the table field, as well as the structure of the component.
Follow these steps to create a data element:
Go to
Transaction SE11
, select the radio button for the
Data Type
element, and enter a name for it. Then, click on
Create
:
Choose the
Data element
checkbox and press
Enter
:
Enter a short description and assign the element with the type. The user can assign one of the following types to the data:
Domain
Elementary type
Reference type
