0% found this document useful (0 votes)
163 views38 pages

SAP-ABAP Training Tutorals

The document provides an overview of SAP ABAP training, including: - What is SAP and SAP ABAP - SAP stands for Systems, Applications and Products and SAP ABAP is a programming language used for developing applications for the SAP R/3 system. - Key ABAP development tools like the ABAP Workbench, Dictionary, and programming concepts such as data types, variables, internal tables, and screen processing.
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)
163 views38 pages

SAP-ABAP Training Tutorals

The document provides an overview of SAP ABAP training, including: - What is SAP and SAP ABAP - SAP stands for Systems, Applications and Products and SAP ABAP is a programming language used for developing applications for the SAP R/3 system. - Key ABAP development tools like the ABAP Workbench, Dictionary, and programming concepts such as data types, variables, internal tables, and screen processing.
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
You are on page 1/ 38

SAP ABAP TRAINING

TUTORIALS
Lecturer: Nguyễn Hoàng Phong
Main Contents

 What is SAP System?


 What is SAP ABAP?
 SAP ABAP Workbench
 ABAP Dictionary
 ABAP Programming
 BDC & LSMW Tools
 BADIs(Business Add Ins)
What is SAP system?(1)

 What is SAP?
- SAP stands for Systems, Applications and Products in data
processing.
- SAP is the fourth largest software company in the world.
- The SAP R/3 system is a business software package
designed to integrate all areas of a business.
- It provides end to end solutions for financials,
manufacturing, logistics, distribution etc.
- All business processes are executed in one SAP system
and sharing common information with everyone.
What is SAP system?(2)

 SAP R/3 Modules & Integration


What is SAP system?(3)

 SAP Functional Modules


- FICO – Finance & Control
- PP – Production Planning
- MM – Material Management
- SD – Sales & Distribution
- HR – Human Resources
What is SAP system?(4)

 SAP Technical Modules


- ABAP – Advanced business applications
programming
- XI – Exchange Infrastructure
- Net viewer
- Basis
- BIW – Business Information Warehousing
What is SAP ABAP?(1)

 ABAP stands for Advanced Business Application


Programming / 4th Generation Language. ABAP is
a programming language used for developing
applications for the SAP R/3 system. SAP will run
applications written using ABAP /4.
What is SAP ABAP?(2)
SAP ABAP Workbench(1)

 ABAP workbench is a graphic programming to develop


various applications by using ABAP language in ERP
SAP R/3 system. It is a central part of SAP business
applications.
 SAP ABAP Workbench provides various tools to create
ABAP programs and perform development activities
such as ABAP Dictionary, Editor and painter.
 ABAP Workbench used to develop, test and run various
ABAP programs in SAP R/3 system.
SAP ABAP Workbench(2)

 ABAP workbench Tools:


All the tools are integrated with each other, by using workbench tools you can create programs,
interface, web services and access data base connections. The important tools of work bench are
as follows:
 ABAP Dictionary: It records and processes all objects and process data base table
definitions(SE11)
 ABAP Editor: ABAP editor used to write and maintain programs, editing the screens and edit the
reports (SE38)
 ABAP Painter: ABAP painter designs and maintains SAP GUI (Graphical user interface) screen
for a client(SE51)
 Class builder: Used to write and maintain Class (SE24)
 Function builder: Used to write and maintain Function modules (SE37)
 Maintain message: Used to define the message (SE91)
 Object navigator: The Object Navigator is a central point of entry into the ABAP Workbench. It is
the successor of the Repository Browser (SE80) .
 Menu painter: Used to create menu for a program(SE41)
 Maintain transactions: Used to create the transaction code(SE93)
 ABAP text elements: Used to define the text elements in program or class(SE32)
ABAP Dictionary(1)

 Overview:
ABAP dictionary is a central storage area for the description where we can
create the objects and changing, deleting the objects related to data base.
The main object type of ABAP dictionary are:
 Database tables: - It helps in create and maintain the tables, table
should begin with letter Y or Z and length up to 16 characters.
 View : - It act as virtual table and helps in retrieve the data.
 Data type: - It helps in creating the user defined data elements, structure
