SlideShare a Scribd company logo
ABAP/4
SAP - Programming Language
Introduction to ABAP/4
ABAP - Advanced Business Application Programming
ABAP/4 is the only tool used by SAP to develop all of its applications.
SAP customers use ABAP/4 for their own developments.
Some of the features of ABAP/4:
• ABAP/4 is multi-lingual.
• ABAP/4 contains a subset of SQL called open SQL.With open
SQL you can read and access data base tables regardless of the database
system you are using.
• ABAP/4 contains a special type of subroutine called function
module.
• ABAP/4 allows you to define and process internal tables that
exist only for the execution period of the program.
Main types of ABAP/4 programs:
1) Report programs
2) Dialog programs
Report programs:
A report program generates a list from database tables in a user defined
format. It does not alter the data in the database but only analyses(reads)
them.The results which can be displayed on the screen or sent to a
printer.
A report program can either be an online or background program.
Dialog programs
Dialog programs read and change database tables. It is also called as
Module pool programs.It accepts user information,processes the
information and updates the database. For this reason module pool
programs cannot be executed in background.
ABAP/4 Workbench tools.
The ABAP/4 development workbench contains tools you need to create
and maintain ABAP/4 programs.
The tools are:
1. Object browser
2. ABAP/4 Dictionary
3. ABAP/4 Editor
4. Function library
5. Screen painter
6. Menu painter
ABAP/4 Statements
Any ABAP/4 statement begins with a keyword and ends with a
period(.).
Keywords
A keyword is the first word of a statement. It determines the meaning of
the entire statement. There are five different types of keywords:
• Declarative keywords
• Modularization keywords
• Control keywords
• Calling keywords
• Operational keywords
The following list is an overview of the main features of data types and
objects:
Data types
Data types describe the technical properties of data objects.
There is no memory associated with data types.
Data objects
Each data object has a specific data type assigned to it.
Each data object occupies some space in memory.
ABAP BASICs learn the basics of ABAP-1.ppt
Elementary Data Types - User-Defined
User-defined elementary data types are based entirely on predefined
elementary data types. To define your own elementary data types, you
use the TYPES statement
Ex.
TYPES: NUMBER TYPE I.
DATA: NO_FLIGHTS TYPE NUMBER.
Structured Data Types
* Predefined ( Ex. Tables)
* User defined
· Field strings
· Internal tables
Field strings
A field string is a collection of other data types.
TYPES: begin of string,
name(10) type c,
age(3) type n,
end of string.
Internal tables
An internal table consists of several lines of the same type. Unlike field
strings, which extend only 'horizontally', internal tables also extend
'vertically'.
DATA OBJECTS
In ABAP/4, you can work with several kinds of data objects, such as:
· Internal data objects
· External data objects
· System-defined data objects
· Special data objects
Internal data objects
Internal data objects are created for use in one particular program. They
have no validity outside that program. Internal data objects include:
Literals
- Text literals (using type c)
Ex. Data name(10) type c value 'Maars soft'.
- Numeric literals (using type n)
Ex Data Pincode(10) type n value '600024'.
Variables
DATA: S1 TYPE I.
SUM = S1 + 10..
Constants
CONSTANTS PI TYPE P DECIMALS 10 VALUE '3.1415926536'.
External data objects
External data objects exist independently of programs.
ABAP/4 stores external data objects in tables defined in the ABAP/4
Dictionary. To access this data from within a program, you declare the
tables in the program with the TABLES statement .
System-defined data objects
Besides user-defined data objects, some data objects are defined
automatically by the system.
SY-UNAME : logon name of the user
SY-DATUM : current date
SY-UZEIT : current time
Special data objects
ABAP/4 also includes some data objects with special features, namely:
- Parameters
Parameters are variables which are linked to a selection screen. They can
accept values after a program is started.
- Selection criteria
Selection criteria are special internal tables used to specify value ranges.
They are also linked to a selection screen.
Basic Form of the DATA Statement
Syntax
DATA <f>[(<length>)] <type> [<value>] [<decimals>].
In its basic form, the keyword DATA has the following parameters:
<f> Naming a Variable
<length> <type> Specifying the Data Type and the Length of the
Variable
<value> Specifying a Start Value
<decimals> Specifying the Number of Digits after the Decimal
Point
Naming a Variable
The variable name <f> may be up to 30 characters long. You can use any
alphanumeric characters except those listed below.
· Do not use the following characters:
- plus sign +
- period .
- comma ,
- colon :
- parentheses ( )
· Do not create a name consisting entirely of numeric
characters.
Outputting Data to the Screen
Syntax
WRITE <f>.
Positioning WRITE Output on the Screen
Syntax
WRITE AT [/][<pos>][(<len>)] <f>.
Formatting Options
Syntax
WRITE .... <f> <option>.
Formatting options for all data types
LEFT-JUSTIFIED Output is left-justified.
CENTERED Output is centered.
RIGHT-JUSTIFIED Output is right-justified.
UNDER <g> Output starts directly under the field <g>.
NO-GAP The blank after the field <f> is omitted.
Formatting options for numeric fields
NO-SIGN The leading sign is not output.
DECIMALS <d> <d> defines the number of digits after the
decimal point.
EXPONENT <e> In type F fields, the exponent is defined in
<e>.
Outputting Symbols and Icons on the Screen
You can output symbols or R/3 icons on the screen by using the
following syntax:
Syntax
WRITE <symbol-name> AS SYMBOL.
WRITE <icon-name> AS ICON.
Ex.
INCLUDE <LIST>.
WRITE: / 'Phone Symbol:', SYM_PHONE AS SYMBOL.
SKIP.
WRITE: / 'Alarm Icon: ', ICON_ALARM AS ICON.
ABAP BASICs learn the basics of ABAP-1.ppt
TEXT ELEMENTS
The ABAP/4 programming environment allows you to create and
maintain programs in several languages. You can store all texts the
program outputs to the screen as text elements in text pools.
Text elements comprise
· the title of the program.
· list headings and column headings for page headers of output
lists
· selection texts which appear on a selection screen
· text symbols which can be used in ABAP/4 statements instead of
literals.
Assigning values
In ABAP/4, you can assign values to data objects in both declarative and
operational statements.
To assign values to data objects in operational statements, you can use:
· the MOVE statement, which corresponds to the assignment
operator (=)
· the WRITE TO statement
The syntax for the MOVE statement is as follows:
MOVE <f1> TO <f2>.
The syntax for the assignment operator (=) is as follows:
<f2> = <f1>.
Example
DATA: NUMBER1 TYPE P DECIMALS 1 value '5.5'.
NUMBER2 TYPE P DECIMALS 1.
MOVE NUMBER1 TO NUMBER2.
(OR)
NUMBER2 = NUMBER1.
WRITE : 'NUMBER2 =' , NUMBER2.
The output will be: NUMBER2 = 5.5.
Basic Arithmetic Operations
ABAP/4 supports the four basic arithmetic operations, as well as power
calculation. You can specify the following arithmetic operators in a
mathematical expression:
+ Addition
- Subtraction
* Multiplication
/ Division
DIV Integer division
MOD Remainder of integer division
** Exponentiation
Controlling the Flow of an ABAP/4 Program
The flow of an ABAP/4 program can be controlled internally and
externally.
· The internal control is steered by standard keywords.
These keywords are
· for branching (IF, CASE)
· for looping (DO, WHILE)
· The external control is steered by events. Events are generated
either from other ABAP/4 programs (system programs or user programs)
or from interactive user input (like, for example, using the mouse to click
on the screen).
ABAP BASICs learn the basics of ABAP-1.ppt
Conditional Branching using IF
The IF statement allows you to divert the program flow to a particular
statement block, depending on a condition. This statement block consists
of all the commands which occur between an IF statement and the next
ELSEIF, ELSE, or ENDIF statement.
Syntax
IF <condition1>.
<statement block>
ELSEIF <condition2>.
<statement block>
ELSEIF <condition3>.
<statement block>
.....
ELSE.
<statement block>
ENDIF.
Conditional Branching with CASE
To execute different statement blocks depending on the contents of
particular data fields, you use the CASE statement as follows:
Syntax
CASE <f>.
WHEN <f1>.
<statement block>
WHEN <f2>.
<statement block>
WHEN <f3>.
<statement block>
WHEN ...
......
WHEN OTHERS.
<statement block>
Unconditional Looping using DO
If you want to process a statement block more than once, you can
program a loop with the DO statement as follows:
Syntax
DO [<n> TIMES].
<statement block>
ENDDO.
Conditional Loops using WHILE
If you want to process a statement block more than once as long as a
condition is true, you can program a loop with the WHILE statement as
follows:
Syntax
WHILE <condition> .
<statement block>
ENDWHILE.
To terminate the processing of a loop, use one of the following keywords.
Keyword Purpose
CONTINUE Terminating a Loop Pass Unconditionally
CHECK Terminating a Loop Pass Conditionally
EXIT Terminating a Loop Entirely
Example for terminating a Loop Pass Unconditionally
To terminate a loop pass immediately without any condition, use the
CONTINUE statement as follows:
DO 4 TIMES.
IF SY-INDEX = 2.
CONTINUE.
ENDIF.
WRITE SY-INDEX.
ENDDO.
This produces the following output:
1 3 4
Here, the system terminates the second loop pass without processing the
WRITE statement.
Example for terminating a Loop Pass Conditionally
To terminate a loop pass conditionally, use the CHECK statement as
follows:
Syntax
CHECK <condition>.
DO 4 TIMES.
CHECK SY-INDEX BETWEEN 2 and 3.
WRITE SY-INDEX.
ENDDO.
This produces the following output:
2 3
Here, the system terminates the first and the fourth loop pass without
processing the WRITE statement because SY-INDEX does not fall
between 2 and 3.
Example for terminating a Loop Entirely
To terminate a loop entirely without any condition, use the EXIT
statement as follows:
Syntax
EXIT.
DO 4 TIMES.
IF SY-INDEX = 3.
EXIT.
ENDIF.
WRITE SY-INDEX.
ENDDO.
This produces the following output:
1 2
Here, the system terminates the entire loop processing in the third loop
pass without processing the WRITE statement or the fourth loop pass.
ABAP KEYWORDS
· Declarative keywords
These keywords define data types or declare the data
objects which the program can access. Examples of declarative
keywords are: TYPES, DATA, TABLES
· Control keywords
These keywords control the flow of an ABAP/4 program
according to certain conditions. Examples of control keywords are:
IF, WHILE, CASE
· Calling keywords
These keywords call processing blocks (defined by
modularization keywords) in the same or other ABAP/4 programs or
branch completely to other ABAP/4 programs. Examples of calling
keywords are: PERFORM, CALL, SUBMIT, LEAVE TO
Modularization keywords
These keywords define processing blocks in an ABAP/4 program.
Processing blocks are groups of statements which are processed during
the execution of an ABAP/4 program as soon as they are called from
another point.
Modularization keywords comprise:
* Event keywords
Example AT SELECTION SCREEN, START-OF-SELECTION
* Defining keywords
Example FORM, ENDFORM, FUNCTION, ENDFUNCTION.
Operational keywords
These keywords process the data (defined by declarative keywords)
when certain processing blocks (triggered by events or called by calling
keywords) are processed and certain conditions (defined by control
keywords) occur.
Examples of operational keywords are: WRITE, MOVE, ADD
There are three hierarchical levels of data types and objects:
* Program-independent data, defined in the ABAP/4 Dictionary
* Internal data used globally in one program
* Data used locally in a procedure (subroutine, function
module)
Data types in ABAP/4 are classified by structure and definition.
Data types are either:
· predefined or user-defined
· elementary (non structured) or structured
ABAP BASICs learn the basics of ABAP-1.ppt
THE END
Ad

