SlideShare a Scribd company logo
ABAP Programming   Overview
ABAP Course Outline Chapter 1 : Introduction to ABAP Chapter 2 : List Processing in ABAP Chapter 3 : Open SQL & Internal Table Chapter 4 : Event-driven Programming &  Selection Screen Chapter 5 : Modularization & Catch Statement Chapter 6 : Message, Debugging, File Transfer and    Type Group
ABAP Chapter 1 Introduction to SAP Architecture ABAP Overview Data Object in ABAP
SAP System : 3 Tier Client/Server DB Server SAP Application Server SAP GUI Presentation Server SAP GUI SAP GUI
SAP SYSTEM (3 Tier Architecture) Presentation Layer (Windows based) Application Layer (Windows Server/UNIX) Database Server Database  Layer (Windows Server/UNIX) M SAP Instance Oracle Informix DB2 MS SQL Server MaxDB G Dispatcher Request Queue D D B V S E SAP Buffer (Shared Mem) SAP GUI SAP GUI
Dialog Processing
SAP System : Dialog Processing Database Server Application Server Dispatcher Request Queue D D D D … SAP Buffer Program Table … 1 3 4 5 6 8 9 10 Report zpsm1. Tables customers. Select single * from customers where id = 1. Write: / customers-name. Execute ABAP statement Check Program in Program Buffer 7 Load&Gen Program SQL Request Send List Generate Screen(List) Send Request Request List 2 Search for free WP Store request to queue Send request to WP SAP GUI
Dialog Work Process Architecture TaskHandler DYNPRO Processor ABAP Processor Local Memory Memory Space DB Interface List buffer Database Server Dialog Work Process Result Set Memory
ABAP Programming Overview
ABAP Overview DATA ... WRITE ... IF ... MOVE … WHILE... *Comment... SEARCH ... SELECT ... LOOP AT ... DO  ...
ABAP A dvanced B usiness A pplication P rogramming
ABAP Feature Declaring data with various types and structure Operational elements for data manipulation Control elements for controlling the program flow Event elements for reacting to external events
ABAP  Operating/Database system-independent programming  ABAP contains a subset of SQL called  Open SQL  for comfortable database access for  various database
ABAP  Programming  ABAP Report  Dialog Programming(Transaction)
ABAP Program : Report Report Program : attribute type 1 (executable) Reading Database Reading data
Types of ABAP Report 1. Report Listing 2. Drill-down Report 3. Control-break Report 4. ALV Report 1 3 4
ABAP Program : Dialog Program Dialog Program : attribute type M (Module Pool) Reading Database Reading and  changing data Writing
Dialog Program : Transaction
ABAP Programming
How to create ABAP program  Transaction Code : SE38
Transaction : SE38
Program Attribute
ABAP Editor
The Structure of the Language Each statement must end with a period DATA  tmp  TYPE  I. WRITE ‘Hello World’.  WRITE  ‘OK’.
Literal DATA  tmp  TYPE  I. WRITE ‘Hello World’. WRITE ’10’.   MOVE  9 TO tmp.   Text Literal Numeric Literal Text Literal
Chained Statements Successive statements that have the same string segment can be combined to form a single chained statement To do so, you specify the identical starting segment once and conclude it with a colon (:), the remaining segments are then listed, separated by commas (,) and concluded with a period (.) At runtime, a chained statement is treated like an equivalent sequence of individual ABAP statements
Chained Statements WRITE ‘Hello World’.  WRITE  ‘OK’.  = WRITE: ‘Hello World’, ‘OK’. DATA  tmp1  TYPE  I. DATA  tmp2  TYPE  C. = DATA:  tmp1  TYPE  I, tmp2  TYPE  C.
Chained Statement MOVE  sy-subrc  TO  tmp1. MOVE  sy-subrc  TO  tmp2. MOVE  sy-subrc  TO  tmp3. = MOVE  sy-subrc  TO:  tmp1, tmp2, tmp3.
Chained Statement PERFORM  cal_1  USING  a1  a2. PERFORM  cal_1  USING  a3  a4. = PERFORM  cal_1  USING:  a1  a2, a3  a4.
Comments * This is  full line  comment WRITE ‘Hello World’.  “ Write data  (partial line comment)   WRITE ‘Test’.
ABAP Command : Case Sensitivity ABAP command is not case sensitive WRITE ‘Hello World’.  WriTe  ‘Hello World’. wRiTE  ‘Hello World’.
Data Objects in ABAP
Data Objects in ABAP Memory Space Structure Table Structure Internal Table Variable Constants <Field-symbols>
Variable
Variable Variables can be declared at any point in a program  Variables can be up to 30 characters in length REPORT ZTEST. DATA  firstname  TYPE STRING. firstname  = ‘John’.
Predefined ABAP Data Types Type Description Initial Value C D F I N P T X String xstring Character Date Floating Point Integer Numeric Text Packed Decimal Time Hexadecimal Variable-length Variable-length Hexadecimal Space ‘ 00000000’ 0.0 0 ‘ 0’ 0 ‘ 000000’ ’ 00’ Space Blank string Length 1 – 65535  8 characters 8 bytes 4 bytes 1 – 65535  1 – 16 bytes 6 characters 1 – 65535  Variable Variable
Defining Variable with DATA Statement * Syntax DATA  var[( length )]  [Type  type ]  [Decimals   number ]. DATA  var  LIKE  Table-Field  [VALUE   initial value ].
Defining Variable with DATA Statement * Data Declaration DATA: tmp(10)  TYPE  C, tmp1  TYPE  I, tmp2(8)  TYPE P  DECIMALS  2  VALUE ‘1.50’. DATA: tmp3(5)  TYPE  N, tmp4.
Defining Variable with DATA Statement * Data Declaration DATA  customerno  LIKE  customers-id. DATA  matnr   LIKE  mara-matnr . DATA customerno TYPE customers-id. DATA matnr TYPE mara-matnr.
ABAP Predefined Data Types ABAP Predefined Data Types Complete Types (I,F,D,T,STRING and XSTRING) Incomplete Types (C,N,P and X)
Variable Data Type  C , N  and  X  length between  1 – 65535  (Default 1)  Data Type  P  length between  1 – 16  (Default 8) and decimals length between 0 – 31 Data Type  I  value between – 2 31  to 2 31  – 1  or –2,147,483,648 to 2,147,483,647 DATA tmp(10) TYPE C. DATA tmp(5) TYPE P DECIMALS 2. DATA tmp TYPE I. tmp = 1000000.
Data type N data tmp(5) type N. tmp = ‘Xca9yy23K6’.
ABAP Error System Runtime Error User Runtime Error Time Exceed (10 Minutes) Cannot Allocate Space ABAP Error Syntax  Error Runtime  Error
User Runtime Error DATA result TYPE i. result = 10 / 0.
System Runtime Error : Space Allocation
System Runtime Error : Time Exceed
Non-elementary Type * Data Declaration TYPES  tname(30)  TYPE  c. DATA:  customer_name  TYPE  tname, firstname TYPE tname.
Value Assignment * Value  assignment DATA:  name1(30), first_num  TYPE  I , next_num  TYPE  I. MOVE  ‘XXXX’  TO  name1. MOVE  5  TO  first_num. COMPUTE  next_num  =  first_num  +  5. name1  =  ‘SAP’. ADD  1  TO  next_num.
Value Assignment * Value  assignment DATA:  tmp1  TYPE  i , tmp2  TYPE  i . tmp1 = tmp2 = 10.
ABAP Practice  ต้องการให้สร้างตัวแปรชื่อ  firstname  และ  lastname  โดยให้ค่าชื่อของคุณกับ ตัวแปร  firstname  และนามสกุลของคุณให้กับตัวแปร  lastname  พร้อมทั้งแสดง ค่าข้อมูล  firstname  กับ  lastname  ออกมาที่หน้าจอ
Structure
Structure * Syntax DATA  BEGIN  OF  < structure name >. DATA   field1.  DATA   field2. … … DATA  END  OF  < structure name >.
Structure * Syntax DATA  BEGIN  OF  wa. DATA   id  LIKE  customers-id .  DATA   name LIKE customers-name . DATA   city LIKE customers-city .  DATA  END  OF  wa. MOVE  9  TO  wa-id. WRITE wa-id. id city wa 00000000 name
Defining Structure (Include Structure) * Include Structure DATA  BEGIN  OF  wa. INCLUDE STRUCTURE  customers. DATA  tel(7). DATA  END  OF  wa.
Defining Structure * LIKE option DATA  wa LIKE customers. wa-id = 1. wa-name = ‘John’. WRITE:  wa-id, wa-name.
ABAP Practice  ต้องการให้สร้าง  Structure  ชื่อ  myname  โดยมีฟิลด์  firstname  และ  lastname  โดยให้ค่าชื่อของคุณกับฟิลด์  firstname  และนามสกุลของคุณให้กับฟิลด์  lastname  พร้อมทั้งแสดงค่าข้อมูลของ  Structure  ที่ชื่อ  myname  ทั้งฟิลด์  firstname  และ  lastname  ออกมาที่หน้าจอ
Constants
Constants * Constant variable CONSTANTS  max_no  TYPE  I  VALUE  999.   DATA  counter  TYPE  I  VALUE  max_no. WRITE:  max_no, counter.
Constants Using Example * Constant variable CONSTANTS  ctext(11)  TYPE  C  VALUE  ‘Hello World’.   WRITE  ctext. WRITE  ctext. WRITE  ctext. WRITE  ctext. WRITE  ctext.
System Fields The system fields (structure syst) are filled by the runtime environment. You can use them to query the system status in an ABAP program You should access them only for reading sy-datum  = Current date of application server sy-uzeit  = Current time of application server sy-datlo  = Current date of SAP GUI sy-timlo  = Current time of SAP GUI sy-mandt  = Current client logon sy-subrc   = Return value of ABAP statement  syst-datum
ABAP System Fields : Structure SYST (SE11)
DATE * Fixed Length  8 * Include Representation  ‘ YYYYMMDD ’ DATA  today  TYPE  D. today  =  sy-datum. WRITE  today. today  =  ‘19991231’. WRITE  today.
TIME * Fixed Length  6 * Format  ‘HHMMSS’ DATA  times  TYPE  T. times  =  sy-uzeit. WRITE  times. HHMMSS
MOVE Statement DATA   wa LIKE customers . DATA  vender  LIKE  customers.   wa -id  =  ‘1234’. wa -name  =  ‘Test#1’. MOVE  wa   TO  vender. WRITE:  wa -id, vender-name. “ vender = wa.
MOVE-CORRESPONDING Statement DATA: begin of wa1, f1,f2,f4, end of wa1 . DATA: begin of wa2, f2,f1,f3, end of wa2 . … MOVE -CORRESPONDING   wa1   TO  wa2 . WRITE:  wa1-f1 , wa2-f1  .
Field-symbols
Field-symbols Data:  name (4)  Value  ‘Test’, num  Type  I  Value  10, today  Type  D  Value ‘19980429’. Field-symbols  <temp>. Assign  name   To  <temp>. Write  <temp>. Assign  num  To  <temp>. Write  <temp>. Assign  today  To  <temp>. Write  <temp>.
Field-symbols : UNASSIGN d ata:  name (4)  Value  ‘Test’, f ield-symbols  <temp>. a ssign  name   To  <temp>. w rite  <temp>. una ssign  <temp>.
CLEAR Statement Example: DATA tmp type i value 9. tmp = 10. CLEAR tmp.   “ Clear statement sets a field to an initial value appropriate for its type” CLEAR  < data object >.
CLEAR Structure DATA wa like customers. … CLEAR wa.
ABAP Report : Program Structure Report ztest. *Data objects declaration data ... data begin of ... *Program Logic(Data objects processing) … write ….
ABAP Practice
Ad

More Related Content

What's hot (17)

Analytic & Windowing functions in oracle
Analytic & Windowing functions in oracleAnalytic & Windowing functions in oracle
Analytic & Windowing functions in oracle
Logan Palanisamy
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
naveen
 
Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)
Adam Mukharil Bachtiar
 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editor
Jose Pla
 
Java SE 8
Java SE 8Java SE 8
Java SE 8
Murali Pachiyappan
 
Functions struct&union
Functions struct&unionFunctions struct&union
Functions struct&union
UMA PARAMESWARI
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 
Generic Functional Programming with Type Classes
Generic Functional Programming with Type ClassesGeneric Functional Programming with Type Classes
Generic Functional Programming with Type Classes
Tapio Rautonen
 
SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)
Logan Palanisamy
 
More on Lex
More on LexMore on Lex
More on Lex
Tech_MX
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional Programming
Jordan Parmer
 
Assembly Language Compiler Implementation
Assembly Language Compiler ImplementationAssembly Language Compiler Implementation
Assembly Language Compiler Implementation
RAVI TEJA KOMMA
 
DIWE - Advanced PHP Concepts
DIWE - Advanced PHP ConceptsDIWE - Advanced PHP Concepts
DIWE - Advanced PHP Concepts
Rasan Samarasinghe
 
Functions
FunctionsFunctions
Functions
Ankit Dubey
 
The Ring programming language version 1.5.3 book - Part 21 of 184
The Ring programming language version 1.5.3 book - Part 21 of 184The Ring programming language version 1.5.3 book - Part 21 of 184
The Ring programming language version 1.5.3 book - Part 21 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 123 of 210
The Ring programming language version 1.9 book - Part 123 of 210The Ring programming language version 1.9 book - Part 123 of 210
The Ring programming language version 1.9 book - Part 123 of 210
Mahmoud Samir Fayed
 
Practical Functional Programming Presentation by Bogdan Hodorog
Practical Functional Programming Presentation by Bogdan HodorogPractical Functional Programming Presentation by Bogdan Hodorog
Practical Functional Programming Presentation by Bogdan Hodorog
3Pillar Global
 
Analytic & Windowing functions in oracle
Analytic & Windowing functions in oracleAnalytic & Windowing functions in oracle
Analytic & Windowing functions in oracle
Logan Palanisamy
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
naveen
 
Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)
Adam Mukharil Bachtiar
 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editor
Jose Pla
 
Mesics lecture 5 input – output in ‘c’
Mesics lecture 5   input – output in ‘c’Mesics lecture 5   input – output in ‘c’
Mesics lecture 5 input – output in ‘c’
eShikshak
 
Generic Functional Programming with Type Classes
Generic Functional Programming with Type ClassesGeneric Functional Programming with Type Classes
Generic Functional Programming with Type Classes
Tapio Rautonen
 
SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)
Logan Palanisamy
 
More on Lex
More on LexMore on Lex
More on Lex
Tech_MX
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional Programming
Jordan Parmer
 
Assembly Language Compiler Implementation
Assembly Language Compiler ImplementationAssembly Language Compiler Implementation
Assembly Language Compiler Implementation
RAVI TEJA KOMMA
 
The Ring programming language version 1.5.3 book - Part 21 of 184
The Ring programming language version 1.5.3 book - Part 21 of 184The Ring programming language version 1.5.3 book - Part 21 of 184
The Ring programming language version 1.5.3 book - Part 21 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 123 of 210
The Ring programming language version 1.9 book - Part 123 of 210The Ring programming language version 1.9 book - Part 123 of 210
The Ring programming language version 1.9 book - Part 123 of 210
Mahmoud Samir Fayed
 
