SAP ABAP

ABAP stands for Advanced Business Application Program, which is the default programming language for all SAP Applications. ABAP is used by huge businesses and financials institutes on SAP platforms. You should have basic understanding of Java programming and database technologies. Although, it’s not mandatory if you want to do a course or a certification in SAP ABAP. Let’s begin learning this module from ABAP Editor.

The SAP ABAP Editor is used to create a report in an ABAP object. Transaction code for ABAP Editor is SE38. Get the complete list of transaction codes in SAP ABAP, go to ABAP Transaction Codes.

You’ll have to provide a name to your report starting with Y or Z only, on the initial screen, after inserting Tcode SE38 in the command prompt area. Objects in the customer namespace begin with Y or Z. This is done to differentiate objects of customers or partners from those of SAP system.

Object names aren’t case-sensitive, so you can provide report name in lower case too. Now hit CREATE button, which will open a popup window ABAP: PROGRAM ATTRIBUTES, where you should provide more details about the report. On the next screen, choose “Executable Program” as the report type. Enter title “ABAP Report” and click on SAVE. This will open a popup window called, CREATE OBJECT DIRECTORY ENTRY, where you can select LOCAL OBJECT. Now, you can finish your report by writing the WRITE statement. Here’s an example:

Click on SAVE and ACTIVATE for direct processing of your report or simply hit F8. In the field program, if you click on ZREP1, the ABAP editor will show your report’s code, which is often call Forward Navigation. You should keep in mind following points while writing the WRITE statements for your ABAP reports:

  • The ABAP editor converts all text to uppercase except text strings, which are surrounded by single quotation mark.
  • ABAP has no limitation on the layout of statements. That is, multiple statements can be placed on a single line, or a single statement may stretch across many lines.
  • The write statement writes whatever is in quotes to the output window.
  • Unlike some older programming languages, ABAP does not care where a statement begins on a line. You may take advantage of this and improve the readability of your program by using indentation to indicate blocks of code.

Initial Login Screen

After you log on to the SAP server, SAP login screen will prompt for your User ID and Password. You should provide a valid user ID and Password and hit Enter.

Here’s are the toolbars you’ll see after logging into the system:

  • Title Bar − It shows name of the application/business process you are currently in.
  • Application Toolbar − Menu options are available here.
  • Menu Bar − This is the top line of dialog window.
  • Standard Toolbar − Most standard functions such as Top of Page, End of Page, Page Up, Page Down and Save are available in the standard toolbar.
  • Command Field − You can start an application without navigating through the menu transactions and some logical codes are assigned to business processes. Transaction codes are entered in the command field to directly start the application (just like SE38).

Data Types in ABAP

In ABAP, you’re bound to use a number of variable to store values or information for your program. So, when you create a variable, you reserve some space in memory. You may like to store information of various data types like character, integer, floating point, etc. Some commonly used data types in ABAP are as follows.

Type Keyword Length Range
Integer I 4 byte -2147483648 to 2147483647
Text
Field
(character)
C 1 character 1 to 65535
Byte
Field
X 1 byte byte values from 00 to FF
Numeric
Field
N 1 character 1 to 65535
Floating
Point
F 8 bytes 2.2250738585072014E-308
to 1.7976931348623157E+308
Packed
Number
P 8 bytes [-10^(2len -1) +1] to
[+10^(2len -1) 1]
String STRING Variable alphanumeric characters
XString
(byte string)
XSTRING Variable byte values from 00 to FF
Time T 6 characters 6 characters
Date D 8 characters 8 characters

In ABAP, variable are data objects used to store values within the allotted memory area of a program. You can change the content of variables with the help of ABAP statements. Each variable in ABAP has a specific type, which determines the size and layout of the variable’s memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable. there are 3 types of variables in ABAP, namely: Static, System and Reference.

Operators in ABAP

ABAP operators are classified into four classes:

  • Arithmetic Operators: They are used in mathematical expressions just like regular ones (multiplication, addition, subtraction and division, modulus).
  • Comparison Operators: They are used to compare 1 value with another value (<, >, <>, =, <=, >=, IS INITIAL, IS NOT INITIAL, A1 BETWEEN A2).
  • Bitwise Operators: These are bitwise logical operators used mainly for boolean algebra (BIT-OR, BIT-XOR, BIT-AND, BIT-NOT).
  • Character String Operators: These are used for string operations and include CO, CA, CN, CP, NA, CS, NS, NP.

Loop Statements in ABAP

In ABAP, a loop statement lets you execute a statement or group of statements multiple times. To handle loop requirements, SAP ABAP has three types of loop statements:

  • DO LOOP: This statement is used for repeating particular many times.
  • WHILE LOOP: The WHILE LOOP statement tests the condition before executing the loop body.
  • NESTED LOOP: You can use one or more loops inside any another WHILE or DO Loops.

The Loop statements in ABAP, come with loop control statements too, namely EXIT, CHECK, CONTINUE.

Learn SAP ABAP with Dixita Galiyal

ABAP Development on SAP HANA

This is an exclusive FREE Downloadable Guide on SAP ABAP that consists of following contents:

  • ABAP Workbench
  • ABAP Data Dictionary
  • Data Type & Data Objects
  • Lock Objects & Data Elements
  • Tables, Views & Internal Tables
  • Debugging Concepts
  • BADIs, BAPIs, ALE & IDocs
  • SmartForms & SAP Scripts
  • OO-ABAP Concepts
  • Data Transfer Methods
  • Database Updates

#Personal Recommendations

In case, if you want to refer and purchase for a guide or a book on the same, below are some of our personal recommendations that we’ve absolutely loved:

%d bloggers like this: