0% found this document useful (0 votes)
30 views124 pages

Core ABAP Fundamentals Overview

The document provides a comprehensive overview of SAP ABAP, covering its fundamentals, advanced concepts, database integration, and HANA-specific features. It explains the architecture, landscape, and various modules of SAP, as well as programming techniques and data management within the ABAP environment. Key topics include data types, control structures, reporting, debugging, and modularization techniques essential for effective SAP application development.

Uploaded by

ms1381598
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views124 pages

Core ABAP Fundamentals Overview

The document provides a comprehensive overview of SAP ABAP, covering its fundamentals, advanced concepts, database integration, and HANA-specific features. It explains the architecture, landscape, and various modules of SAP, as well as programming techniques and data management within the ABAP environment. Key topics include data types, control structures, reporting, debugging, and modularization techniques essential for effective SAP application development.

Uploaded by

ms1381598
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Level 1 Fundamentals of SAP АВАР

Introduction to SAP and SAP ABAP , Architecture , Landscape

ABAP Development Tools and Environment

ABAP Workbench Basics

ABAP Data Types and Operators

ABAP Control Structures

ABAP Data Dictionary DDIC => Table Creation , Data Element , Domain , Create entries

Classical Reporting

ABAP Debugging Techniques


Level 2: Advanced ABAP Concepts

ABAP Modularization Techniques

ABAP Object-Oriented Programming

Enhancements and Modifications => VA01 , CV02 , SE38

ABAP Performance Optimization

SAP User Interfaces (SAP GUI)


Level 3: Database Integration and
Interfaces
ABAP Database Access and SQL

ABAP ALV Reports (ABAP List Viewer)

ABAP BAPI (Business Application Programming Interface)

ABAP BDC(Batch Data Communication)

ABAP IDoc (Intermediate Document)

ABAP RFC (Remote Function Call)

Smartforms
Level 4: SAP ABAP on HANA
ABAP HANA Introduction

New Syntax

Native HANA Development

Stored Procedure

ADBC (ABAP Database Connectivity) AMDP (ABAP Managed Database Procesor)

ALV IDA (Integrated Data Access)

CDS (Core Data Services) / AMDP

HANA Modelling

Open SQL
ERP Centralised / De centralised

• ERP stands for Enterprise Resource Planning.

• It is a type of software that helps organizations manage their daily business activities​

• ERP business management software integrates various functions of a business.

• An ERP system typically implements a common database in which all the data from various business functions of
an organization are stored.​

• ERP systems can automate processes and connect data from multiple business functions.​
SAP
• SAP stands for System Applications and Products in Data Processing​

• SAP is a type of enterprise resource planning(ERP) software that businesses use to smooth operations ​

• SAP collects, stores, and processes data across business applications and functions in one platform.​

• It enables customers to perform day-to-day business processes, such as: Accounting, Sales, Production, HR,
Finance.​

• Current SAP version – 7.70 ​

• The business function within SAP ERP’s software are called modules.​
SAP
SUVINAY PVT LTD STEK SOLUTIONS

Eg – Manufacturing Company

Production Register
Sales Register SAP
Purchasing Register
Material Development Register
Finance Register
HUMAN RESOURCE Register
Full Forms

SAP – System Application Products in Data Processing


ABAP – Advanced Business Application Programming
HANA – High Performance Analytic Appliances
Modules
in SAP
ABAP
• ABAP (Advanced Business Application Programming)​

• ABAP is a programming language used to develop applications in SAP. ​

• To work with modifications, enhancements or customer developments you need knowledge of application
development within ABAP ​

• ​Table ,Enhancements , Transaction Codes , Reports (Classical Report , Interactive Report , ALV Reports)
Layers in SAP system

1. Presentation Layer
2. Application Layer
3. Database Layer

a. Presentation Layer – where the data got displayed


b. Application layer – It gets a request from presentation layer and then it will fetch the data from database layer
c. Database Layer – where all the data stored
Architecture in SAP
R1 where R stands for Real Time
In R1 all the layers lies on the same system
Presentation layer
R2
In R2 Presentation Layer lies on the different system and
Application + Database Layer lies on the different system

Application layer

Database Layer
R3
In R3 all the 3 layers lies on 3 different
Presentation Layer (Output Screen) systems