Practical Functional Programming Presentation by Bogdan Hodorog
Practical Functional Programming Presentation by Bogdan HodorogPractical Functional Programming Presentation by Bogdan Hodorog
Practical Functional Programming Presentation by Bogdan Hodorog
3Pillar Global
 

Similar to Chapter 1 Abap Programming Overview (20)

Abap programming overview
Abap programming overview Abap programming overview
Abap programming overview
k kartheek
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
sapdocs. info
 
1582627
15826271582627
1582627
tabish
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
sapdocs. info
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basics
Abhishek Dixit
 
C++
C++C++
C++
Prakash Sharma
 
Ab ap faq
Ab ap faqAb ap faq
Ab ap faq
alok khobragade
 
SQL python for beginners easy explanation with concepts and output .pptx
SQL python for beginners easy explanation with concepts and output .pptxSQL python for beginners easy explanation with concepts and output .pptx
SQL python for beginners easy explanation with concepts and output .pptx
harshitagrawal2608
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
Dushmanta Nath
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
Rasan Samarasinghe
 
DP080_Lecture_2 SQL related document.pdf
DP080_Lecture_2 SQL related document.pdfDP080_Lecture_2 SQL related document.pdf
DP080_Lecture_2 SQL related document.pdf
MinhTran394436
 
04 pig data operations
04 pig data operations04 pig data operations
04 pig data operations
Subhas Kumar Ghosh
 
C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
C
CC
C
Jerin John
 
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
 
Theory1&amp;2
Theory1&amp;2Theory1&amp;2
Theory1&amp;2
Dr.M.Karthika parthasarathy
 
Basic programming
Basic programmingBasic programming
Basic programming
Jugul Crasta
 
Odp
OdpOdp
Odp
Mark McNasby
 
0104 abap dictionary
0104 abap dictionary0104 abap dictionary
0104 abap dictionary
vkyecc1
 
Abap programming overview
Abap programming overview Abap programming overview
Abap programming overview
k kartheek
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
sapdocs. info
 
1582627
15826271582627
1582627
tabish
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
sapdocs. info
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basics
Abhishek Dixit
 
SQL python for beginners easy explanation with concepts and output .pptx
SQL python for beginners easy explanation with concepts and output .pptxSQL python for beginners easy explanation with concepts and output .pptx
SQL python for beginners easy explanation with concepts and output .pptx
harshitagrawal2608
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
Dushmanta Nath
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
Rasan Samarasinghe
 
DP080_Lecture_2 SQL related document.pdf
DP080_Lecture_2 SQL related document.pdfDP080_Lecture_2 SQL related document.pdf
DP080_Lecture_2 SQL related document.pdf
MinhTran394436
 
C programming language
C programming languageC programming language
C programming language
Abin Rimal
 
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
 
0104 abap dictionary
0104 abap dictionary0104 abap dictionary
0104 abap dictionary
vkyecc1
 
Ad

Recently uploaded (20)

2. Basic Legal terminologies in law for paralegal officers .docx
2. Basic Legal terminologies in law for paralegal officers .docx2. Basic Legal terminologies in law for paralegal officers .docx
2. Basic Legal terminologies in law for paralegal officers .docx
JosiahOngai1
 
Top MBA Specializations List at ISMS Pune.pdf
Top MBA Specializations List at ISMS Pune.pdfTop MBA Specializations List at ISMS Pune.pdf
Top MBA Specializations List at ISMS Pune.pdf
ISMS PUne
 
When Is the Best Time to Use Job Finding Apps?
When Is the Best Time to Use Job Finding Apps?When Is the Best Time to Use Job Finding Apps?
When Is the Best Time to Use Job Finding Apps?
SnapJob
 
Introduction on Speaking skills Power Point
Introduction on Speaking skills Power PointIntroduction on Speaking skills Power Point
Introduction on Speaking skills Power Point
helenswarna
 
HCollege ppt guidance and counselin.pptx
HCollege ppt guidance and counselin.pptxHCollege ppt guidance and counselin.pptx
HCollege ppt guidance and counselin.pptx
liajohn0808
 
Lecture 4.pptx which is need for microeconomic
Lecture 4.pptx which is need for microeconomicLecture 4.pptx which is need for microeconomic
Lecture 4.pptx which is need for microeconomic
mdrakibhasan1427
 
美国学位证(纽约州立大学德里分校毕业证明)SUNYD文凭证书复刻
美国学位证(纽约州立大学德里分校毕业证明)SUNYD文凭证书复刻美国学位证(纽约州立大学德里分校毕业证明)SUNYD文凭证书复刻
美国学位证(纽约州立大学德里分校毕业证明)SUNYD文凭证书复刻
Taqyea
 
Employment Communication : The Job HUnting.pptx
Employment Communication : The Job HUnting.pptxEmployment Communication : The Job HUnting.pptx
Employment Communication : The Job HUnting.pptx
JunaidAlvi5
 
RCM-billing in medical coding0000 1.pptx
RCM-billing in medical coding0000 1.pptxRCM-billing in medical coding0000 1.pptx
RCM-billing in medical coding0000 1.pptx
liajohn0808
 
RightShip-Inspection-Maritime-Safety-Simplified.pptx
RightShip-Inspection-Maritime-Safety-Simplified.pptxRightShip-Inspection-Maritime-Safety-Simplified.pptx
RightShip-Inspection-Maritime-Safety-Simplified.pptx
ultronmeg
 
