ABAP : Introduction for Beginners

Industrial Management Consulting
Industrial Management Consulting

http://www.manostaxx.com

ABAP Stands for Advanced Business Application Programming.  ABAP is a programming language created and used by SAP for the development of application programs,including: Reports, Screens, Interfaces & Data conversions. All of SAP applications and even parts of its basis system were developed in ABAP. ABAP is an event driven programming language.User actions and system events control the execution of an application.

ABAP Overview

The Advanced Business Application Programming / 4GL (ABAP/4, commonly referred to as ABAP) is SAP’s proprietary language. More than 80% of SAP R/3 is developed using ABAP. The ABAP Program code is “generated” into Byte-code at the time of Activation of the program and is processed by the ABAP Processor which is part of the Kernel and Basis Services (a set of core programs developed in C) at the time of execution. Any ABAP Program, because it requires the BASIS modules, can run only within an SAP environment.

Many features of the programming language and ABAP editor environment resemble the COBOL / IBM Mainframe environment although much of it has been scaled down somewhat to give the language a modern look. The language is case-insensitive and each statement terminates with a period.

ABAP programs are event-driven to an extent though the event handling capabilities are not similar to full-fledged object-oriented languages such as Java or even Visual Basic. ABAP objects or classes can be defined and implemented using the “Class Builder” for use in report and dialog programs.

Reporting

Report programs produce lists and can be classified as conventional reports and interactive reports.
Conventional reports do not allow interaction by the user; therefore; the basic list contains extensive information that the user must often sort through to find the relevant data.

Interactive reports allows for interaction (and drilldown) with the user;therefore the user can produce secondary, detailed lists off of the basic list by choosing the relevant data and requesting more information.

ALV Reports also allows interaction by the user, it can display large amount of data at one short in the form of excel sheet.

Components of ABAP Program

ABAP Components

An ABAP program contains the following components:
Source code : containing the ABAP statements
Screens : Consist of the screen layout and associated flow logic. You normally create the layout of a screen using the Screen Painter  However, there are special kinds of screens, called selection screens and lists, whose layout and flow logic are designed exclusively using ABAP statements.
Interface : contains all of the entries in the menus, the standard toolbar, the application toolbar, and function key settings. It contains titles and statuses. A status is a collection of function key settings and menus.
Text elements: are language-specific. They can be translated either directly from the text element maintenance tool, or using a special translation tool.
Documentation : is also language-specific. Always write documentation from the user’s point of view. If you want to document the programming techniques you have used, use comments in the program code instead.
Variants : allow you to predefine the values of input fields on the selection screen of a program.

 

Structure of ABAP Program

ABAP Structure

ABAP is an event-driven programming language, and as such is suited to processing user dialogs. The source code of an ABAP program consists of two parts:
Declarations: Declarations include the statements for global data types and objects, selection screens, and (in ABAP Objects) local classes and interfaces within the program.
Processing Blocks (indivisible program units) Each processing block must be programmed as a single entity. There are two basic kinds of processing blocks:
Event Blocks: Event blocks are introduced by an event keyword. They are not concluded explicitly, but end when the next processing block starts.
Dialog Modules and Procedures: Dialog modules and procedures are introduced and concluded using keywords. The contents of all processing blocks form the processing logic.
When you generate the program, these parts are compiled to form the load version. This is interpreted at run time.

 ABAP Terms to Remember

ABAP Terms to RememberA Program is a series of structured ABAP statements. It could be an Executable program or a Dialog Program.

A Report is normally an ABAP Program which outputs a list. Some people refer to the List as the Report and to the ABAP report as a report program.

A Module Pool is a non-executable program which contains “modules” that control dialog processing.

A List is an output of an ABAP Report program.
There are Programs of other types such as “Include” (a non-executable block of code that can be included into a main program), Subroutine Pool (a pool of subroutines or

FORMs which can be executed from another executable block), a function pool which contains a group of related functions, and so on.

ABAP Editor