More Related Content

Similar to ABAP BASICs learn the basics of ABAP-1.ppt (20)

Over View of C language ( by dennid richi)
Over View of C language ( by dennid richi)Over View of C language ( by dennid richi)
Over View of C language ( by dennid richi)
rishithreddyeppa
 
PART-1 Over View of C language ( engineering)
PART-1 Over View of C language ( engineering)PART-1 Over View of C language ( engineering)
PART-1 Over View of C language ( engineering)
rishithreddyeppa
 
Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01
tabish
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02
tabish
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02
wingsrai
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overview
sapdocs. info
 
chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01
tabish
 
Chapter 1 Abap Programming Overview
Chapter 1 Abap Programming OverviewChapter 1 Abap Programming Overview
Chapter 1 Abap Programming Overview
Ashish Kumar
 
Abap
AbapAbap
Abap
ramraj100
 
C programming
C programmingC programming
C programming
PralhadKhanal1
 
C fundamentals
C fundamentalsC fundamentals
C fundamentals
shaheed benazeer bhutto university (shaheed benazeerabad)
 
Sap abap training Overview
Sap abap training OverviewSap abap training Overview
Sap abap training Overview
raviadm100
 
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
IBMSystemzEvents
 
Looking for best Sap abap training institute in Chennai
Looking for best Sap abap training institute in ChennaiLooking for best Sap abap training institute in Chennai
Looking for best Sap abap training institute in Chennai
Raja AMEKS Infotech
 