Application Layer (It will be used to fetch the


data from DB and pass it to Presentation Layer)

Database Layer(All the data stored here )


Landscape of SAP

Development (DEV) Quality (QAS) Production (PRD)

In development system we
develop code
Select fields from mara table
Select fields from mara table
where <condition>.
where.
How we used to send the object from one system to another system?
(from DEV to QAS or QAS to PRD )
We used TR ( Transport Request)
Which is used to carry objects from one system to another system
Standard and Custom Object
If the object name starting with Z or Y then it is a Custom Object

If the object name starting other then Z or Y then it’s a Standard Object which means we cannot change it because its given
by SAP
Also we can only enhance the object if the enhancement is available for the object

Z,Y
SAP System
What is a connection ?
Through connection we can connect with the SAP system
The connection details will be provided to us by the Basis Team / Client

We cannot simply download the SAP system to our desktop/ local system we need SAP User ID for downloading the SAP
LOGON
100 600
So we have divided the system into different clients
What is client?
Client is a space in the system 500
And client is a number ranging from 000 to 999
900
Every client is having multiple Users

All the details of this client and username / password


Will be given to use by the BASIS team
Transaction Code
Transaction Code –
This is a shortcut to open any sap application and we enter this into the command bar
These are given to us by SAP system or we can create our custom also

How to logout – /nex

Some transaction code –


SE11 - Data Dictionary (Used to create tables )
SE38 – ABAP Reporting (Used to write the code)
SE16 – Data Browser (Used to display the data)
SE16N – New Data Browser ( ------ )
/o – Open the new tab
/n – Close the current tab
SE21 – Creating Package
Package and Local Object
Inside SAP whatever we will develop we have to store it at some place so there are two options two store it
1. Package – If we storing our object inside package then we mandatorily have to store it in a TR (Transport Request) , so
we can transport it to next system .
We can create our custom package SE21 .
2. Local Object – If we storing our object inside local object then we can not transport it to next system
$tmp
There are some option we can move objects from local object to package – SE80
SE11 - ABAP Data Dictionary
Domain -> Domain describes the technical attributes of a field/column.

The technical attributes means data type and length.

Domains are linked to Data elements.


Data Element
This describes the appearnce of a field to the end user.

This is used to provide a meaningful description to the field.


Table
Table is a collection of rows and column.
Master Data -> The data which will be accessed frequently but changed
rarely.

Transactional Data -> can change very often.

Cofiguration Data -> the Data which we can customize. Or used for
configuration of SAP.
Size Category
This tells SAP that how much or the quantity of records that will be
stored in that table.

So SAP will allocate the memory to store that data.

If no. of records exceeds then also it will be stored. It just gives hint to
SAP for the expected number of records.
TMG(Table Maintainace Generator)
TMG is used to maintain(insert, update or delete) data into the table.

Authorization Grp -> Means who are the people who can access or
maintain the data in table.

Function Group -> Handles or inclueds all the function modules related
to your TMG.
TMG
Maintaince screen-> how many screens will be visible in order to
maintain the data.
1 step -> one screen(Overview Screen)
2 step -> two Screen

Tcode to view TMG is SM30.


Client Dependent and Client
independent
Client Dependent Table -> if the first field of the table is MANDT then it
is clinet dependent table.

Client independent table -> if the first field is not MANDT then it is a
client independent table. hence we can access and modify the data
from any client.
Primary key
Every table must have atleast one primary key.

Primary key is helpful in identifying the unique records.

What is the maximum number of primary key?


The max number is 16 keys
Data Class
It is the part of technical settings of a table.

It determines in which portion of the database the table will be stored.

APPL0
APPL1
APPL2
Structures
Structure is a collection of fields of same data type or different data
type.

We create a structure for Reusability.


2 Ways to use structures.
1. Include Structure - can be added at any position in the table.
2. Append Structure
Views
View is a virtual table.

A view will contain the value at runtime.(View is a logical database


table).

Difference between table and view is table will hold the data while view
does not have any data.
Types of Views
4 Types of Views
1. Database View.
2. Projection View.
3. Maintainance View.
4. Help View.
Database View
This view is used to fetch the common records from multiple table and
it follow inner join.

We can combine more than one database table.

