SlideShare uma empresa Scribd logo
1 de 72
ABAP Programming   Overview
ABAP Course Outline ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ABAP Chapter 1 ,[object Object],[object Object],[object Object]
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 ,[object Object],[object Object],[object Object],[object Object]
ABAP Feature ,[object Object],[object Object],[object Object],[object Object]
ABAP  ,[object Object],[object Object]
ABAP  Programming  ,[object Object],[object Object]
ABAP Program : Report Report Program : attribute type 1 (executable) Reading Database ,[object Object]
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 ,[object Object],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 ,[object Object],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 ,[object Object],[object Object],[object Object]
Chained Statements ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Chained Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Chained Statement ,[object Object],[object Object],[object Object],[object Object],[object Object]
Comments * This is  full line  comment WRITE ‘Hello World’.  “ Write data  (partial line comment)   WRITE ‘Test’.
ABAP Command : Case Sensitivity ,[object Object],[object Object],[object Object],[object Object]
Data Objects in ABAP
Data Objects in ABAP ,[object Object],Structure Table Structure Internal Table Variable Constants <Field-symbols>
Variable
Variable ,[object Object],[object Object],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 ,[object Object],[object Object],[object Object],[object Object],DATA tmp(10) TYPE C. DATA tmp(5) TYPE P DECIMALS 2. DATA tmp TYPE I. tmp = 1000000.
Data type N ,[object Object],[object Object]
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 ,[object Object],[object Object],[object Object],[object Object]
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 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],id city wa 00000000 name
Defining Structure (Include Structure) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Defining Structure ,[object Object],[object Object],[object Object],[object Object],[object Object]
ABAP Practice  ต้องการให้สร้าง  Structure  ชื่อ  myname  โดยมีฟิลด์  firstname  และ  lastname  โดยให้ค่าชื่อของคุณกับฟิลด์  firstname  และนามสกุลของคุณให้กับฟิลด์  lastname  พร้อมทั้งแสดงค่าข้อมูลของ  Structure  ที่ชื่อ  myname  ทั้งฟิลด์  firstname  และ  lastname  ออกมาที่หน้าจอ
Constants
Constants ,[object Object],[object Object],[object Object],[object Object]
Constants Using Example ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
System Fields ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],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 ,[object Object],[object Object],[object Object],[object Object],[object Object],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 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Field-symbols : UNASSIGN ,[object Object],[object Object],[object Object],[object Object],[object Object]
CLEAR Statement ,[object Object],[object Object],[object Object],[object Object],“ Clear statement sets a field to an initial value appropriate for its type” CLEAR  < data object >.
CLEAR Structure ,[object Object],[object Object],[object Object]
ABAP Report : Program Structure ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
ABAP Practice

Mais conteúdo relacionado

Mais procurados

Analytic & Windowing functions in oracle
Analytic & Windowing functions in oracleAnalytic & Windowing functions in oracle
Analytic & Windowing functions in oracleLogan Palanisamy
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sqlnaveen
 
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 editorJose 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 ClassesTapio 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 LexTech_MX
 
Assembly Language Compiler Implementation
Assembly Language Compiler ImplementationAssembly Language Compiler Implementation
Assembly Language Compiler ImplementationRAVI TEJA KOMMA
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional ProgrammingJordan Parmer
 
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 184Mahmoud 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 210Mahmoud 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 Hodorog3Pillar Global
 

Mais procurados (17)

Analytic & Windowing functions in oracle
Analytic & Windowing functions in oracleAnalytic & Windowing functions in oracle
Analytic & Windowing functions in oracle
 
Oracle naveen Sql
Oracle naveen   SqlOracle naveen   Sql
Oracle naveen Sql
 
Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)Algorithm and Programming (Procedure and Function)
Algorithm and Programming (Procedure and Function)
 
Beginning with vi text editor
Beginning with vi text editorBeginning with vi text editor
Beginning with vi text editor
 
Java SE 8
Java SE 8Java SE 8
Java SE 8
 