ABAP
ABAPABAP
ABAP
Madhu Reddy
 
Programming in C
Programming in CProgramming in C
Programming in C
DrPrabakaranPerumal
 
Skillwise - Cobol Programming Basics
Skillwise - Cobol Programming BasicsSkillwise - Cobol Programming Basics
Skillwise - Cobol Programming Basics
Skillwise Group
 
Abap
AbapAbap
Abap
Sourav Ghose
 
Abap Questions
Abap QuestionsAbap Questions
Abap Questions
Kaustav Pyne
 
Sap abap
Sap abapSap abap
Sap abap
nrj10
 
Over View of C language ( by dennid richi)
Over View of C language ( by dennid richi)Over View of C language ( by dennid richi)
Over View of C language ( by dennid richi)
rishithreddyeppa
 
PART-1 Over View of C language ( engineering)
PART-1 Over View of C language ( engineering)PART-1 Over View of C language ( engineering)
PART-1 Over View of C language ( engineering)
rishithreddyeppa
 
Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01
tabish
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02
tabish
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02
wingsrai
 
ABAP Programming Overview
ABAP Programming OverviewABAP Programming Overview
ABAP Programming Overview
sapdocs. info
 
chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01chapter-1abapprogrammingoverview-091205081953-phpapp01
chapter-1abapprogrammingoverview-091205081953-phpapp01
tabish
 