Tables must have relationship between them.


Projection View
This view is only applicable for single table.

If we want to show limited fields of a table then we go with projection


view.

Projection view is equivalent to database view for one table.


Maintanance View
This view is used to maintain the data of multiple tables.

Data will be entered and then distributed to the tables.

TMG will be generated but for the view Hence we can directly modify
all the fields of the multiple tables.
Help View
Help View is used in Search help.
Search help
Also called as Value help or F4 help.

This provides the various possible values or acceptable values for a


field.
2 types of Search help.
1. Elementary Search help.(Single search help)
2. Collective Search help.(Combination of elementary search help)
Selection method -> From where to populate the data.
Dialog Type -> 3 types
1. Display Value immediately-> this will show the result directly.
[Link] with Value Restriction -> This will show a restriction popup for
filling the values for search help.
[Link] Depends on set of values -> If the results are less than 100
then it will behave as 1 otherwise 2.
Lock Objects
The purpose of lock objects is to achieve Synchronization.
if multiple users want to change same thing or data. Then only one user
will be allowed at a time.

It will start with the prefix E.(EZ<objname>)


The TCODE for viewing lock objects is SM12.
SE38 Classical Reports / Program
Executable programs -> which we can directly execute with the help of
execute btn.
To print anything in the output we are having a keyword - WRITE
Comment - Comment is the non executable line in the code which we
just give for reference.
In line comment -> “
Full line comment -> *
Shortcut -> CTRL + <
Uncomment -> CTRL + >
SE38
Variables -> Where we can store some data.
So we can delcare variable of some type?

Variable can be of CHARACTER, INTEGER, Numeric, DATE, String etc.

In ABAP, the data flows from right to left.


‘:’ is the chain operator with which we can combine multiple lines of
similar code.
Data type
We can also use Data elements to declare a variable.

Constant keyword is used to declare the constant values in our report.


These values of the variable, we can’t change later on in the report.

Structure -> Just a combination of fields which doesnot hold any data.
This is just to give reference.
Aggregation Function
Sum , Subtract, Divide, Multiply
+, -, *, /
Internal table
Internal table is the temporary table which we declare in program and
can use only in the same program.

Internal table can hold any number of records at the same time. The
data that internal table will hold will only be during runtime.
Work Area
work areaa is again a temporary area but it can hold only single record
at a time.

Append -> Append is used to fill the internal table from work area.
Append will add the record at the last vacant place in the internal table.
Loop at
We use loop on internal tables to move record of internal table to work
area.
Loop will work until the last record of the internal table.
2
1--- Executed the 1st record
then went for 2nd record.
If no more record. then loop will terminate.
If else Statement
If is a conditional statement.
Every if statement ends with endif.
we can provide multiple conditions using elseif.

Multiple statement blocks are there, depending upon the condition one
block will execute
If none of the block’s condition is satisfied then it goes else part.
Do loop
Do loop is called as unconditional loop.

Every do loop ends with enddo.


Syntax-> Do <n> TIMES.
<Statement>
ENDDO.
IF <Condition>
<Statement block>
endif.

IF <Condition>
<Statement block>
else.
<statement>
endif.
System Variable
System variables are pre-defined variables by SAP.
SYST is the structure for the system fields.
All system fields are addressed using SY field name.
The common system variables are:
SY-SUBRC -> system variable for return code.
0 -> Successful
not successfull if other than 0.
• Sy-tabix -> it returns the current line index inside a loop.

• sy-uname -> it return or holds the logon name of the USER.


Select Query
Where we are working means on which layer we are working on?
Application layer.
Now we have to display data to the presentation layer.
and our data is stored in database layer.

Now to fetch the data from the database layer to the application layer
we use SELECT query.
Open SQL
SQL stands for structured query language.
It is of 2 types
1. OPEN SQL -> Open SQL is database independent.
2. Native SQL -> Native SQL is database dependent.
For ALL Entries in
When we fetch the data from multiple tables, ‘For ALL ENTRIES IN’ is
one of the approach.

It reduces the database load. if header data is not present then we will
not query the item table.

The parent internal table(lt_tab) must not be empty.