Functions struct&union
Functions struct&unionFunctions struct&union
Functions struct&union
 
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’
 
Generic Functional Programming with Type Classes
Generic Functional Programming with Type ClassesGeneric Functional Programming with Type Classes
Generic Functional Programming with Type Classes
 
SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)SQL for pattern matching (Oracle 12c)
SQL for pattern matching (Oracle 12c)
 
More on Lex
More on LexMore on Lex
More on Lex
 
Assembly Language Compiler Implementation
Assembly Language Compiler ImplementationAssembly Language Compiler Implementation
Assembly Language Compiler Implementation
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional Programming
 
DIWE - Advanced PHP Concepts
DIWE - Advanced PHP ConceptsDIWE - Advanced PHP Concepts
DIWE - Advanced PHP Concepts
 
Functions
FunctionsFunctions
Functions
 
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
 
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
 
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
 

Destaque

交互设计模式创新
交互设计模式创新交互设计模式创新
交互设计模式创新Alite Yu
 
노들섬프로젝트
노들섬프로젝트노들섬프로젝트
노들섬프로젝트kim
 
Eg2010 bill ptacek
Eg2010 bill ptacekEg2010 bill ptacek
Eg2010 bill ptacekBill Ott
 
Doing Business In Guinee
Doing Business In GuineeDoing Business In Guinee
Doing Business In GuineeMalik Balde
 
界面线索性设计
界面线索性设计界面线索性设计
界面线索性设计Alite Yu
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02tabish
 
界面图标设计
界面图标设计界面图标设计
界面图标设计Alite Yu
 
Our Discovery Fair Projects
Our Discovery Fair ProjectsOur Discovery Fair Projects
Our Discovery Fair ProjectsLynessa
 
Eg2010 calvin-serials
Eg2010 calvin-serialsEg2010 calvin-serials
Eg2010 calvin-serialsBill Ott
 
Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01tabish
 
1582627
15826271582627
1582627tabish
 
I os视觉分享 2011共享版
I os视觉分享 2011共享版I os视觉分享 2011共享版
I os视觉分享 2011共享版Alite Yu
 
电子商务网站评测模版
电子商务网站评测模版电子商务网站评测模版
电子商务网站评测模版Alite Yu
 
03 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp0203 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp02tabish
 
交互设计禅意花园
交互设计禅意花园交互设计禅意花园
交互设计禅意花园Alite Yu
 
如何选择和运用不同的用户研究方法
如何选择和运用不同的用户研究方法如何选择和运用不同的用户研究方法
如何选择和运用不同的用户研究方法Alite Yu
 

Destaque (19)

交互设计模式创新
交互设计模式创新交互设计模式创新
交互设计模式创新
 
노들섬프로젝트
노들섬프로젝트노들섬프로젝트
노들섬프로젝트
 
Eg2010 bill ptacek
Eg2010 bill ptacekEg2010 bill ptacek
Eg2010 bill ptacek
 
Doing Business In Guinee
Doing Business In GuineeDoing Business In Guinee
Doing Business In Guinee
 
界面线索性设计
界面线索性设计界面线索性设计
界面线索性设计
 
Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02Abapprogrammingoverview 090715081305-phpapp02
Abapprogrammingoverview 090715081305-phpapp02
 
界面图标设计
界面图标设计界面图标设计
界面图标设计
 
Our Discovery Fair Projects
Our Discovery Fair ProjectsOur Discovery Fair Projects
Our Discovery Fair Projects
 
Eg2010 calvin-serials
Eg2010 calvin-serialsEg2010 calvin-serials
Eg2010 calvin-serials
 
Photo album 2
Photo album 2Photo album 2
Photo album 2
 
Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01Chapter 1abapprogrammingoverview-091205081953-phpapp01
Chapter 1abapprogrammingoverview-091205081953-phpapp01
 
Photo album
Photo albumPhoto album
Photo album
 
1582627
15826271582627
1582627
 