ABAP Editor

  • The ABAP Editor is used to create ,maintain, and execute ABAP programs.
  • You could navigate to the ABAP Editor through the SAP menu for ABAP Workbench or by typing in the transaction code SE38 in the command input field.
  • More details about the features of the ABAP editor is covered later.
  • Some methods for executing ABAP programs include:
    • The ABAP Editor: Tools -> ABAP Workbench ->ABAP Editor (pushbutton)
    • The Reporting function:  System->Services->Reporting
  • ABAP programs that you create must start with a “Y” or A “Z” and can be up to 30 characters in length.

The editor combines a character based text entry capability with graphical icons and menu options to perform many of the functions necessary to build complex ABAP applications.The ABAP development environment provides a wide variety of tools required by the programmer for developing and testing of applications.

Pictured above is the online debugging tool which enables the programmer to step into the program line by line. The online debugging tool provides the programmer with the capability to designate watch variables. These variables once chosen can be viewed as their values change from statement to statement while the program executes. The programmer can even change their values to simulate different processing scenarios.

The ABAP program editor provides many functions through the use of graphical push-buttons. Among these functions are:

  • Toggle from display mode to edit mode
  • Syntax check –with limited auto correction
  • Activation –activates the program.
  • Execution- Executes the program
  • Where used list- to find the tables, statements, data elements used in the programs.
  • Find and repeat find.
  • ABAP help.

ABAP Programming Execution

ABAP Programming Execution

The individual processing blocks are called in a predetermined sequence at runtime, regardless of the position in which they occur in the program.  Once a processing block has been called, the statements within it are processed seqeuentially.
Event block

If the system program or a user triggers an event for which the corresponding event block has been written in the processing logic, that event block is processed. The program flow is controlled either by the system or the user.

Modularization unit

When the system encounters a modularization unit call within a processing block, it calls the corresponding processing block.  In this case, the program flow is controlled by the programmer.

Assigning transaction codes

To allow a module pool to be executed, you must assign a transaction code to it.  You can (but do not have to) assign a transaction code to an executable (type 1) program.

Basic ABAP Program Syntax

ABAP Syntax

  • An ABAP program is comprised of a series of individual ABAP statements
  • Each statement must end with a period.( full –stop)
  • Key words are always the first word in a statement.
  • Words must be separated by at least one blank.
  • ABAP statements can be indented and extend over several lines.

ABAP Program Structure

ABAP Program Structure

ABAP programs must start with either the PROGRAM or REPORT statement.

  • This statement is produced automatically when the program is created through the Repository Browser.
  • The REPORT statement is used for ABAP reports programs.
  • The PROGRAM statement is used for general ABAP programs( for example, module pool programs).

All global data declarations must be grouped together at the beginning of the program in a declaration section.
The statement section can consist of various processing blocks.This subject is dealt with in the remaining chapters of this course.
Always Adhere to ABAP program naming standards dictated by the client.

Chaining Statements in ABAP

Chaining ABAP Statements

  • To avoid repeating key words,ABAP allows you to “chain” statements together if these statements begin with the same key word.
  • The key word is followed by a colon.
  • Each chained statement component is separated by a comma.
  • Blanks can be inserted before and after the separators (which may be colons,commas or periods).

 Comments

Comments in ABAP

Comments are inserted into the program in two ways:

  • By placing an asterisk(*) in column 1,the complete line is designated as a comment line.
  • By placing a double quotation mark(“) within a line the remainder of the line is considered a comment.

ABAP Program Attributes

ABAP Program Attributes

One way to create a new program is:

  • Go into the program menu from the ABAP Editor: Initial Screen.
  • Select the Create menu option or use the Create function key.

You can also create , maintain ,and execute programs from the Repository Browser ( this is the recommended method for creating programs). The program attributes must be maintained before proceeding. ABAP programs must be assigned to a development class or ,if applicable, identified as a local ,private object. (This is a requirement of SAPs Correction
and Transport System.) The application, class and type attributes are used for the management of ABAP programs.
The application, title, status and type attributes are used for the management of ABAP programs. The application,title,status and type attributes are required. Other attributes are optional requirements. F1 and F4 are help keys which allow you to search for the significance of the attributes or a list of allowed input values.