OPEN SQL query -> JOIN
With the help of join, we can read from one or more tables in a single
select statement.
Join is of 2 types
1. Inner Join
2. Outer Join
Inner Join
An inner join will find and return matching data from tables based upon
a specific condition or specified condition.

If one or more criteria are not met then no data record will be fetched.
Outer Join
Outer join finds and returns matching as well as non matching data
from the table.

2 types
1. Left Outer join
2. Right Outer Join
Left Outer Join
The left outer join takes all the values from the left table and combines
them with values from right table which meet the criteria.

RIGHT OUTER JOIN


The right Outer join takes all values from the right table and combines
them with the values from left table which meet the criteria.
Classical Reports Events
Event is always triggered by a specific action or specific occurence.

The example of specific actions are mouse click, pressing a key etc.

The same concept of events is applicable to classical [Link]


events trigger by specific user action and some events trigger at specific
occurence.
Types Events
1. Initialization
2. At Selection-screen
3. Start-of-selection
4. End-of-selection
5. Top-of-page
6. End-of-page
Intialization
This event calls before displaying the selection screen / input screen.
This is the first event that is called.

What is the purpose of this event?


The purpose of this event is to assign the default values to parametes
and select option
AT Selection-Screen
This event calls when user performs some actions(enter, click) on the
selection screen

Purpose of this event is to validate the input.


Start-of-selection
This event is called when the user clicks execute button on the selection
screen.
The selection logic is the part of this event.
End-of-selection
This event is called when selection process ends.

This event helps to identify the end of data.


Top-of-page
This event is called when the first write statement occurs in a program.

Purpose is to provide title or heading at the beginning of new page.


End-of-page
This event is called at the last write statement.
The purpose is to provide some footer info at the end of a new page.
Modularization Techniques
Modularization is a technique used to divide the application program
into smaller chunks/units.
This helps to maintain the code in easy manner and reduce code
redundancy.
The ways we can achieve modularization are
1. INCLUDE Programs
2. Subroutines
3. Function Modules.
Include Programs / Include
Include Program is a modularzation technique. we use include program
to organize a program code in smaller units.

How can we create an include Program?


We can create include programs from se38.
The type of include program is ‘I’.
We can not execute an include program directly.
This is useful inorder to declare the data or to handle data declaration.
Include
The syntax to use an Include Program in another type of program is

INCLUDE <include_pgm_name>.
INCLUDE ZINC_DEMO.
Fuction Modules(FM)
It is also a modularization technique.
The TCODE to create this FM is SE37.
Before Creating a function Module we need to create a function group.
Function Group is a container for function modules.
we can create Function group from SE80/ SE37(using menu bar).
A function group can store max of 99 function modules.
Function Module
These are the block of code with parameters. We can call it anywhere in the SAP
system.
What are parameters? -> Parameters are the input and output values of function
modules.
Types of Parameter.
1. Import -> Input to the Function Module(FM).
2. Export -> Output from the FM.
3. Changing -> These parameters can acts as both import/export.
4. Tables -> Pass the internal table(Oboselted)(old).
5. Source Code -> Where we will write the logic which can use the parameters
passed.
Function Module
As tables parameter are obselete(old) so we use Table types in order to
import or export tables from our Function Modules.
Subroutines
Subroutine is also a modularization technique
We can write this subroutine inside our main program also.

There is no separate TCODE for subroutine


A subroutine is a block of code written inside FORM and ENDFORM.
Syntax -> FORM
<Logic/ statement>
ENDFORM
Subroutine
Call subtax-> PERFORM <Perform name>.
Subroutines are written at the end of report.

PERFORM <Perform name> tables <table parameter> USING <using


parameters> Changing <changing parameters>.

*This sequence of tables, using, changing should not change.


if any of this is not required then we can skip it.
OOPS - > Object Oriented ABAP
Class, Methods, Object (building blocks of OO ABAP)
Class has attributes.
Class is of 2 types
1. Global class -> it can be accesed throughout the sap system. SE24
2. Local class -> it is accesed in the place where it is written that is
reports. SE38

Attributes can be understood as variables for your class.


OOPS
Types of attributes
[Link] Attribute
2. Static Attribute

Visiblity Section
Public Section
Protected section
Private Section
OO ABAP
Class -> Collection of Objects( Methods, Attributes)

Object -> Instance of class, or Blueprint of class.


