Академический Документы
Профессиональный Документы
Культура Документы
14-Sep-09
Kaavian Systems
Data in ABAP
DATA TYPES
DATA OBJECTS
14-Sep-09
Kaavian Systems
14-Sep-09
Kaavian Systems
Elementary types
Complex types
Reference types
14-Sep-09
Kaavian Systems
Elementary Types
Fixed Length
Variable Length
14-Sep-09
Kaavian Systems
14-Sep-09
Kaavian Systems
Fixed Length
Character Type
14-Sep-09
Character
Numeric
Date(8)
Time(6)
Hexadecimal X
D
T
Kaavian Systems
Numeric Type
Integer I
Range -2**31 to 2**31-1 only whole
numbers.
Float F
Packed P
P allows digits after the decimal point
up to 14 digit.
14-Sep-09
Kaavian Systems
Variable Length
String
A string is a sequence of characters
with variable length.
XString
A byte string is a hexadecimal type with
variable length.
14-Sep-09
Kaavian Systems
Complex Types
STRUCTURE
A
structure
is
sequence
of
any
INTERNAL TABLE
Internal tables consists of a series of
lines that all have the same data type.
14-Sep-09
Kaavian Systems
10
TYPES
<t>[(<length>)]
[TYPE
<type>|LIKE
Eg:
TYPES NAME(20) TYPE C
14-Sep-09
Kaavian Systems
11
Kaavian Systems
4 / 3 = 1.33
12
Data Objects
14-Sep-09
Literals
Kaavian Systems
13
Literals
Literals are unnamed data objects
Types of Literals:
Number literals
Character Literals
Number literals
DATA number TYPE i VALUE
-1234.
14-Sep-09
WRITE 6789.
Character Literals
`Anton Schmitt
`69190 Walldorf
`
Kaavian Systems
14
Named Data
Objects
14-Sep-09
Text Symbols
Variables
Kaavian Systems
15
Text Symbols
14-Sep-09
Kaavian Systems
TEXT-<idt>
16
Variables
Variables are named data objects that you can
declare statically using declarative statements, or
dynamically while a program is running. They allow
you to store changeable data under a particular name
within the memory area of a program.
14-Sep-09
Kaavian Systems
17
Variables
You can declare variables statically using the
following statements:
14-Sep-09
Variables
14-Sep-09
internal table
Kaavian Systems
19
Constants
declare
it.
It
cannot
subsequently
be
changed.
14-Sep-09
Kaavian Systems
error or runtime error
occurs.
20
Constants
CONSTANTS
statement is exactly the same as
that of the DATA statement, but with the following
exceptions:
statement.
The
start
value
during
the
execution
of
the
program.
Example:
CONSTANTS: pi TYPE P DECIMALS 10 VALUE
'3.1415926536'.
14-Sep-09
Kaavian Systems
21
is
structure
with
the
ABAP
state
of
the
system.
They are
Kaavian Systems
22
Kaavian Systems
The number 100 is an
integer.
23
Type Additions
TYPE Addition Used for defining a new data type
TYPE
addition
can
have
various
14-Sep-09
Kaavian Systems
24
Like Additions
LIKE Addition Used for defining data object
You use the LIKE addition in various
ABAP statements for defining data types and
specifying the types of interface parameters or
field symbols.
The addition LIKE <obj> can be used
in
the
same
ABAP
statements
as
the
TYPE
14-Sep-09
Kaavian Systems
25
Report
The statement REPORT must be the first
statement of an independent program
Syntax
REPORT rep [list_options]
[MESSAGE-ID mid]
[DEFINING DATABASE ldb].
REPORT - list_options
[NO STANDARD PAGE HEADING]
[LINE-SIZE width]
[LINE-COUNT page_lines[(footer_lines)]]
14-Sep-09
Kaavian Systems
26
Comments
14-Sep-09
Kaavian Systems
27
Structure
Example
DATA : BEGIN OF structure,
Name(20) type c,
age type I,
END OF structure.
Types of Structure
Nested, Flat, Deep
14-Sep-09
Kaavian Systems
28
Parameters
Syntax
PARAMETERS <p>[(<length>)] [TYPE <type>|
LIKE <obj>] [DECIMALS <d>].
14-Sep-09
Kaavian Systems
29
Write
The basic ABAP/4 statement for outputting on the
screen is WRITE.
Syntax: WRITE<f>.
The field <f> can be
Any Data Object
A Field Symbol
A Text Symbol
14-Sep-09
Kaavian Systems
30
Select-Options
The SELECT-OPTIONS statement is used to
declare selection tables and create corresponding
input fields on the associated selection screen.
Syntax
SELECT-OPTIONS <seltab> FOR <f>.
14-Sep-09
Kaavian Systems
31
Field symbols
Syntax
FIELD-SYMBOLS <FS> [<type>|
STRUCTURE <s>
14-Sep-09
DEFAULT <wa>].
Kaavian Systems
32
Processing data
Assigning Values
Numeric Operations
14-Sep-09
Kaavian Systems
33
Assigning values
MOVE
WRITE TO
CLEAR
14-Sep-09
Kaavian Systems
34
Move
WRITE TO
write <f1> to <f2>
CLEAR
14-Sep-09
clear <f>
Kaavian Systems
35
Scenario
Maintain a record with the fields
NAME
AGE
SEX
QUALIFICATION
DOB
DESIGNATION
COMMENTS to the code.
14-Sep-09
Kaavian Systems
36
Scenario
(Specify appropriate DATA TYPES). Get the values
from the user (using PARAMETER) MOVE it to the
RECORD. Use FIELD-SYMBOL for designation and print
the record using WRITE statement and all the possible
options, Give appropriate COMMENTS to the code.
14-Sep-09
Kaavian Systems
37
Reference
The
learning
material
contained
in
this
PowerPoint
Presentation is prepared with the help of http://help.sap.com/
and sap press book. All rights reserved by SAP AG.
Unless otherwise specifically stated, this learning material is
intended for the sole purpose of class room session, internal use
and for knowledge transfer to the Consultants.
However, for detailed information on this learning material,
http://help.sap.com / sap press book may be referred.
Kaavian is not liable for any legal liability or responsibility for
the accuracy, completeness or usefulness of any information
disclosed in these learning materials.
No portion of the learning materials
shall be modified,
reproduced or transmitted in any form by any means, whether
by electronic, photocopier or otherwise without the written
permission of Kaavian. In no event shall Kaavian be liable for
any damage whatsoever resulting in any action arising in
connection with the use of learning material.
02-Sep-09
Kaavian Systems