Module 1 - Basics of ABAP Programming
Module 1 - Basics of ABAP Programming
(Basics to Advanced)
Basics of ABAP Programming
www.zarantech.com
• This presentation, including examples, images, and references are provided for
informational purposes only.
• Complying with all applicable copyrights laws is the responsibility of the user.
• Without limiting the rights under copyright, no part of this document may be
reproduced, stored or introduced into a retrieval system, or transmitted in any
form or by any means.
• Credits shall be given to the images taken from the open-source and cannot be
used for promotional activities.
• What is ABAP?
• Develop a simple ABAP program
4
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 What is ABAP?
5
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 SAP ABAP Programming
What is ABAP?
A dvanced
B usiness
A pplication
P rogramming
6
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 SAP ABAP Programming
What is ABAP?
7
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Developing a Simple ABAP Program
8
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Developing a Simple ABAP Program
9
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Developing a Simple ABAP Program
10
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Developing a Simple ABAP Program
Program Attributes
11
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Developing a Simple ABAP Program
12
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Developing a Simple ABAP Program
13
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Developing a Simple ABAP Program
14
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Developing a Simple ABAP Program
15
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Developing a Simple ABAP Program
• Save - Saves your code, but does not check the syntax for correctness or activate the
program. It is good practice to save your work regularly.
• Check Syntax - Checks that all syntax in your program is correct
• Activate - Activates the program. When you save a program, the system stores an inactive
version of the program in the Repository. Activating a program generates the runtime
object that is used when the program is executed.
• Direct Processing- Executes the program. As a developer, you need to know whether your
code behaves as expected. Use this function to test your program regularly.
16
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Basics of ABAP Programming
17
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
• Is typed
• Enables multi-lingual applications
• Enables SQL access
• Has been enhanced as an object-oriented language
• Is platform-independent
• Is upward-compatible
18
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
ABAP Statements
20
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
21
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
22
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
Comments
• A comment is an explanation that is added to a program to help others understand the code.
• Comments are ignored when the program is generated. They are not executable statements.
23
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
• The * character at the start of a program line indicates that the entire line is a comment.
Therefore, the ABAP runtime system ignores the whole line.
• The " character, which can be entered at any position in the line, indicates that the remaining
content in the line is a comment.
• It is good practice to place whole line comments on the line above the statements that they
describe.
• End of line comments are most suitable for declarations, rather than executable statements.
24
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
25
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
26
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Basics of ABAP Programming
27
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
28
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
30
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
• When the user enters a value and chooses Execute, the input value is transferred to this internal
variable.
• It can then can be used in further calculations or operations.
31
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
32
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
33
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Basics of ABAP Programming
34
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
ABAP Editor
35
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
36
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
37
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
• You can specify the display colors for different objects in the source code (such as
keywords, comments, and literals).
• You can choose the font and font size to be used for the source code.
• You can use code hints to increase the speed at which you write.
• The Editor provides code hints for ABAP keywords, and you can also choose to enable code
hints for variables.
38
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
Pretty Printer
• Keyword capitalization
• Indentation of logically-related blocks
• You can change the Pretty Printer settings by choosing Utilities→ Settings, then choosing
the ABAP Editor→ Pretty Printer tab page
• The Pretty Printer settings are not applied immediately.
• You must trigger the process by choosing the Pretty Printer button.
• We recommend that you trigger the Pretty Printer frequently while developing a program.
40
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
Code Hints
Code Templates
• Some code hints contain the symbol § (as shown in the figure Code Templates). These
hints denote special Code Templates.
• The Editor contains a number of predefined code templates that are suggested by code
hints.
• If you see the § symbol in a code hint, you can insert that predefined template by
pressing TAB.
• The difference between a code hint and a code template is that code hints typically
appear for a single keyword, while a code template appears for a block of routine code
42
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
Code Templates
43
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
Editor Settings
• The Pretty Printer allows you to format your code to a limited extent.
• The new ABAP Editor also provides more extensive formatting options. You can access these
options by choosing the button in the bottom-right corner of the Editor.
• The coloring of different code elements
• The font and font size
• The duration for which code hints display on screen
• The Editor delivers initial values for all settings, and the settings are user-specific, not
systemwide.
44
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
Editor Settings
45
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
46
© Copyright 2021, ZaranTech LLC. All rights reserved.
2 Introducing ABAP Syntax
• When you have checked the syntax and corrected any errors, activate the program by choosing
(Activate) or pressing CTRL + F3.
• Every new program starts as inactive. To make it possible for the current version of the program
to be accessed by all users, you must activate it.
47
© Copyright 2021, ZaranTech LLC. All rights reserved.
2
Q&A Session
48
© Copyright 2021, ZaranTech LLC. All rights reserved.
© Copyright 2021, ZaranTech LLC. All rights reserved.
Thank you
Subscribe to our Channel for more Informative Videos.
https://www.youtube.com/user/ZaranTech