Chapter 1 Abap Programming Overview
Chapter 1 Abap Programming OverviewChapter 1 Abap Programming Overview
Chapter 1 Abap Programming Overview
Ashish Kumar
 
Sap abap training Overview
Sap abap training OverviewSap abap training Overview
Sap abap training Overview
raviadm100
 
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...Track 2 session 4   db2 for z os optimizer- what’s new in db2 11 and exploiti...
Track 2 session 4 db2 for z os optimizer- what’s new in db2 11 and exploiti...
IBMSystemzEvents
 
Looking for best Sap abap training institute in Chennai
Looking for best Sap abap training institute in ChennaiLooking for best Sap abap training institute in Chennai
Looking for best Sap abap training institute in Chennai
Raja AMEKS Infotech
 
Skillwise - Cobol Programming Basics
Skillwise - Cobol Programming BasicsSkillwise - Cobol Programming Basics
Skillwise - Cobol Programming Basics
Skillwise Group
 
Sap abap
Sap abapSap abap
Sap abap
nrj10
 

Recently uploaded (20)

Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
2025 Apply BTech CEC .docx
2025 Apply BTech CEC                 .docx2025 Apply BTech CEC                 .docx
2025 Apply BTech CEC .docx
tusharmanagementquot
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
MODULE 03 - CLOUD COMPUTING- [BIS 613D] 2022 scheme.pptx
MODULE 03 - CLOUD COMPUTING-  [BIS 613D] 2022 scheme.pptxMODULE 03 - CLOUD COMPUTING-  [BIS 613D] 2022 scheme.pptx
MODULE 03 - CLOUD COMPUTING- [BIS 613D] 2022 scheme.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Structural Response of Reinforced Self-Compacting Concrete Deep Beam Using Fi...
Journal of Soft Computing in Civil Engineering
 
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
IJCNCJournal
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Novel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth ControlNovel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth Control
Chris Harding
 