Pillars of OO ABAP
Inheritance
Polymorphism
Encapsulation
Abstraction
Inheritance
It means to derive code functionality from one class to another class.
It means defining a class in terms of another (parent) class.

Final -> This denotes that no subclass can be created for the
corresponding final class.
Inheritance
Public -> same class, derived class, Outside(non derived class)
Private -> Same Class.
Protected -> Same Class, Derived class.
Encapuslation
This means wrapping data and functions together.
This hides the data and functions from the outside world, thus
promoting data hiding.

How can we achieve encapusation in ABAP?


Public, Private, Protected.
We can also do it via Interfaces
Interface
In Interface all methods are public by default.
The methods are also Abstract.(There is only definition but no
implementation)
Polymorphism
It means existing in many forms.

It means using one thing for different operation.

Polymorphism means redefining the methods to override them.

We can achieve this using inheritance concept with REDEFINITION.


Me keyword
A method can have a variable defined within it having the same name.

To clearly identify the class level attribute we use the selector or


keyword provided by SAP called as ‘ME’.
Enhancement and Modification
Enhancement -> we will enhance the SAP functionality in customer
namespace(Z or Y).
Modification -> We will enhance the SAP functionality in SAP
namespace(Name should not start with Z or Y). X(Never Recommends
and is obselete)
Types
1. Implicit & Explicit Enhancement
2. Customer Exit
3. BADI(Business Addin’s)
4. USER EXIT(MODIFICATION) X (sales)
Implicit Enhancement
In case of Implicit enhancement, there is an implicit point present at
the start or at the end of the program, Subroutine, Function modules.

We create the implicit implementation using these implicit points.


Explicit Enhancement
In case of explicit enhancement, enhancement point and section are
available at any line.

We create the explicit implimentation using these points and section.

Enhancement spot -> It is the container for enhancement pont and


enhancement section.
Enhancement Point Vs Section
Enhancement point does not have default implementation whereas
Enhancement section has default implementation.

With the help if Enhancement point, we can only add additional codes,
we cannot replace or change the existing code.

With the help of Enhancement section we can change the existing


code.
Customer Exit
Customer Exit is an Enhancement. We Enhance the functionality in
customer namespace.

There are 3 types of customer exit.


1. Function exit
2. Menu Exit
3. Screen Exit
User Exit
These are only available in SD module.
VA01, VA02, VA03

User Exit can be found in mostly 3 include.


MV45AFZ*
MV50AFZ*
RV60AFZ*
We need access key from SAP
How to find Customer Exit
We have 2 TCODES -> SMOD, CMOD
1. We need to get the Package of the object.(SE93)
2. GOTO SMOD and put the package name and find relevant exit.
3. GOTO CMOD and Create a project and add the exit and your relevant
code.

Customer Exit can only have one implementation


BADI
BADI means Business Addins
Badi uses the concept of classes and methods to achieve enhancement.
2 TCODEs
SE18 -> View the BADI
SE19 -> Implement the BADI.
BADI

 BADI means Business Addins


Badi uses the concept of classes and methods to
achieve enhancement.

 2 TCODEs
SE18 -> View the BADI
SE19 -> Implement the BADI.
Perform Improvement
We can improve the performance of looping nested tables or logic.
This can be achieved using Parallel Cursor method.

Most Important thing to note in this method is that the tables should
be in sorted manner.
ALV -> ABAP List Viewer
This concept is there so that the user can see the end report in a better
and clear manner.
ALV uses the Concept of Function Modules to build it.
1. REUSE_ALV_LIST_DISPLAY
2. REUSE_ALV_GRID_DISPLAY
LIST DISPLAY ALV
Basic Report
Additional Functionalities -> Sort, Filter, excel, Mail.
Zebra, vline, col head, Traffic light
Data Migration Technique
BDC(Batch data Communication)
Steps included are
Extracting the data -> Extracting data from legacy system to file.
Converting data -> Convert in appropriate format.
Importing the data -> import data to SAP.
Verfiy the data -> check wheter data is created in SAP.

TCODE for BDC -> SHDB


IDoc (Intermediate Document)
IDOC -> Idoc is a data container which is use for the data transfer from
one system to another. The data transfer can be sap to sap or sap to
non-sap.