The ABAP editor’s Execute functionis used to start an ABAP program directly from the editor. An ABAP module pool program is executed using transaction codes.

Navigate back to ABAP tutorials.

Continue at: http://www.erpdb.info/abap-introduction-for-beginners/

The text above is owned by the site above referred.

Here is only a small part of the article, for more please follow the link

Also see:

https://dadoswebaxx.weebly.com/

Web Data Extraction
Web Data Extraction

96 Replies to “ABAP : Introduction for Beginners”

  1. Heү fantastic blog! Doеs running a bl᧐g such as this require a large amount oof woгk?
    I’vе absolutely no ᥙnderstandіng of computer
    proɡramming but I had been hoping to start my ownn
    blog inn the near future. Anyhow, if you have any іdeas or techniques for
    new blog owners plеase share. I understɑnd this is off topic however I just needed tto aѕk.
    Τhanks a ⅼot! http://valongodovouga.net/?option=com_k2&view=itemlist&task=user&id=5193:renateyuill79962598

  2. Hey fantastiϲ blog! Does running a blоg such as this requiree
    a large amunt of work? I’ve absolutely no understandіng of
    cߋmputer programming but I had been ⲟping to start my own bog in the near future.
    Anyhow, if yoᥙu havе ɑny ideas or techniques fοr new blog owners pⅼease shaгe.
    I understɑnd this is off topic however I jᥙst neeeded
    to ask. Thanks a lot! http://valongodovouga.net/?option=com_k2&view=itemlist&task=user&id=5193:renateyuill79962598

  3. Hеy therе! Ƭhis iѕ қind of off topic but I need some guidance from an established blog.
    Is it tough tо sеt uрp your own blog? I’m not very techincaⅼ ƅuut
    I can figure things out pretty quick. I’m thinking аbout seting up my own but I’m not sure where to begin. Do yοu have ɑny tips or suggestions?
    Τhank you http://cherryebomb.blogspot.com/

  4. Hmm it аppears like ʏour ѕite ate my first comment (it ᴡas
    extremely long) ѕo I gueѕs I’ll just sum iit up what
    I wrote and say, І’m thoroughly enjoying youг blog.
    Ι too am аn aspiring blog writer but I’m still new to the whole thing.
    Do you have any tips for rrookie blog writers? I’d genuinely appreciate it. https://agenbandarqindo188.blogspot.com/

  5. Hmm it аpopears like your sitе ate my first comment (it was extremely long) sο Ӏ gesѕ I’ll ϳjᥙst sum itt up whqt I wгote
    and say, I’m thoroughly enjoying your blog. I too am an aspiring blog writer but I’m stіll new tⲟ
    the whole thing. Do you have any tipss for rookie blog writers?
    I’d genuinely appreciate it. https://agenbandarqindo188.blogspot.com/

  6. Hello there, just becamee aware of yopur blokg through
    Google, and found that iit is really informative.
    I’m gonmna watch out for brussels. I will be gratesful iff you continue this in future.

    Lots oof people will be benefited from your writing. Cheers!

  7. @ Rob – I predict 50 comments. There’s no way we’ll pass that. I wonder who’ll end up being the one who hits that mark, though. Heh, if I time it right, it’ll be me.
    Thank you for the reminder. I wish I’d had it when I did my last post…Yet I will remember for the future.

  8. I’m extremely impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it’s rare to see a great blog like this one these days..

  9. Exactly what is the best Canon Powershot electronic (duh) camera? I are interested for mostly casual pictures (christmas, birthdays, family reunions that almost stuff). And occasionally a group of cool artistic photos. Im told than a 6-7 mm lens may be the best Other than in which, what else is very good???

  10. Nice read, I just passed this onto a colleague who was doing some research on that. And he actually bought me lunch since I found it for him smile So let me rephrase that: Thank you for lunch! “The future is not something we enter. The future is something we create.” by Leonard I. Sweet.

Leave a Reply

Your email address will not be published. Required fields are marked *