Curriculum Vitae of Professor Dr. Nazrul Islam
Curriculum Vitae of Professor Dr. Nazrul IslamCurriculum Vitae of Professor Dr. Nazrul Islam
Curriculum Vitae of Professor Dr. Nazrul Islam
Dr. Nazrul Islam
 
Latest Questions & Answers | Prepare for H3C GB0-961 Certification
Latest Questions & Answers | Prepare for H3C GB0-961 CertificationLatest Questions & Answers | Prepare for H3C GB0-961 Certification
Latest Questions & Answers | Prepare for H3C GB0-961 Certification
NWEXAM
 
remakingyourselfpresentation-250430095415-6476ade1.pptx
remakingyourselfpresentation-250430095415-6476ade1.pptxremakingyourselfpresentation-250430095415-6476ade1.pptx
remakingyourselfpresentation-250430095415-6476ade1.pptx
lakhmanpindariya9176
 
cis1-Project-Ch6b-Laptop Mac,Chrome,Windows-Portillo-Osmin.ppt.pptx
cis1-Project-Ch6b-Laptop Mac,Chrome,Windows-Portillo-Osmin.ppt.pptxcis1-Project-Ch6b-Laptop Mac,Chrome,Windows-Portillo-Osmin.ppt.pptx
cis1-Project-Ch6b-Laptop Mac,Chrome,Windows-Portillo-Osmin.ppt.pptx
slkfam510
 
Top Business Schools in Delhi For Quality Education
Top Business Schools in Delhi For Quality EducationTop Business Schools in Delhi For Quality Education
Top Business Schools in Delhi For Quality Education
top10privatecolleges
 
Traditional Medicine aDRTYSRTYSRTnd HIV.ppt
Traditional Medicine aDRTYSRTYSRTnd HIV.pptTraditional Medicine aDRTYSRTYSRTnd HIV.ppt
Traditional Medicine aDRTYSRTYSRTnd HIV.ppt
XolaniRadebe7
 
Huckel_Molecular orbital _Theory_8_Slides.pptx
Huckel_Molecular orbital _Theory_8_Slides.pptxHuckel_Molecular orbital _Theory_8_Slides.pptx
Huckel_Molecular orbital _Theory_8_Slides.pptx
study2022bsc
 
Research Project csi1 - This presentation compares popular web browsers such ...
Research Project csi1 - This presentation compares popular web browsers such ...Research Project csi1 - This presentation compares popular web browsers such ...
Research Project csi1 - This presentation compares popular web browsers such ...
bomisung0207
 
Organic Reactions Overviewwwweeeeeeee.pptx
Organic Reactions Overviewwwweeeeeeee.pptxOrganic Reactions Overviewwwweeeeeeee.pptx
Organic Reactions Overviewwwweeeeeeee.pptx
JayPatel845511
 
Science Lab Safety PPT.pptxwgyie ulbyaaaaaaaaaaaaaaaaaaaaaau
Science Lab Safety PPT.pptxwgyie ulbyaaaaaaaaaaaaaaaaaaaaaauScience Lab Safety PPT.pptxwgyie ulbyaaaaaaaaaaaaaaaaaaaaaau
Science Lab Safety PPT.pptxwgyie ulbyaaaaaaaaaaaaaaaaaaaaaau
atifkhan990367
 
2. Basic Legal terminologies in law for paralegal officers .docx
2. Basic Legal terminologies in law for paralegal officers .docx2. Basic Legal terminologies in law for paralegal officers .docx
2. Basic Legal terminologies in law for paralegal officers .docx
JosiahOngai1
 
Top MBA Specializations List at ISMS Pune.pdf
Top MBA Specializations List at ISMS Pune.pdfTop MBA Specializations List at ISMS Pune.pdf
Top MBA Specializations List at ISMS Pune.pdf
ISMS PUne
 
When Is the Best Time to Use Job Finding Apps?
When Is the Best Time to Use Job Finding Apps?When Is the Best Time to Use Job Finding Apps?
When Is the Best Time to Use Job Finding Apps?
SnapJob
 
Introduction on Speaking skills Power Point
Introduction on Speaking skills Power PointIntroduction on Speaking skills Power Point
Introduction on Speaking skills Power Point
helenswarna
 
HCollege ppt guidance and counselin.pptx
HCollege ppt guidance and counselin.pptxHCollege ppt guidance and counselin.pptx
HCollege ppt guidance and counselin.pptx
liajohn0808
 
Lecture 4.pptx which is need for microeconomic
Lecture 4.pptx which is need for microeconomicLecture 4.pptx which is need for microeconomic
Lecture 4.pptx which is need for microeconomic
mdrakibhasan1427
 
美国学位证(纽约州立大学德里分校毕业证明)SUNYD文凭证书复刻
美国学位证(纽约州立大学德里分校毕业证明)SUNYD文凭证书复刻美国学位证(纽约州立大学德里分校毕业证明)SUNYD文凭证书复刻
美国学位证(纽约州立大学德里分校毕业证明)SUNYD文凭证书复刻
Taqyea
 