and tables.
 Type group: – It creates the data group types in dictionary
 Search help: – It defines the search help (F4) for the fields of database
table and helps in providing the values for a user search queries
 Domains: – Domain specifies the technical characters of a field such as
data type field and length.
 Lock objects : - It is used to synchronize the same data by one user or
multiple users. SAP provides three types of lock objects- Read lock, write
lock, enhanced lock.
ABAP Dictionary(2)

 How to create the object types of ABAP


Dictionary?
Open ABAP Dictionary working area by two methods:
 Enter transaction code SE11 in SAP command field and press
enter.
 SAP Menu Path: – SAP Menu >>> Tools >>> ABAP Workbench
>> Development >> ABAP Dictionary.
ABAP Programming(1)

 Processing data
 Logical Expressions
 Controlling the program flow
 ABAP Program Structure
 Data types and Data Objects
 Variable Types
 Internal Tables
ABAP Programming(2)- Processing
data

 Calculation Operators:
 Add or “+”:
Syntax: add X to Y  Y = Y + X
 Divide or “/”
Syntax: divide X by Y  X = X / Y
 Multiply or “*”:
multiply X by Y  X = X * Y
 Subtract or “-”:
subtract X from Y  X = X - Y
 Assigning values:
 Operator =
 Keyword MOVE (MOVE-CORRESPONDING)
 Keyword WRITE TO
ABAP Programming(3)- Logical
Expressions
ABAP Programming(4)- Controlling
the program flow

 Loops
 Unconditional Loops( DO…ENDDO):
Syntax:
DO n times.
statements.
ENDDO.
 Conditional Loops( WHILE…ENDWHILE)
Syntax:
WHILE logical expression.
statements.
ENDWHILE.
ABAP Programming(5)- Controlling
the program flow

 Branching conditionally
 IF control structure
Syntax:
IF expression1.
statements.
[ELSEIF expression2.
statements.]
[ELSE.
statements.]
ENDIF.
 CASE control structure
Syntax:
CASE variable.
WHEN value1.
statements.
WHEN value2.
statements.
ENDCASE.
ABAP Programming(6)- ABAP
Program

 Create ABAP Program:


Use Tcode SE38 to create a ABAP Program.
 The types of ABAP Program:
 Executable Program
 Module Pool
 Function Group
 Subroutine Pool
 Interface Pool
 Class Pool
 Type Pool
ABAP Programming(7)- ABAP
Program

 Screen Process in ABAP Program(1)


 Selection Screen(Report Programming)
 Define selection field
 Select-option
 Parameter
 Screen block
 Events in Report programming:
 Initialization
 At selection-screen
 Start-of –selection
 End-of-selection
ABAP Programming(8)- ABAP
Program

 Screen Process in ABAP Program(2)


Normal Screen(Dialogs Programming):
 How to create normal screen
 GUI status
 GUI title
 Screen Flow Logic:
 Process Before Output(PBO)
 Process After Input(PAI)
 Process On Help Request(POH)
 Process On Value Request(POV)
ABAP Programming(9)- Data
types(1)

 Overview:
All ABAP programs use data to work on, which are
characterized by a length, name and data type.
Every data in an ABAP program has these attributes.
Data type describes the content of the program. Data
objects on the other hand are instances of an
abstract data type. In SAP both data objects and data
types have separate name spaces.
ABAP Programming(10)- Data
types(2)

 ABAP Data types can be divided into elementary,


reference, and complex types.
 Elementary type: They are data types of fixed or variable
length that are not made up of other data types. In variable
data types the memory space used by the data objects
changes dynamically during runtime and their definitions
can be altered later. This is not so with fixed length data
types.
 Reference Types: – These data types describe reference
variables, which are data objects that have references in
them. Reference variables are components of a complex
data object like structures or internal tables.
ABAP Programming(11)- Data
types(3)

 ABAP Data types can be divided into elementary, reference, and


complex types.
 Complex Data Types: – Complex data types are those that are made up of
