Category: ABAP

ABAP

  • Delivery Class in ABAP Tables

    Preface – This post is part of the ABAP Beginner series.

    Delivery Class in ABAP Tables

    In Data Class we have specified the Type of Data we will be using for our table, in Size Category we have declared the expected Volume of Data we will be saving. Now, we need to define the way the Data in the table behaves. It means whether data can be moved from one Landscape/system to other or not. It is achieved using Delivery Class in ABAP Tables.

    *NOTE: Although the Delivery Class is declared before Data Class and Size Category, still it is advisable to read about it after them.

    Definition

    A delivery class defines:

    • Transport control of Data within Landscapes and customer systems
    • Transport control of Data for an installation or upgrade
    • Transport control of Data of client copy
    • Data can be maintained in Extended Table Maintenance [SM30] or not.

    In short we can say a delivery class determines whether data of the table can be maintained & transported or not.

    Delivery Class

    Types of Delivery Class

    TYPE TABLE TYPE DESCRIPTION TABLE BEHAVIOUR DURING CLIENT COPY TABLE BEHAVIOUR During Installation, Upgrade and Language Import
    A Application table (Master and Transaction data) Master and Transaction data is maintained by SAP Data is copied only if requested

    ·         Cross-Client Tables : No Data Imported

    ·         Client-Dependent Tables: Data Imported into Client 000.

    C Customer table Data is only maintained only  by Customer Data is copied to the target client

    ·         Cross-Client Tables : No Data Imported

    ·         Client-Dependent Tables: Data Imported into Client 000.

    G Customer table SAP can only Insert data & cannot modify/Delete Data is copied to the target client

    ·         Cross-Client Tables : Imported and cannot be overwritten

    ·         Client-Dependent Tables: Imported and can be overwritten only for CLIENT 000.

    L Temporary table Table to story only temporary data Data are not copied to the target client

    ·         Cross-Client Tables : No Data Imported

    ·         Client-Dependent Tables: No Data Imported.

    E System table Table with own namespace(in table TRESC) for customer entries Data is copied to the target client

    ·         Cross-Client Tables: Imported and can be overwritten with same key.

    ·         Client-Dependent Tables: Imported and can be overwritten.

    S System table Table with status of Data changes Data is copied to the target client

    ·         Cross-Client Tables: Imported and can be overwritten with same key.

    ·         Client-Dependent Tables: Imported and can be overwritten.

    W System table Table whose Data is Transported via its own Transport Objects Data are not copied to the target client

    ·         Cross-Client Tables: Imported and can be overwritten with same key.

    ·         Client-Dependent Tables: Imported and can be overwritten.

    *NOTE: Client Dependent Tables are tables with MANDT field and any changes in the table will impact only one Client while Client Independent Tables are also called Cross Client Table which does not have MANDT field and hence any changes will impact all the clients in the server.

  • Size Category of Database Tables

    Preface – This post is part of the ABAP Beginner series.

    Size Category of Database Tables

    In Data Class we have defined the kind of Data we are going to have for our table. Now, it’s time to decide the expected Volume of Data. We do it via Size Category of Database Tables.

    Initially Every Table receives equal amount of allowed space. If the data exceeds the initial space provided then an extent of memory is provided to the table, the amount of extended memory will depend upon the size category we provide.

    In this way we actually prevent creation of Large extended memory and thus reduce the wastage of data base space.

    Definition

    Initially every table have some memory allotted. Size Category tells us the amount of space that will be extended after the initial memory is filled.

    What will happen if extended memory created is also filled?

    Then a new extend will be created again with the memory equal to the size category provided as shown below:

    Size Category of Database Tables
    We have 3 Table with Size Category 0, 1, 2 respectively. The Initial memory allotted for all tables are equal but later on depending upon the Size Category the extent is provided in the data base.

    How Multiple Extends affects the Data base?

    A table with multiple extensions affects database in following ways:

    • Decreases System Performance: Data will be fetched from two different sources.
    • Increases Database management: Database Reorganization is required
    • Lowers Systems Availability: For Database reorganization, it is taken offline.

    TYPES OF SIZE CATEGORY

     

    Size Category Expected Rows
    0 0 to 1,000
    1 1,000 to 4,200
    2 4,200 to 17,000
    3 17,000 to 68,000
    4 68,000 to 270,000
    5 270,000 to 540,000
    6 540,000 to 1,000,000
    7 1,000,000 to 2,100,000
    8 2,100,000 to 4,300,000
    9 4,300,000 to 170,000,000

     

  • Data Class in ABAP

    Preface – This post is part of the ABAP Beginner series.

    Data Class in ABAP

    Data Class in ABAP is assigned to a table in its Technical Settings. SAP was smart while creating properties for tables. With the help of Data Class it divides the Tables according to their type of Data. It keeps all Master Data together, all Transaction Data together, all User Data together and all Organizational Data together.

    Definition:

    A Data Class represents a physical area in Data Base where all the Data of the table assigned to this Data Class are stored.

    data class in abap

    TYPES OF DATA CLASS:

     

    DATA CLASS TYPE OF DATA DESCRIPTION
    APPL0 Master Data Data that doesn’t changes frequently.

    e.g. Your Name, Your Employee ID, Your Student ID

    APPL1 Transaction Data Data that changes frequently.

    e.g. Number of Products on Amazon, Value of Bitcoin

    APPL2 Organizational Data Customizing Data which is defined during System Installation and that doesn’t changes frequently.

    e.g. Country Codes.

    USR & USR1 User Data Data Class only for user Development.

     

    *NOTE: Customizing Data is the data that describes the behavior of SAP environment for particular module.

    e.g.  Country Codes, types of Reimbursement Expenses, working hours of Employees.

  • SAP Tables: How to Create SAP ABAP Tables

    Preface – This post is part of the ABAP Beginner series.

    SAP Tables

    Unlike other Database where we write SQL commands (DDL) to create table, SAP provides us option to create Tables in ABAP Dictionary. Upon Activation, SAP Tables are actually defined in database.

    Creation of SAP Tables:

    #Using ABAP Dictionary

    Step 01: Open SE11.

    Step 02: Click Database table Radio Button and give your Table name starting with Z or Y e.g. “ZBarry_Table”.

    Step 03: Click Create, Enter explanatory description for table in Short Description e.g. “Table for Test”.

    Step 04: Under Delivery & Maintenance tab maintain the following:

     FIELDS Value Description
    Delivery Class Select from given drop down

    A –Application Table

    C – Customer Table

    A Delivery class controls the transport of table data.
    Data Browser/ Table View Maint. Select the Maintenance option from given drop down If allowed, It allows the table owner to maintain data via SE16.

     

    Step 05: Under Fields tab maintain the following:

    FIELDS Value Description
    Field It can be 16 digit Alphanumeric word starting with a letter and can contain underscore It is the column name of your table
    Key Tick all the fields whose value will be unique and can define the relationship with other tables A table must contain at least one key field, else it can’t be activated.
    Initial Value Indicator Tick if the field must have an initial value All key fields must always be given initial values. By default all fields are assigned initial values irrespective of indicator.
    Data Element Select your Data Element or create one If you are not using Predefined Type, you need to provide a Data Element
    Predefined Type : If you are not using Data Element, click the Predefined Type tab & enter following:
    Data type Any Data type like CHAR,INT According to requirement specify the data type
    Length Give max length of your field Length will be dependent upon Data Type
    Decimal places Number of places after decimal point Mainly for Float variables
    Short description Explanatory statement for your field What your field means/doing
    Include Structure: Whenever we include a structure in table, it might have fields with same name as there are other fields in table. To avoid conflict we address the field with a suffix (3-27 Character with ‘-‘) for that structure. This suffix is given in Group tab.
    Group 3-27 Character To Address Include Structure fields

     

    Note: Maintain foreign key relationship by clicking. Also maintain Search Help by clicking Srch Help tab.

    Step 06: Under Entry help/check tab maintain the following: It will be maintained automatically after step 05. [You can skip this step]

    FIELDS Value Description
    Field Same as above Same as above
    Data Element Same as above Same as above
    Data Type Same as above Same as above
    Foreign Keys Foreign Keys for that field It will be reflected after you maintain Foreign Key relationships
    Check Table Check Table for Field It will be reflected once you have check table relationship for the field
    Origin of input help Input help with fixed values, with check table, search helps, Static Input Help It reflects the way your input will be made to the given field
    Srch Help Your Search Help name To attach Search Helps to field
    Defaults Any Value depending upon the type of field To assign Default value for the field
    Domain Domain of specified Data Element If your Data Element has a Domain, it will reflect here

     

    Step 07: Under Currency/ Quantity Fields tab maintain the following: [You can skip this step]

    FIELDS Value Description
    Field Same as above Same as above
    Data Element Same as above Same as above
    Data Type Same as above Same as above
    Reference Table Reference Table name If your data element refers to a table
    Reference Field Field of Reference table being Referred It is actually the field being referred by the data element
    Short Description Same as above Same as above

     

    Step 07: Maintain Indexes and Append Structure from respective tab. [You can skip this step]

    Step 08: Maintain following @Technical Settings: [Important Step]

    FIELDS Value Description
    Data Class APPL0 – Master Data
    APPL1 – Transaction DataAPPL2 – Organizational Data
    It describes the type of Data you will be storing
    Size category From 0 to 4 It defines the expected space required for table in database
    Buffering Choose from Radio Button It tells whether your table will be using buffering or not. If yes, then which type of Buffering.

     

    Step 09: Once all the above fields are maintained, save, check for errors and activate your table.

     

    Additional Information

     

    • All Key fields should be maintained in the beginning.
    • Maximum 16 key fields are permitted per table.
    • Length of key field can be max 255 characters (and 120 if data is to be transported).
    • A table can have total 249 fields.
    • A field name must not be longer than 16 characters.
    • Fields of type STRING, LRAW, LCHR must be at the end of table.
    • Fields without data element cannot have foreign keys, F1 Help and fixed values.
    [embedyt] https://www.youtube.com/watch?v=9Ejtbd9SS7Y[/embedyt]
  • SAP ABAP Data Elements

    Preface – This post is part of the ABAP Beginner series.

    DATA ELEMENTS

    We cannot use Domain directly neither in a Report/Program nor as a table field. We need to add some semantic information i.e. Field Label, heading, etc. For this purpose we need data elements.

    Definition:

    Data Elements are reusable objects that are used to add Field Label, Heading, Documentation (F1 Help) and assign a parameter ID and a Search Help (F4 Help).

    Note:  In Domain Level also we have an option to define Search Help which fetches either fixed value defined there or from Value Help Table while the one we assign in Data Element is from Global Search Helps that we create via SE11.

    Creation of Data Elements:

    #Using ABAP Dictionary

    Step 01: Open SE11.

    Step 02: Click Data type Radio Button and give your Data Element name starting with Z or Y e.g. “ZBarry_DataElement”.

    Step 03: Click Create, Choose Data Element Radio Button and Enter explanatory description for Data Element in Short Description e.g. “Data Element for Test”. This short Text appears as title of Data Element F1 help Documentation.

    Step 04: Under Data Type Tab, you will have two options.  Choose any one and provide its corresponding details.

    FIELDS Value Description
    Elementary type:  It is used to define Data Element on the basis of either Domain or predefined Data types.
    1. Domain Enter your Domain Name It adds technical characteristics in Data Element same as that of Domain.
    2. Predefined Type Enter Data Type & Length Data Type can be any predefined data types with any length.
    Reference Type:  It is used to create a pointer to data objects.
    1. Name of Ref. Type Name of Class, Interface, Object, ANY or Data The Data Element will point to the given Value.
    2. Reference to Predefined Type Enter Data Type, Length and Decimal Places Data Type can be any Predefined Data Type like CHAR, INT and Length & Decimal Places can be of any length.

    Step 05: Add your Search Help, Parameter ID, Default Component Name and Mark your Data Element as a change document under Further Characteristics tab. For more read ABAP Documentation.

    Step 06: Add Short, Medium, Long, Heading field label under Field Label tab. Field Label is used to display the name of fields in Parameters of Report, column Header of Table & structure. The purpose of providing different Labels is that these labels are displayed according to input template size.

    [embedyt] https://www.youtube.com/watch?v=MxJsMhgQVeo[/embedyt]
  • Domain in ABAP

    Preface – This post is part of the ABAP Beginner series.

    Domain in ABAP

    To define Data in ABAP Dictionary we need Domain, Data Element and Tables. Domain in ABAP is the smallest unit that is defined in ABAP Dictionary. Thereafter, Data Element is created which further describes the domain to the End User. Thereafter Table is created which utilizes the Data Element.

    All domains are saved in a Standard ABAP Table DD01L and their Text Descriptions are saved in Standard ABAP Table DD01T.

    Definition:

    Domain in ABAP is a reusable object that is assigned to a Data Element and it is used to define a value range (F4 Help) and provides technical attributes (Data Type, Number of character, etc).

     

    Creation of Domains:

    #Using ABAP Dictionary

     

    Step 01: Open SE11.

    Step 02: Click Domain Radio Button and give your domain name starting with Z or Y e.g. “ZBarry_Domain”.

    Step 03: Click Create, Enter explanatory description for Domain in Text Field e.g. “Domain for Test”.

    Step 04: Under Definition tab we have two options whose significance are described below:

     

    FIELDS Value Description
    Format
    Data Type Choose from pre-defined values It describes type of data e.g. INT for Integer and CHAR for Character
    No. of Characters Maximum length of Data 20 for CHAR means 20 Letters allowed
    Decimal Places Max. allowed Decimal Values Decimal Places mainly for Float Type Value e.g. 10000.08
    Output Characteristics
    Output Length Max. Output Length It is mainly for Floating Values
    Conversion Routine Two Function Modules:

    CONVERSION_EXIT_xxxxx_INPUT

    CONVERSION_EXIT_xxxxx_OUTPUT

    Takes Input in one format and return as another e.g. Takes 02.01.2009 as Input and Returns 02 Jan 2009 as Output
    Sign Negative Set if your data can be negative
    Lower Case Lower Case Toggles Case

     

    Step 05: Under Value Range you can fix your Input using following three ways:

    • Fixed Value Range: If you Want to Fix Input of Gender, you can create following
    Fixed Value Description
    F Female
    M Male

     

    • Interval Value Range: If you want to give Interval as Value Range
    • Value Help: If you want to give fix value from given table. This is the concept of Value Table and Check Table which we will discuss in upcoming chapters.
    [embedyt] https://www.youtube.com/watch?v=sTWpe9rvmQo[/embedyt]
  • ABAP Data Dictionary

    Preface – This post is part of the ABAP Beginner series.

    ABAP Data Dictionary

    Before we jump directly in to Data Dictionary concept, let us learn something about basic SQL operations. To perform any operation on Data we need to perform two things: Define Data and Manipulate Data. Both of these operations are achieved by SQL [Structured Query Language] operations. SQL is a language that helps us to communicate with our database.

    SQL can be, therefore, divided into two parts:

    DDL: DATA DEFINITION LANGUAGE

    DML: DATA MANIPULATION LANGUAGE

    DDL part of ABAP is managed by ABAP Dictionary. Data Dictionary is used to create and manage data definitions (metadata).  ABAP Dictionary helps to create user defined types (domain, data elements, structures and table types) which are further utilized by ABAP objects (tables or views).

    DML part of ABAP is written using open SQL commands like:

    OPEN SQL COMMAND DESCRIPTION
    SELECT To Read Data from Database
    INSERT To Insert Data in Database
    UPDATE To Update current Data in Database
    MODIFY To Insert/Update Data in Database (whichever applicable)
    DELETE To Delete from Database

     

    Features of ABAP Dictionary:

    1. DOMAIN: A reusable object that is assigned to a Data Element and it is used to define a value range (F4 Help) and provides technical attributes (Data Type, Number of character, etc).
    2. DATA ELEMENT: A reusable object that takes attributes of a Domain. It is used to create Field Labels & Field Documentation that appears as field help (F1 Help).
    3. TYPES [STRUCTURE]: A reusable object that is used to create a global structure. TYPE option in ABAP is also used to create DATA ELEMENTS and TABLE TYPES.
    4. TABLE TYPES: A TABLE TYPES is used to create global Internal Table. A TABLE TYPE needs a LINE TYPE that acts as the workarea of that Internal Table.
    5. TABLES: A TABLE is used to create a physical table definition in database. These are defined in ABAP Dictionary independently of the database [that means every Table in independent with respect to other tables and storage].
    6. VIEWS: It creates logical View of more than one table. By Logical View we mean a view that is presented to the user not that is actually stored in database [also called Physical View].
    7. SEARCH HELPS: These are the objects that are used to create and assign Input Help (F4 HELP) to screen fields.
    8. LOCK OBJECTS: These are used to synchronize the access of same data by different users.

    Advantages of ABAP Dictionary:

    1. Data Integrity
    2. Data Consistency
    3. Data Security
    4. Data reusability

     

  • SAP Variable- SAP ABAP Variable

    Preface – This post is part of the ABAP Beginner series.

    SAP ABAP Variable

    The data objects that stores value according to allotted memory space are called Variables. As the name suggests values of VARIABLE can be varied using ABAP statements. SAP variable can be of Predefined Data Types that we have discussed in our earlier post or of Data Elements Type that we will discuss later. In this post I will show how to declare Data Variables using predefined Data Types.

    ABAP Variables are declared using keyword DATA. These are created every time during Program execution and destroyed after every execution.

    Example:

    1. Declaring single variable.DATA NAME (20) TYPE n.

     

    1. DECLARING USING DEFAULT DATA TYPE: Character is the default data type i.e. if you are not giving any data type it will be a character.

     

    DATA NAME (20).

     

    1. Declaring multiple variable using colons (:).

    DATA:   ID (10) TYPE n,

    NAME (20) TYPE c.

    1. Declaring Variable using LIKE instead of TYPE keyword. LIKE keyword is used if the data type of given variable is same as the one we have already used. We make the second variable like the first variable.

    DATA:   FIRST_NAME (10) TYPE c,

    LAST_NAME (10) LIKE FIRST_NAME.

    1. Declaring Structured Variable. In our previous post we learned about Structured Data Types. Similarly, we can define structured Variable using keyword BEGIN OF<Variable Name> and END OF<Variable Name>.

     

    DATA:   BEGIN OF EMPLOYEE_DETAILS,

    ID (10) TYPE n,

    NAME (20) TYPE c,

    END OF EMPLOYEE_DETAILS.

     

    1. Declaring Variable Using/Referring Existing Structured Data Type:We can declare a structure Data Type and can reuse it in different ways to create Structured Variable.

    Example:

    TYPES:   BEGIN OF ADDRESS,

    HOUSE_NUMBER (10) TYPE n,

    NAME (20) TYPE c,

    END OF EMPLOYEE_DETAILS.

    DATA:   HOUSE_ADDRESS TYPE ADDRESS,

    OFFICE_ADDRESS LIKE HOUSE_ADDRESS.

     

    Difference between Structured Data Type and Structured Variable:

     

    1. DATA TYPES are structures that are created to be used by DATA to create variables.
    2. DATA TYPES creates structure using keyword TYPES that holds no memory while Variables created using keyword DATA holds memory.

    Accessing SAP Variable of Structured Variable:

     

    To access each individual field of structured variable, we use hyphen (-).

    Example: Here we will access NAME from EMPLOYEE_DETAILS (Point 5 Above is a Structured Variable)

    EMPLOYEE_DETAILS-NAME

    To assign value we use equal to sign (=)

    EMPLOYEE_DETAILS-NAME = ‘BARRY ALLEN’.

  • SAP Operator: Arithmetic and Comparison Operation

    Preface – This post is part of the ABAP Beginner series.

    SAP Operator: Arithmetic Operators

    Following are the basic SAP Operator using which Arithmetic operations can be performed upon ABAP variables:

    1. Assign Values to variables

    To assign value to a variable, we can use equal to “=” sign or Keyword MOVE.

    DATA:   LV_NUMBER1 TYPE      n,

    LV_NUMBER2   TYPE     n.

    LV_NUMBER1 = 10.

    MOVE LV_NUMBER1 TO LV_NUMBER2.

    WRITE: / LV_NUMBER1, LV_NUMBER2.

    OUTPUT:

    1. Apply Sum, Subtraction, Multiplication and division on two or more variables

    DATA:           LV_NUMBER1 TYPE      n             VALUE  10,

    LV_NUMBER2   TYPE     n             VALUE  20,

    LV_ADD                TYPE     n,

    LV_SUB                 TYPE     n,

    LV_MUL               TYPE     n,

    LV_DIV                 TYPE     n.

    LV_ADD = LV_NUMBER1 + LV_NUMBER2.

    (OR)

    A = ADD LV_NUMBER2 TO LV_NUMBER1.

    LV_SUB = LV_NUMBER1 – LV_NUMBER2.

    (OR)

    B = SUBTRACT LV_NUMBER2 FROM LV_NUMBER1

    LV_MUL = LV_NUMBER1 * LV_NUMBER2.

    (OR)

    C = MULTIPLY LV_NUMBER1 BY LV_NUMBER2

    LV_DIV                 = LV_NUMBER2 / LV_NUMBER1.

    (OR)

    D = DIVIDE LV_NUMBER2 BY LV_NUMBER1

    WRITE: / LV_ADD, LV_SUB, LV_MUL, LV_DIV.

    (OR)

    WRITE: / A, B, C, D.

     

    1. Clear Variables

    Keyword CLEAR is used to clear the values in variable to default values i.e. 0 for numeric and “ ” for character field.

    WRITE: / “BEFORE CLEAR”.

    WRITE: / A, B, C, D.

    CLEAR: A, B, C, D.

    WRITE: / “AFTER CLEAR”.

    WRITE: / A, B, C, D.

     

     

    ABAP MATHS FUNCTIONS

    ABAP provides predefined built-in maths functions that you can use according to your requirement.

    Following are some of the Maths Functions:

    FUNCTIONS SUPPORTED NUMERIC DATA TYPES DESCRIPTION
    ABS ALL TO CALCULATE ABSOLUTE VALUE
    SIGN ALL TO DETERMINE SIGN, RETURNS 1 FOR (+) 0 FOR (-)
    CEIL ALL It gives next highest integer i.e.  ceil (2.1) = 3
    FLOOR ALL It gives next lowest integer  i.e. floor (2.1) = 2
    TRUNC ALL It gives truncated part of the input
    FRAC ALL It gives fractional part of input i.e. FRAC(1.2) = .2
    COS,SIN,TAN F It will implement the given trigonometry function
    EXP F It will implement Exponential function
    LOG F It will implement Natural Log on that number
    SQRT F It will return square root of the input
    MOD N It will return remainder mod(12,5) = 2

     

    SAP Operator: Comparison Operators

    Following are the SAP Operator provided for ABAP Comparison Operation:

    Operator Alternate Form Meaning
    = EQ Equality Test returns 1 if equal
    <> NE Inequality Test return 1 if True
    > GT Greater Than Test
    < LT Less Than Test
    >= GE Greater than or Equal
    <= LE Less than or Equal
    BETWEEN Interval Test returns value between two value
    IS INITIAL Initial Test returns True if variable have no value
    IS NOT INITIAL Not Initial Test returns True if variable is not empty

     

    Apart from above operators ABAP also provide Bitwise Operators and Character String Operators

  • What is ABAP

    Preface – This post is part of the ABAP Beginner series.

    What is ABAP?

    A general interview question: “What is ABAP?”. ABAP stands for Advanced Business Application Programming. It is a 4th Generation (because it is domain specific language) programming language developed by SAP. The ABAP kernel is implemented in C++.ABAP is a hybrid programming language that supports both a procedural and an object-oriented programming model.
    All ABAP programs also called Reports reside inside SAP database. In the database all ABAP code exists in two forms: source code, which can be viewed and edited with the ABAP Workbench tools; and generated code, a binary representation somewhat comparable with Java byte code.

    When you write a code in ABAP editor, it is saved in two files. One is the exact what you have written and other is the code converted in Binary format. The Binary code is the one actually executed by the computer.

    ABAP has both compiler and Interpreter. Firstly, the ABAP compiler translates an ABAP program it into an intermediate language called an ABAP load. Then the ABAP virtual machine, an interpreter for ABAP loads (i.e. it can execute ABAP loads) comes into the picture. SAP has two tables to store these files, ABAP reports in D010S table and ABAP Loads in D010L table.

    ABAP on Application Server ABAP

    ABAP is the programming interface of Application Server ABAP (AS ABAP) in SAP NetWeaver. A prerequisite to use the ABAP programming language is to install an Application Server ABAP. The components of an Application Server ABAP can be organized in the layers (presentation, application, and database) of three-tier client-server architecture in accordance with their tasks.

    • The presentation layer represents the user interface of an AS ABAP (SAP GUI or Web browser)and it is distributed to the workstations of individual users.
    • The application layeris implemented by utilizing one or more application servers. The application layer contains the ABAP runtime environment in which ABAP programs are executed.
    • The database layerconsists of a database system in which the central dataset of an Application Server ABAP is saved.

    Programming Models

    ABAP supports the following:

    • An object-oriented programming model based on classesand interfaces
    • A procedural programming model based on function modulesand subroutines

    Both modules offer interoperability.

    Types of ABAP programs

    ABAP distinguishes two types of executable programs:

    • Reports : Simple Programs which provides Input/output option to user
    • Module pools: Complex Programs which provides different screens for better user experience.

     

    The non-executable program types are:

    • INCLUDE modules : It gets included automatically at generation time; it is often used to subdivide large programs
    • Subroutine pools: It contains ABAP subroutines (enclosed by FORM/ENDFORM statements and invoked via PERFORM).
    • Function groups: These are libraries of self-contained FMs (enclosed by FUNCTION/ENDFUNCTION and invoked via CALL FUNCTION)
    • Object classes: similar to Java Classes &define a set of methods and attributes
    • Interfaces: It contain method definitions without implementations for which any class implementing the interface must provide explicit code.
    • Type pools: Type pools define collections of data types and constants.

     

    Development Environment

    There are two possible ways to develop in ABAP.

    ABAP Workbench

    The ABAP Workbench is part of the SAP ABAP system and is accessed via SAPgui. It contains different tools for editing programs. The most important of these are (transaction codes are shown in parentheses):

    • ABAP Editor(SE38): It is used to write and edit reports, module pools, includes and subroutine pools
    • ABAP Dictionary(SE11): It is used to process database table
    • Menu Painter(SE41): It is used to design the user interface (e.g. menu bar & standard toolbar)
    • Screen Painter(SE51): It is used to design screens and flow logic
    • Function Builder(SE37): for function modules
    • Class Builder(SE24): It is used to construct ABAP Objects classes and interfaces

    The Object Navigator (SE80) provides a single integrated interface to access various tools (including all tools mentioned above).

    ABAP Development Tools

    • Using certain set of plug-in in the Eclipse platform we can develop ABAP programs in eclipse, these are formally known as “ABAP in Eclipse” or ABAP Development Tools (ADT).
    • In this scenario, the ABAP developer installs the required tools on his computer and works locally, whereas a continuous synchronization with the backend is performed.