Employment Communication : The Job HUnting.pptx
Employment Communication : The Job HUnting.pptxEmployment Communication : The Job HUnting.pptx
Employment Communication : The Job HUnting.pptx
JunaidAlvi5
 
RCM-billing in medical coding0000 1.pptx
RCM-billing in medical coding0000 1.pptxRCM-billing in medical coding0000 1.pptx
RCM-billing in medical coding0000 1.pptx
liajohn0808
 
RightShip-Inspection-Maritime-Safety-Simplified.pptx
RightShip-Inspection-Maritime-Safety-Simplified.pptxRightShip-Inspection-Maritime-Safety-Simplified.pptx
RightShip-Inspection-Maritime-Safety-Simplified.pptx
ultronmeg
 
Curriculum Vitae of Professor Dr. Nazrul Islam
Curriculum Vitae of Professor Dr. Nazrul IslamCurriculum Vitae of Professor Dr. Nazrul Islam
Curriculum Vitae of Professor Dr. Nazrul Islam
Dr. Nazrul Islam
 
Latest Questions & Answers | Prepare for H3C GB0-961 Certification
Latest Questions & Answers | Prepare for H3C GB0-961 CertificationLatest Questions & Answers | Prepare for H3C GB0-961 Certification
Latest Questions & Answers | Prepare for H3C GB0-961 Certification
NWEXAM
 
remakingyourselfpresentation-250430095415-6476ade1.pptx
remakingyourselfpresentation-250430095415-6476ade1.pptxremakingyourselfpresentation-250430095415-6476ade1.pptx
remakingyourselfpresentation-250430095415-6476ade1.pptx
lakhmanpindariya9176
 
cis1-Project-Ch6b-Laptop Mac,Chrome,Windows-Portillo-Osmin.ppt.pptx
cis1-Project-Ch6b-Laptop Mac,Chrome,Windows-Portillo-Osmin.ppt.pptxcis1-Project-Ch6b-Laptop Mac,Chrome,Windows-Portillo-Osmin.ppt.pptx
cis1-Project-Ch6b-Laptop Mac,Chrome,Windows-Portillo-Osmin.ppt.pptx
slkfam510
 
Top Business Schools in Delhi For Quality Education
Top Business Schools in Delhi For Quality EducationTop Business Schools in Delhi For Quality Education
Top Business Schools in Delhi For Quality Education
top10privatecolleges
 
Traditional Medicine aDRTYSRTYSRTnd HIV.ppt
Traditional Medicine aDRTYSRTYSRTnd HIV.pptTraditional Medicine aDRTYSRTYSRTnd HIV.ppt
Traditional Medicine aDRTYSRTYSRTnd HIV.ppt
XolaniRadebe7
 
Huckel_Molecular orbital _Theory_8_Slides.pptx
Huckel_Molecular orbital _Theory_8_Slides.pptxHuckel_Molecular orbital _Theory_8_Slides.pptx
Huckel_Molecular orbital _Theory_8_Slides.pptx
study2022bsc
 
Research Project csi1 - This presentation compares popular web browsers such ...
Research Project csi1 - This presentation compares popular web browsers such ...Research Project csi1 - This presentation compares popular web browsers such ...
Research Project csi1 - This presentation compares popular web browsers such ...
bomisung0207
 
Organic Reactions Overviewwwweeeeeeee.pptx
Organic Reactions Overviewwwweeeeeeee.pptxOrganic Reactions Overviewwwweeeeeeee.pptx
Organic Reactions Overviewwwweeeeeeee.pptx
JayPatel845511
 
Science Lab Safety PPT.pptxwgyie ulbyaaaaaaaaaaaaaaaaaaaaaau
Science Lab Safety PPT.pptxwgyie ulbyaaaaaaaaaaaaaaaaaaaaaauScience Lab Safety PPT.pptxwgyie ulbyaaaaaaaaaaaaaaaaaaaaaau
Science Lab Safety PPT.pptxwgyie ulbyaaaaaaaaaaaaaaaaaaaaaau
atifkhan990367
 
Ad

