TAW11 Abap TypesAndDataObjects PDF
TAW11 Abap TypesAndDataObjects PDF
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/m2p1.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1p1.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o1c1.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o1c1.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o1c2.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o1c2.htm 28/07/2010
Page 1 of 2
Date Fields
Audio Transcript
ABAP has a separate data type for Date and Time fields. They are character like data types and contain 8 numeric
characters for the date and 6 numeric characters for the time.
On the screen you can see that the 8 character field for the data type date can be represented as the date format or
as an integer when the date type is converted to an integer for arithmetic purposes.
The internal format of YYYYMMDD can also be defined to a more user friendly format. This specified format can be
used for input and output. The sample code on your screen shows you how date1 has a formatted output and date2 is
as per the system format.
Date fields can be used in arithmetic expressions. The data object of type date will be represented as an integer and
its value is calculated as the number of days from 1st January 0001.
If the data object with type time is used in arithmetic expressions, then it takes a value as the number of seconds from
midnight.
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o1c3.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o1c3.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o1c4.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c1.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c1.htm 28/07/2010
Page 1 of 2
Literals
Audio Transcript
A literal is defined in the source text of the program. There are three types of literals:
The numeric literal which is defined as a sequence of digits, the text-field literal which is defined as a sequence of
characters using the inverted commas to enclose the characters, and the string literal which is defined using the
character string defined within back quotes. The string literal is only available from SAP Web Application Server 6.10
and later.
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c2.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c2.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c3.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c3.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c4.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c4.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c5.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c5.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c6.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c6.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c7.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c8.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c8.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c9.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c9.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c10.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c10.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c11.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c14.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c14.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c15.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c15.htm 28/07/2010
Page 1 of 2
In the image on your screen, you will see some statements. In each of these statements, the operands are treated like
type c fields, regardless of their actual field type. They are not converted.
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c16.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c16.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c17.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c18.htm 28/07/2010
Page 1 of 1
Access with Offset and Length Information for Elementary Data Objects
Audio Transcript
As you can see from the image on your screen, when character fields are defined, the offset and length are
interpreted character by character. When defined as byte-like fields the values are assumed in bytes.
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c19.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c20.htm 28/07/2010
Page 1 of 2
Value Assignments
Audio Transcript
On your screen you can see that if we want to assign the value of one field to another, we can either say MOVE
source TO target or we can say target=source.
Both source and target should be of the same type. There is one more option shown on your screen. The WRITE
statement is used when you want to copy the source to the target in a formatted form. In this case the target field has
to be long enough to accommodate the formatting, for example, spaces or separators.
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c21.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t1o2c21.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2p1.htm 28/07/2010
Page 1 of 2
Definition of Structures
Audio Transcript
There are two ways to declare structures: This can be done using the TYPES statement to explicitly define a structure
type to which the DATA statement refers, or construct the data type implicitly in the DATA statement.
Sample code for both types is shown on your screen for reference.
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o1c1.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o1c1.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o1c4.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o1c4.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o2c1.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o2c1.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o3c1.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o3c1.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o3c2.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t2o3c2.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3p1.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c1.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c1.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c2.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c2.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c3.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c3.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c4.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c4.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c5.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c5.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c6.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c6.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c7.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c7.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c8.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c9.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c9.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c10.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c10.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c11.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c11.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c12.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c12.htm 28/07/2010
Page 1 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c15.htm 28/07/2010
Page 2 of 2
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c15.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c18.htm 28/07/2010
Page 1 of 1
http://online.sap.com/sap/courses/sap-113634/16441125/KTMID509897808040915370315/t3o1c19.htm 28/07/2010