What type of data is transferred:


1 Master data: Material Master.
2. Transaction data: Purchase order, Sales order.
3. Cutom field data.
IDoc
Every IDOC has a unique number assigned to it.
There are 2 types of IDOC process
1. Inbound process -> if data is coming into SAP system
2. Outbound process ->If data is going out from SAP system
IDOC Architecture
IDOC is divided into 3 parts.
1. Control Record
2. Data Record
3. Status Record

TCODE to display an IDOC is -> WE02 or WE05.


Control Record
It provides the control information such as IDOC type(Basic type),
message type, port, partner number etc.

it also provides the direction(inbound or outbound) of IDOC


1-> outbound
2-> inbound
The control record data is stored in EDIDC table.
Data Record
It provides the whole data of the IDOC.
The data is stored in Segments.
It stores in table EDID4.
Status Record
It provides the status of IDOC(Successful/error).

The values 1-42 are of Outbound status


50-75 are for inbound status.

ALE-> Application Link Enabling


Message Type
It specifies the meaning of data.
It tells for which purpose the IDOC is going to fire.
TCODE -> WE81.
IDOC type
It is also called as basic type
It specifies the structure of data which is to be exchanged.

TCODE -> WE30.


Segment
These are the basic elements of IDOC type.
Data is stored in the Segments.
TCODE -> WE31.
IDOC settings - Port
Port Defines the technical link between sender and receiver system.
Port in SAP acts as communication channel to send IDOC’s.

TCODE -> WE21.


Partner Profile
A partner is one whom we conduct business and exchange document.
In the partner profile, we maintain the parameters that are necessary
for exchanging the data.

TCODE -> WE20


Smartforms
Smartforms are layouts in SAP.
We design the layout using smartforms.

TCODE -> smartforms


Various parts of smartforms
Form Attributes -> It provides the generic info of smartform like date ,
time, package etc.

Form interface -> The purpose of form interface is to pass input and
output parameters.

Global Definition -> It is a global part of smartforms which is accessible


by all elements of the smartform.
Window
For every individual section of the layout, we need to create a window.

By default Main window is present.


HANA
Hana is a database cleared by SAP in 2015.
HANA -> High-performance ANalytical Appliance.
High perfor -> it is very fast database.
ANalytical -> this db is capable of analyzing huge records.
Appliance -> this advancment is caused by both hardware and software
innovation.
HANA
Magic words.
1. In-memory database
2. Column store
3. Data Compression
4. OLTP & OLAP
5. Table Partion
6. Code Push Down.
In memory Database
Now we have multicore architecture.
Core -> how many process can run simultaneosly.
8 CPU(16 cores)

Address Spaces
64 bit address spaces(2**64)(4TB storage)
32 bit (GB)
Data communicated will be super fast
Row Store
The data is stored in row wise format in the DB level.

Attributes
low compression rate
the content of row placed next to each other in main memory.
We need secondary indexes for fast data reading.
Column Store
The data is stored in column format in the DB.

Attributes
High compression rate(it can store more data in less space)
Don’t need secondary index
When to use column store
that are subject to column operation on a large number of rows.
That have a large no of column, more unused.
That are subject to aggregation and intensive search operation.
Row storage is more suitable for
tables
that contain mainly distinct values leading to low compression rate.
In which all/most of columns are relevant.
When we don’t need to perform any aggregation.
When we have small no. of records.
Advantages of Data compression
Lower storage requirement

Accelarate data transfer from main memory.


OLTP & OLAP
OLTP -> Online transactional Processing
OLAP -> Online Analytic Processing
OLTP
Current Data( 6 - 18 months)
Day to day operation
OLAP
Historic Data(2 - 15 years)
Decision making planning
OLTP & OLAP
This concept is no longer required as HANA is capable to store and
query huge no of records with no performance lag.\

So we don’t have any redundant data and no data duplicay we also save
time and money.
Table Partitioning
This concept is used to partition the table records based on diffrernt
algos. (Round Robin).
Hence we can query the table very fast as we are selecting small chunks
of records.
Advantages
Load distribution
Deletion of data
Parallel processing
Code Pushdown
Code Push down
In memory computing:
Avoid movement of large volume of data

Perform data intensive calculation in database.

You might also like