Chapter 1 Abap Programming Overview

  • 1. ABAP Programming Overview
  • 2. ABAP Course Outline Chapter 1 : Introduction to ABAP Chapter 2 : List Processing in ABAP Chapter 3 : Open SQL & Internal Table Chapter 4 : Event-driven Programming & Selection Screen Chapter 5 : Modularization & Catch Statement Chapter 6 : Message, Debugging, File Transfer and Type Group
  • 3. ABAP Chapter 1 Introduction to SAP Architecture ABAP Overview Data Object in ABAP
  • 4. SAP System : 3 Tier Client/Server DB Server SAP Application Server SAP GUI Presentation Server SAP GUI SAP GUI
  • 5. SAP SYSTEM (3 Tier Architecture) Presentation Layer (Windows based) Application Layer (Windows Server/UNIX) Database Server Database Layer (Windows Server/UNIX) M SAP Instance Oracle Informix DB2 MS SQL Server MaxDB G Dispatcher Request Queue D D B V S E SAP Buffer (Shared Mem) SAP GUI SAP GUI
  • 7. SAP System : Dialog Processing Database Server Application Server Dispatcher Request Queue D D D D … SAP Buffer Program Table … 1 3 4 5 6 8 9 10 Report zpsm1. Tables customers. Select single * from customers where id = 1. Write: / customers-name. Execute ABAP statement Check Program in Program Buffer 7 Load&Gen Program SQL Request Send List Generate Screen(List) Send Request Request List 2 Search for free WP Store request to queue Send request to WP SAP GUI
  • 8. Dialog Work Process Architecture TaskHandler DYNPRO Processor ABAP Processor Local Memory Memory Space DB Interface List buffer Database Server Dialog Work Process Result Set Memory
  • 10. ABAP Overview DATA ... WRITE ... IF ... MOVE … WHILE... *Comment... SEARCH ... SELECT ... LOOP AT ... DO ...
  • 11. ABAP A dvanced B usiness A pplication P rogramming
  • 12. ABAP Feature Declaring data with various types and structure Operational elements for data manipulation Control elements for controlling the program flow Event elements for reacting to external events
  • 13. ABAP Operating/Database system-independent programming ABAP contains a subset of SQL called Open SQL for comfortable database access for various database
  • 14. ABAP Programming ABAP Report Dialog Programming(Transaction)
  • 15. ABAP Program : Report Report Program : attribute type 1 (executable) Reading Database Reading data
  • 16. Types of ABAP Report 1. Report Listing 2. Drill-down Report 3. Control-break Report 4. ALV Report 1 3 4
  • 17. ABAP Program : Dialog Program Dialog Program : attribute type M (Module Pool) Reading Database Reading and changing data Writing
  • 18. Dialog Program : Transaction
  • 20. How to create ABAP program Transaction Code : SE38
  • 24. The Structure of the Language Each statement must end with a period DATA tmp TYPE I. WRITE ‘Hello World’. WRITE ‘OK’.
  • 25. Literal DATA tmp TYPE I. WRITE ‘Hello World’. WRITE ’10’. MOVE 9 TO tmp. Text Literal Numeric Literal Text Literal
  • 26. Chained Statements Successive statements that have the same string segment can be combined to form a single chained statement To do so, you specify the identical starting segment once and conclude it with a colon (:), the remaining segments are then listed, separated by commas (,) and concluded with a period (.) At runtime, a chained statement is treated like an equivalent sequence of individual ABAP statements
  • 27. Chained Statements WRITE ‘Hello World’. WRITE ‘OK’. = WRITE: ‘Hello World’, ‘OK’. DATA tmp1 TYPE I. DATA tmp2 TYPE C. = DATA: tmp1 TYPE I, tmp2 TYPE C.
  • 28. Chained Statement MOVE sy-subrc TO tmp1. MOVE sy-subrc TO tmp2. MOVE sy-subrc TO tmp3. = MOVE sy-subrc TO: tmp1, tmp2, tmp3.
  • 29. Chained Statement PERFORM cal_1 USING a1 a2. PERFORM cal_1 USING a3 a4. = PERFORM cal_1 USING: a1 a2, a3 a4.
  • 30. Comments * This is full line comment WRITE ‘Hello World’. “ Write data (partial line comment) WRITE ‘Test’.
  • 31. ABAP Command : Case Sensitivity ABAP command is not case sensitive WRITE ‘Hello World’. WriTe ‘Hello World’. wRiTE ‘Hello World’.
  • 33. Data Objects in ABAP Memory Space Structure Table Structure Internal Table Variable Constants <Field-symbols>
  • 35. Variable Variables can be declared at any point in a program Variables can be up to 30 characters in length REPORT ZTEST. DATA firstname TYPE STRING. firstname = ‘John’.
  • 36. Predefined ABAP Data Types Type Description Initial Value C D F I N P T X String xstring Character Date Floating Point Integer Numeric Text Packed Decimal Time Hexadecimal Variable-length Variable-length Hexadecimal Space ‘ 00000000’ 0.0 0 ‘ 0’ 0 ‘ 000000’ ’ 00’ Space Blank string Length 1 – 65535 8 characters 8 bytes 4 bytes 1 – 65535 1 – 16 bytes 6 characters 1 – 65535 Variable Variable
  • 37. Defining Variable with DATA Statement * Syntax DATA var[( length )] [Type type ] [Decimals number ]. DATA var LIKE Table-Field [VALUE initial value ].
  • 38. Defining Variable with DATA Statement * Data Declaration DATA: tmp(10) TYPE C, tmp1 TYPE I, tmp2(8) TYPE P DECIMALS 2 VALUE ‘1.50’. DATA: tmp3(5) TYPE N, tmp4.
  • 39. Defining Variable with DATA Statement * Data Declaration DATA customerno LIKE customers-id. DATA matnr LIKE mara-matnr . DATA customerno TYPE customers-id. DATA matnr TYPE mara-matnr.
  • 40. ABAP Predefined Data Types ABAP Predefined Data Types Complete Types (I,F,D,T,STRING and XSTRING) Incomplete Types (C,N,P and X)
  • 41. Variable Data Type C , N and X length between 1 – 65535 (Default 1) Data Type P length between 1 – 16 (Default 8) and decimals length between 0 – 31 Data Type I value between – 2 31 to 2 31 – 1 or –2,147,483,648 to 2,147,483,647 DATA tmp(10) TYPE C. DATA tmp(5) TYPE P DECIMALS 2. DATA tmp TYPE I. tmp = 1000000.
  • 42. Data type N data tmp(5) type N. tmp = ‘Xca9yy23K6’.
  • 43. ABAP Error System Runtime Error User Runtime Error Time Exceed (10 Minutes) Cannot Allocate Space ABAP Error Syntax Error Runtime Error
  • 44. User Runtime Error DATA result TYPE i. result = 10 / 0.
  • 45. System Runtime Error : Space Allocation
  • 46. System Runtime Error : Time Exceed
  • 47. Non-elementary Type * Data Declaration TYPES tname(30) TYPE c. DATA: customer_name TYPE tname, firstname TYPE tname.
  • 48. Value Assignment * Value assignment DATA: name1(30), first_num TYPE I , next_num TYPE I. MOVE ‘XXXX’ TO name1. MOVE 5 TO first_num. COMPUTE next_num = first_num + 5. name1 = ‘SAP’. ADD 1 TO next_num.
  • 49. Value Assignment * Value assignment DATA: tmp1 TYPE i , tmp2 TYPE i . tmp1 = tmp2 = 10.
  • 50. ABAP Practice ต้องการให้สร้างตัวแปรชื่อ firstname และ lastname โดยให้ค่าชื่อของคุณกับ ตัวแปร firstname และนามสกุลของคุณให้กับตัวแปร lastname พร้อมทั้งแสดง ค่าข้อมูล firstname กับ lastname ออกมาที่หน้าจอ
  • 52. Structure * Syntax DATA BEGIN OF < structure name >. DATA field1. DATA field2. … … DATA END OF < structure name >.
  • 53. Structure * Syntax DATA BEGIN OF wa. DATA id LIKE customers-id . DATA name LIKE customers-name . DATA city LIKE customers-city . DATA END OF wa. MOVE 9 TO wa-id. WRITE wa-id. id city wa 00000000 name
  • 54. Defining Structure (Include Structure) * Include Structure DATA BEGIN OF wa. INCLUDE STRUCTURE customers. DATA tel(7). DATA END OF wa.
  • 55. Defining Structure * LIKE option DATA wa LIKE customers. wa-id = 1. wa-name = ‘John’. WRITE: wa-id, wa-name.
  • 56. ABAP Practice ต้องการให้สร้าง Structure ชื่อ myname โดยมีฟิลด์ firstname และ lastname โดยให้ค่าชื่อของคุณกับฟิลด์ firstname และนามสกุลของคุณให้กับฟิลด์ lastname พร้อมทั้งแสดงค่าข้อมูลของ Structure ที่ชื่อ myname ทั้งฟิลด์ firstname และ lastname ออกมาที่หน้าจอ
  • 58. Constants * Constant variable CONSTANTS max_no TYPE I VALUE 999. DATA counter TYPE I VALUE max_no. WRITE: max_no, counter.
  • 59. Constants Using Example * Constant variable CONSTANTS ctext(11) TYPE C VALUE ‘Hello World’. WRITE ctext. WRITE ctext. WRITE ctext. WRITE ctext. WRITE ctext.
  • 60. System Fields The system fields (structure syst) are filled by the runtime environment. You can use them to query the system status in an ABAP program You should access them only for reading sy-datum = Current date of application server sy-uzeit = Current time of application server sy-datlo = Current date of SAP GUI sy-timlo = Current time of SAP GUI sy-mandt = Current client logon sy-subrc = Return value of ABAP statement syst-datum
  • 61. ABAP System Fields : Structure SYST (SE11)
  • 62. DATE * Fixed Length 8 * Include Representation ‘ YYYYMMDD ’ DATA today TYPE D. today = sy-datum. WRITE today. today = ‘19991231’. WRITE today.
  • 63. TIME * Fixed Length 6 * Format ‘HHMMSS’ DATA times TYPE T. times = sy-uzeit. WRITE times. HHMMSS
  • 64. MOVE Statement DATA wa LIKE customers . DATA vender LIKE customers. wa -id = ‘1234’. wa -name = ‘Test#1’. MOVE wa TO vender. WRITE: wa -id, vender-name. “ vender = wa.
  • 65. MOVE-CORRESPONDING Statement DATA: begin of wa1, f1,f2,f4, end of wa1 . DATA: begin of wa2, f2,f1,f3, end of wa2 . … MOVE -CORRESPONDING wa1 TO wa2 . WRITE: wa1-f1 , wa2-f1 .
  • 67. Field-symbols Data: name (4) Value ‘Test’, num Type I Value 10, today Type D Value ‘19980429’. Field-symbols <temp>. Assign name To <temp>. Write <temp>. Assign num To <temp>. Write <temp>. Assign today To <temp>. Write <temp>.
  • 68. Field-symbols : UNASSIGN d ata: name (4) Value ‘Test’, f ield-symbols <temp>. a ssign name To <temp>. w rite <temp>. una ssign <temp>.
  • 69. CLEAR Statement Example: DATA tmp type i value 9. tmp = 10. CLEAR tmp. “ Clear statement sets a field to an initial value appropriate for its type” CLEAR < data object >.
  • 70. CLEAR Structure DATA wa like customers. … CLEAR wa.
  • 71. ABAP Report : Program Structure Report ztest. *Data objects declaration data ... data begin of ... *Program Logic(Data objects processing) … write ….