New Microsoft PowerPoint Presentation.pdf
New Microsoft PowerPoint Presentation.pdfNew Microsoft PowerPoint Presentation.pdf
New Microsoft PowerPoint Presentation.pdf
mohamedezzat18803
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
Taqyea
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
How to use nRF24L01 module with Arduino
How to use nRF24L01 module with ArduinoHow to use nRF24L01 module with Arduino
How to use nRF24L01 module with Arduino
CircuitDigest
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
ISO 9001 quality management systemPPT.pptx
ISO 9001 quality management systemPPT.pptxISO 9001 quality management systemPPT.pptx
ISO 9001 quality management systemPPT.pptx
mesfin608
 
Metal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistryMetal alkyne complexes.pptx in chemistry
Metal alkyne complexes.pptx in chemistry
mee23nu
 
Introduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptxIntroduction to Zoomlion Earthmoving.pptx
Introduction to Zoomlion Earthmoving.pptx
AS1920
 
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdfRICS Membership-(The Royal Institution of Chartered Surveyors).pdf
RICS Membership-(The Royal Institution of Chartered Surveyors).pdf
MohamedAbdelkader115
 
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
Efficient Algorithms for Isogeny Computation on Hyperelliptic Curves: Their A...
IJCNCJournal
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptxExplainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
Explainable-Artificial-Intelligence-XAI-A-Deep-Dive (1).pptx
MahaveerVPandit
 
Novel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth ControlNovel Plug Flow Reactor with Recycle For Growth Control
Novel Plug Flow Reactor with Recycle For Growth Control
Chris Harding
 
New Microsoft PowerPoint Presentation.pdf
New Microsoft PowerPoint Presentation.pdfNew Microsoft PowerPoint Presentation.pdf
New Microsoft PowerPoint Presentation.pdf
mohamedezzat18803
 
Data Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptxData Structures_Searching and Sorting.pptx
Data Structures_Searching and Sorting.pptx
RushaliDeshmukh2
 
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
最新版加拿大魁北克大学蒙特利尔分校毕业证(UQAM毕业证书)原版定制
Taqyea
 
some basics electrical and electronics knowledge
some basics electrical and electronics knowledgesome basics electrical and electronics knowledge
some basics electrical and electronics knowledge
nguyentrungdo88
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
How to use nRF24L01 module with Arduino
How to use nRF24L01 module with ArduinoHow to use nRF24L01 module with Arduino
How to use nRF24L01 module with Arduino
CircuitDigest
 
Smart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineeringSmart Storage Solutions.pptx for production engineering
Smart Storage Solutions.pptx for production engineering
rushikeshnavghare94
 
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E..."Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
"Boiler Feed Pump (BFP): Working, Applications, Advantages, and Limitations E...
Infopitaara
 
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITYADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ADVXAI IN MALWARE ANALYSIS FRAMEWORK: BALANCING EXPLAINABILITY WITH SECURITY
ijscai
 