other data types. They are of two types – structured types and table types:
 Structures : – Structures are used to group together work areas that logically
belong together. The various elements of a structure may be of any type, or can
be a different structure or internal table as well. Structures may be classified as
Nested and non-nested structures or Flat and deep structures.
 Nested structures contain one or more other structures as components, unlike
non-nested structures.
 Flat structures contain only elementary data types of fixed length.
 Deep structures contain at least one internal table, reference type, or a string as a
component.
 Internal Tables: – Internal tables may contain a series of lines that are all of the
same data type. Internal tables have a line type, which is used to identify table
rows using a unique or non-unique key and a table type that determines just how
individual table entries, whether non-sorted, sorted index tables or hash tables
are accessed.
ABAP Programming(12)- Variable
Types

Define variable types:


Use key word: DATA, TYPES
Sample:
DATA: var1 TYPE data element | Domain | Predefined
type
ABAP Programming(12)- Data grid
control

Two basic data grid controls:


Table Control
ALV Grid
ABAP Programming(13)- Internal
Tables(1)

 Three internal table types:


 Standard internal table
 Sorted internal table
 Hashed internal table
 Define Internal table:
 Use key word DATA, TYPES in ABAP code or use
SE11 define in data dictionary with Table type
optional.
ABAP Programming(14)- Internal
Tables(2)

 Access data in internal table:


 Using LOOP AT statement:
 Syntax:
 LOOP AT itab INTO| ASSIGNING wa|<field-
symbol> [WHERE condition].
ENDLOOP
ABAP Programming(15)- Internal
Tables(3)

 Access data in internal table:


 Using READ TABEL statement:
 Syntax:
 READ TABLE itab INTO| ASSIGNING wa|<field-
symbol> WITH KEY field name 1 = value1 [field
name 2 = value2] […] | WITH TABLE KEY primary
key1 = value1[…] | INDEX index [BINARY
SEARCH].
ABAP Programming(16)- Internal
Tables(4)

 Access data in internal table:


 Using MODIFY TABLE statement:
 Syntax:
 MODIFY TABLE itab FROM wa [TRANSPORTING
field name 1, …] WHERE condition| INDEX index.
ABAP Programming(17)- Internal
Tables(5)

 Access data in internal table:


 Using APPEND/ APPEND LINES OF statement:
 Syntax:
 APPEND wa TO itab.
 APPEND LINES OF itab1 TO itab2
 Note: if itab1 and itab2 are the same structure
then use “=“ operator to assign itab1 to itab2.
ABAP Programming(18)- Internal
Tables(6)

 Access data in internal table:


 Using DELETE statement:
 Syntax:
 DELETE itab [WHERE condition].
 Using SORT statement:
 SORT itab [ASCENDING|DESCENDING] BY
Field1 Field 2 …
ABAP Programming(19)- OPEN
SQL(1)

 Basic Open SQL Statements:


 Select:
 Syntax: SELECT result
FROM source
INTO|APPENDING target
[[FOR ALL ENTRIES IN itab] WHERE sql_cond]
[GROUP BY group] [HAVING group_cond]
[ORDER BY sort_key].
...
[ENDSELECT].
ABAP Programming(20)- OPEN
SQL(2)

 Basic Open SQL Statements:


 Insert:
 Syntax:
INSERT { {INTO target VALUES wa }
| { target FROM wa|{TABLE itab} } }.
 Update:
 Syntax:
UPDATE target { {SET set_expression
[WHERE sql_cond]}
| {FROM wa|{TABLE itab}} }.
ABAP Programming(20)- OPEN
SQL(3)

 Basic Open SQL Statements:


 Delete:
 Syntax:
 DELETE { {FROM target [WHERE sql_cond]}
| {target FROM source} }.
 Note: After insert, update, delete, modify must be
added Commit work/Rollback work statement.
BDC & LSMW Tools

 Self study
BADIs(Business Add Ins)

 Self study
References

 Website http://www.saponlinetutorials.com
 Website http://www.saptechnical.com
 BC-ABAP Programming – SAP AG
THANK YOU!

You might also like