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.
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.