ISO 9001 quality management systemPPT.pptx
ISO 9001 quality management systemPPT.pptxISO 9001 quality management systemPPT.pptx
ISO 9001 quality management systemPPT.pptx
mesfin608
 
Ad

ABAP BASICs learn the basics of ABAP-1.ppt

  • 2. Introduction to ABAP/4 ABAP - Advanced Business Application Programming ABAP/4 is the only tool used by SAP to develop all of its applications. SAP customers use ABAP/4 for their own developments. Some of the features of ABAP/4: • ABAP/4 is multi-lingual. • ABAP/4 contains a subset of SQL called open SQL.With open SQL you can read and access data base tables regardless of the database system you are using. • ABAP/4 contains a special type of subroutine called function module. • ABAP/4 allows you to define and process internal tables that exist only for the execution period of the program.
  • 3. Main types of ABAP/4 programs: 1) Report programs 2) Dialog programs Report programs: A report program generates a list from database tables in a user defined format. It does not alter the data in the database but only analyses(reads) them.The results which can be displayed on the screen or sent to a printer. A report program can either be an online or background program. Dialog programs Dialog programs read and change database tables. It is also called as Module pool programs.It accepts user information,processes the information and updates the database. For this reason module pool programs cannot be executed in background.
  • 4. ABAP/4 Workbench tools. The ABAP/4 development workbench contains tools you need to create and maintain ABAP/4 programs. The tools are: 1. Object browser 2. ABAP/4 Dictionary 3. ABAP/4 Editor 4. Function library 5. Screen painter 6. Menu painter
  • 5. ABAP/4 Statements Any ABAP/4 statement begins with a keyword and ends with a period(.). Keywords A keyword is the first word of a statement. It determines the meaning of the entire statement. There are five different types of keywords: • Declarative keywords • Modularization keywords • Control keywords • Calling keywords • Operational keywords
  • 6. The following list is an overview of the main features of data types and objects: Data types Data types describe the technical properties of data objects. There is no memory associated with data types. Data objects Each data object has a specific data type assigned to it. Each data object occupies some space in memory.
  • 8. Elementary Data Types - User-Defined User-defined elementary data types are based entirely on predefined elementary data types. To define your own elementary data types, you use the TYPES statement Ex. TYPES: NUMBER TYPE I. DATA: NO_FLIGHTS TYPE NUMBER.
  • 9. Structured Data Types * Predefined ( Ex. Tables) * User defined · Field strings · Internal tables Field strings A field string is a collection of other data types. TYPES: begin of string, name(10) type c, age(3) type n, end of string. Internal tables An internal table consists of several lines of the same type. Unlike field strings, which extend only 'horizontally', internal tables also extend 'vertically'.
  • 10. DATA OBJECTS In ABAP/4, you can work with several kinds of data objects, such as: · Internal data objects · External data objects · System-defined data objects · Special data objects
  • 11. Internal data objects Internal data objects are created for use in one particular program. They have no validity outside that program. Internal data objects include: Literals - Text literals (using type c) Ex. Data name(10) type c value 'Maars soft'. - Numeric literals (using type n) Ex Data Pincode(10) type n value '600024'. Variables DATA: S1 TYPE I. SUM = S1 + 10.. Constants CONSTANTS PI TYPE P DECIMALS 10 VALUE '3.1415926536'.
  • 12. External data objects External data objects exist independently of programs. ABAP/4 stores external data objects in tables defined in the ABAP/4 Dictionary. To access this data from within a program, you declare the tables in the program with the TABLES statement . System-defined data objects Besides user-defined data objects, some data objects are defined automatically by the system. SY-UNAME : logon name of the user SY-DATUM : current date SY-UZEIT : current time
  • 13. Special data objects ABAP/4 also includes some data objects with special features, namely: - Parameters Parameters are variables which are linked to a selection screen. They can accept values after a program is started. - Selection criteria Selection criteria are special internal tables used to specify value ranges. They are also linked to a selection screen.
  • 14. Basic Form of the DATA Statement Syntax DATA <f>[(<length>)] <type> [<value>] [<decimals>]. In its basic form, the keyword DATA has the following parameters: <f> Naming a Variable <length> <type> Specifying the Data Type and the Length of the Variable <value> Specifying a Start Value <decimals> Specifying the Number of Digits after the Decimal Point
  • 15. Naming a Variable The variable name <f> may be up to 30 characters long. You can use any alphanumeric characters except those listed below. · Do not use the following characters: - plus sign + - period . - comma , - colon : - parentheses ( ) · Do not create a name consisting entirely of numeric characters.
  • 16. Outputting Data to the Screen Syntax WRITE <f>. Positioning WRITE Output on the Screen Syntax WRITE AT [/][<pos>][(<len>)] <f>. Formatting Options Syntax WRITE .... <f> <option>.
  • 17. Formatting options for all data types LEFT-JUSTIFIED Output is left-justified. CENTERED Output is centered. RIGHT-JUSTIFIED Output is right-justified. UNDER <g> Output starts directly under the field <g>. NO-GAP The blank after the field <f> is omitted. Formatting options for numeric fields NO-SIGN The leading sign is not output. DECIMALS <d> <d> defines the number of digits after the decimal point. EXPONENT <e> In type F fields, the exponent is defined in <e>.
  • 18. Outputting Symbols and Icons on the Screen You can output symbols or R/3 icons on the screen by using the following syntax: Syntax WRITE <symbol-name> AS SYMBOL. WRITE <icon-name> AS ICON. Ex. INCLUDE <LIST>. WRITE: / 'Phone Symbol:', SYM_PHONE AS SYMBOL. SKIP. WRITE: / 'Alarm Icon: ', ICON_ALARM AS ICON.
  • 20. TEXT ELEMENTS The ABAP/4 programming environment allows you to create and maintain programs in several languages. You can store all texts the program outputs to the screen as text elements in text pools. Text elements comprise · the title of the program. · list headings and column headings for page headers of output lists · selection texts which appear on a selection screen · text symbols which can be used in ABAP/4 statements instead of literals.
  • 21. Assigning values In ABAP/4, you can assign values to data objects in both declarative and operational statements. To assign values to data objects in operational statements, you can use: · the MOVE statement, which corresponds to the assignment operator (=) · the WRITE TO statement
  • 22. The syntax for the MOVE statement is as follows: MOVE <f1> TO <f2>. The syntax for the assignment operator (=) is as follows: <f2> = <f1>. Example DATA: NUMBER1 TYPE P DECIMALS 1 value '5.5'. NUMBER2 TYPE P DECIMALS 1. MOVE NUMBER1 TO NUMBER2. (OR) NUMBER2 = NUMBER1. WRITE : 'NUMBER2 =' , NUMBER2. The output will be: NUMBER2 = 5.5.
  • 23. Basic Arithmetic Operations ABAP/4 supports the four basic arithmetic operations, as well as power calculation. You can specify the following arithmetic operators in a mathematical expression: + Addition - Subtraction * Multiplication / Division DIV Integer division MOD Remainder of integer division ** Exponentiation
  • 24. Controlling the Flow of an ABAP/4 Program The flow of an ABAP/4 program can be controlled internally and externally. · The internal control is steered by standard keywords. These keywords are · for branching (IF, CASE) · for looping (DO, WHILE) · The external control is steered by events. Events are generated either from other ABAP/4 programs (system programs or user programs) or from interactive user input (like, for example, using the mouse to click on the screen).
  • 26. Conditional Branching using IF The IF statement allows you to divert the program flow to a particular statement block, depending on a condition. This statement block consists of all the commands which occur between an IF statement and the next ELSEIF, ELSE, or ENDIF statement. Syntax IF <condition1>. <statement block> ELSEIF <condition2>. <statement block> ELSEIF <condition3>. <statement block> ..... ELSE. <statement block> ENDIF.
  • 27. Conditional Branching with CASE To execute different statement blocks depending on the contents of particular data fields, you use the CASE statement as follows: Syntax CASE <f>. WHEN <f1>. <statement block> WHEN <f2>. <statement block> WHEN <f3>. <statement block> WHEN ... ...... WHEN OTHERS. <statement block>
  • 28. Unconditional Looping using DO If you want to process a statement block more than once, you can program a loop with the DO statement as follows: Syntax DO [<n> TIMES]. <statement block> ENDDO.
  • 29. Conditional Loops using WHILE If you want to process a statement block more than once as long as a condition is true, you can program a loop with the WHILE statement as follows: Syntax WHILE <condition> . <statement block> ENDWHILE.
  • 30. To terminate the processing of a loop, use one of the following keywords. Keyword Purpose CONTINUE Terminating a Loop Pass Unconditionally CHECK Terminating a Loop Pass Conditionally EXIT Terminating a Loop Entirely
  • 31. Example for terminating a Loop Pass Unconditionally To terminate a loop pass immediately without any condition, use the CONTINUE statement as follows: DO 4 TIMES. IF SY-INDEX = 2. CONTINUE. ENDIF. WRITE SY-INDEX. ENDDO. This produces the following output: 1 3 4 Here, the system terminates the second loop pass without processing the WRITE statement.
  • 32. Example for terminating a Loop Pass Conditionally To terminate a loop pass conditionally, use the CHECK statement as follows: Syntax CHECK <condition>. DO 4 TIMES. CHECK SY-INDEX BETWEEN 2 and 3. WRITE SY-INDEX. ENDDO. This produces the following output: 2 3 Here, the system terminates the first and the fourth loop pass without processing the WRITE statement because SY-INDEX does not fall between 2 and 3.
  • 33. Example for terminating a Loop Entirely To terminate a loop entirely without any condition, use the EXIT statement as follows: Syntax EXIT. DO 4 TIMES. IF SY-INDEX = 3. EXIT. ENDIF. WRITE SY-INDEX. ENDDO. This produces the following output: 1 2 Here, the system terminates the entire loop processing in the third loop pass without processing the WRITE statement or the fourth loop pass.
  • 35. · Declarative keywords These keywords define data types or declare the data objects which the program can access. Examples of declarative keywords are: TYPES, DATA, TABLES · Control keywords These keywords control the flow of an ABAP/4 program according to certain conditions. Examples of control keywords are: IF, WHILE, CASE · Calling keywords These keywords call processing blocks (defined by modularization keywords) in the same or other ABAP/4 programs or branch completely to other ABAP/4 programs. Examples of calling keywords are: PERFORM, CALL, SUBMIT, LEAVE TO
  • 36. Modularization keywords These keywords define processing blocks in an ABAP/4 program. Processing blocks are groups of statements which are processed during the execution of an ABAP/4 program as soon as they are called from another point. Modularization keywords comprise: * Event keywords Example AT SELECTION SCREEN, START-OF-SELECTION * Defining keywords Example FORM, ENDFORM, FUNCTION, ENDFUNCTION. Operational keywords These keywords process the data (defined by declarative keywords) when certain processing blocks (triggered by events or called by calling keywords) are processed and certain conditions (defined by control keywords) occur. Examples of operational keywords are: WRITE, MOVE, ADD
  • 37. There are three hierarchical levels of data types and objects: * Program-independent data, defined in the ABAP/4 Dictionary * Internal data used globally in one program * Data used locally in a procedure (subroutine, function module) Data types in ABAP/4 are classified by structure and definition. Data types are either: · predefined or user-defined · elementary (non structured) or structured