SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow


Introduction to SAP ABAP Programming


Here is an introduction to SAP ABAP programming which I summarized from different ABAP books and ABAP e-books.



Common ABAP Programming Terms


First here is a short list of common ABAP programming terms
Program : Program is a series or batch of ABAP statements
Report : Report is an ABAP program whose output is a list
Module Pool : Module Pool is a dialog program which is a collection of screens
List : List is the output generated by an ABAP report program



How to Open ABAP Editor


You can open and display ABAP Editor in two ways :
one method is using transaction SE80
and other method is using the SAP menu.
Follow the Tools > ABAP Workbench > Development > ABAP Editor from the SAP menu.

use [SE80] transaction code for ABAP Editor ABAP Editor from SAP Menu


ABAP Programming Notes


You must start your ABAP programs names with first letter "Y" or "Z". ABAP program names can be up to 40 characters in length.
Each statement you code in ABAP programming using ABAP Editor must end with a period (.)

Comments

Among your ABAP codes you can add comments by using two methods :
One is starting the line with an asterisk (*). The asterisk which is placed at the beginning of the line will indicate that all of the contens of the line are comment in content.
Second method is using double quotation mark (") in any place of a line. Double quotation mark will indicate that following content is comment.

You must start all your ABAP programs either with PROGRAM or REPORT statement.
REPORT should be used for ABAP reports programs whose output is a list.
PROGRAM can be used for all or for general ABAP programs.

All your ABAP programs should be assigned to a package. But you can define your ABAP programs as local or private objects instead of assigning them to a package.
Assigning to packages is requirement for SAPs Correction and Transport System.
While creating a ABAP program application, title and type attributes are must.

Check the BC ABAP User's Guide and ABAP Workbench tutorial from SAP Help portal





Sample ABAP Program


Below is a very simple ABAP report code which is showing variable declaration and value assigment to variables in the ABAP program.
Also you can see how variables are displayed in ABAP programming.

*&---------------------------------------------------------------------*
*& Report Z_INTRODUCTIONTOABAP *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*

REPORT Z_INTRODUCTIONTOABAP .
*PROGRAM Z_INTRODUCTIONTOABAP .
* PROGRAM can replace REPORT

* Declaring variables here
DATA AGE TYPE I. "Integer Variable
DATA FIRSTNAME(25). "String Variable

* Set value to variable
MOVE 26 TO AGE.
MOVE 'Eralper' TO FIRSTNAME.

* Display variable values
WRITE FIRSTNAME.
WRITE AGE.

* Multiple variables
DATA : AGE2 TYPE I, LASTNAME(25). "Multiple variable declaration
MOVE: 0 TO AGE2, 'Yılmaz' TO LASTNAME. "Multiple variable value setting
WRITE: LASTNAME, AGE2. "Display multiple variables
Code


SAP HANA and ABAP

Install SAP Free
CRM Companies List
Web Based CRM Software


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.