I os视觉分享 2011共享版
I os视觉分享 2011共享版I os视觉分享 2011共享版
I os视觉分享 2011共享版
 
电子商务网站评测模版
电子商务网站评测模版电子商务网站评测模版
电子商务网站评测模版
 
Oss swot
Oss swotOss swot
Oss swot
 
03 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp0203 abap3-090715081232-phpapp01-100511101016-phpapp02
03 abap3-090715081232-phpapp01-100511101016-phpapp02
 
交互设计禅意花园
交互设计禅意花园交互设计禅意花园
交互设计禅意花园
 
如何选择和运用不同的用户研究方法
如何选择和运用不同的用户研究方法如何选择和运用不同的用户研究方法
如何选择和运用不同的用户研究方法
 

Semelhante a chapter-1abapprogrammingoverview-091205081953-phpapp01

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 ABAPsapdocs. info
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAPsapdocs. info
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basicsAbhishek Dixit
 
C programming session 01
C programming session 01C programming session 01
C programming session 01Dushmanta 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++ programmingRasan Samarasinghe
 
C programming language
C programming languageC programming language
C programming languageAbin Rimal
 
0104 abap dictionary
0104 abap dictionary0104 abap dictionary
0104 abap dictionaryvkyecc1
 
What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?ukdpe
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 OverviewEric Nelson
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial javaTpoint s
 

Semelhante a chapter-1abapprogrammingoverview-091205081953-phpapp01 (20)

Abap programming overview
Abap programming overview Abap programming overview
Abap programming overview
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
 
List Processing in ABAP
List Processing in ABAPList Processing in ABAP
List Processing in ABAP
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basics
 
C++
C++C++
C++
 
Ab ap faq
Ab ap faqAb ap faq
Ab ap faq
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
 
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
 
04 pig data operations
04 pig data operations04 pig data operations
04 pig data operations
 
C programming language
C programming languageC programming language
C programming language
 
C
CC
C
 
Theory1&amp;2
Theory1&amp;2Theory1&amp;2
Theory1&amp;2
 
Basic programming
Basic programmingBasic programming
Basic programming
 
Odp
OdpOdp
Odp
 
0104 abap dictionary
0104 abap dictionary0104 abap dictionary
0104 abap dictionary
 
012. SQL.pdf
012. SQL.pdf012. SQL.pdf
012. SQL.pdf
 
What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
 
C programming language tutorial
C programming language tutorial C programming language tutorial
C programming language tutorial
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 

chapter-1abapprogrammingoverview-091205081953-phpapp01

  • 1. ABAP Programming Overview
  • 2.
  • 3.
  • 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.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. Types of ABAP Report 1. Report Listing 2. Drill-down Report 3. Control-break Report 4. ALV Report 1 3 4
  • 17.
  • 18. Dialog Program : Transaction
  • 20. How to create ABAP program Transaction Code : SE38
  • 24.
  • 25. Literal DATA tmp TYPE I. WRITE ‘Hello World’. WRITE ’10’. MOVE 9 TO tmp. Text Literal Numeric Literal Text Literal
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. Comments * This is full line comment WRITE ‘Hello World’. “ Write data (partial line comment) WRITE ‘Test’.
  • 31.
  • 33.
  • 35.
  • 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.
  • 42.
  • 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.
  • 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.
  • 53.
  • 54.
  • 55.
  • 56. ABAP Practice ต้องการให้สร้าง Structure ชื่อ myname โดยมีฟิลด์ firstname และ lastname โดยให้ค่าชื่อของคุณกับฟิลด์ firstname และนามสกุลของคุณให้กับฟิลด์ lastname พร้อมทั้งแสดงค่าข้อมูลของ Structure ที่ชื่อ myname ทั้งฟิลด์ firstname และ lastname ออกมาที่หน้าจอ
  • 58.
  • 59.
  • 60.
  • 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.
  • 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.
  • 68.
  • 69.
  • 70.
  • 71.