Data Types
Defining
Formal Variable description
Predifined Data types
● They are divide into two groups:
– Complete
● This means that they already contain a type-specific,
fixed length specification.
– D (Date, format YYYYMMDD)
– T (Time, format HHMMSS)
– I (Integer, length 4)
– F (Floating, length 8)
– STRING (Dynamic length character string)
– XSTRING (Dynamic length byte sequence, hexadecimal string)
Predifined Data types (2)
– Incomplete
● Do not contain a fixed length
– C (Character String)
– N (Numerical character string)
– X (Byte sequence, hexadecimal string)
– P (Packed number, decimals points may also be specified)
Local Data types
● Declared using standard data types
● Only exist in the program
● Declared using Types statement
Data types in ABAP Dictionary
● This are also called Global Data Types
● Can be used throught all the system
● Declared in the abap dictionary
Type Addition
● Used to refer any data type that is already
known.
● Visibility affects the Data Types
Type Addition (2)
● Type constructos used with the TYPE addition:
– For references
– REF TO <class>|<interface>
– For structures
– BEGIN OF <struct>.
...
– END OF <struct>.
– For tables
– <tabkind> OF <linetype> [WITH <key>]
Like Addition
● Used to refer to an already defined data object
● Can be used to refer any object declared an
visible in the context
● No need for the data object being referenced to
be in memory
Data Objects
Defining
A variable or constant that is defined concretely
by means of a data type
Literals
● Belongs to the Fixed Data Object
● Used to especify fixed values in the programs
● Literals can be:
– Numeric literals
– Text literals
Text Symbols
● Stored in the Text pool
● Used to allow abap to be multilingual.
● They are identified with a three alfanumeric ID
● Can be Translated
Variables
● Are Data Objects that can be declared
● They can be declared using:
– DATA
– STATICS
– CLASS-DATA
– PARAMETERS
– SELECT-OPTIONS
– RANGES
Constants
● Defined by the keyword CONSTANTS
● Works similar to literals
● The value addition is mandatory
Interface Work Areas
● Are data objects that are used to pass data
between:
– Screens and ABAP programs
● Tables
– Logical databases and ABAP programs
● Nodes
– ABAP programs and external subrutines
● COMMON PART
Predifined Data Objects
● There is no need to be declared
● They are always present at runtime
● There are two:
– Space
– SY
● SY-SUBRC: Return code for ABAP statements
● SY-UNAME: logon name of the user
● SY-REPID: Current ABAP program
● SY-TCODE: current transaction
● SY-INDEX: Number of the current loop pass

Data types & object

  • 1.
  • 2.
  • 3.
    Predifined Data types ●They are divide into two groups: – Complete ● This means that they already contain a type-specific, fixed length specification. – D (Date, format YYYYMMDD) – T (Time, format HHMMSS) – I (Integer, length 4) – F (Floating, length 8) – STRING (Dynamic length character string) – XSTRING (Dynamic length byte sequence, hexadecimal string)
  • 4.
    Predifined Data types(2) – Incomplete ● Do not contain a fixed length – C (Character String) – N (Numerical character string) – X (Byte sequence, hexadecimal string) – P (Packed number, decimals points may also be specified)
  • 5.
    Local Data types ●Declared using standard data types ● Only exist in the program ● Declared using Types statement
  • 6.
    Data types inABAP Dictionary ● This are also called Global Data Types ● Can be used throught all the system ● Declared in the abap dictionary
  • 7.
    Type Addition ● Usedto refer any data type that is already known. ● Visibility affects the Data Types
  • 8.
    Type Addition (2) ●Type constructos used with the TYPE addition: – For references – REF TO <class>|<interface> – For structures – BEGIN OF <struct>. ... – END OF <struct>. – For tables – <tabkind> OF <linetype> [WITH <key>]
  • 9.
    Like Addition ● Usedto refer to an already defined data object ● Can be used to refer any object declared an visible in the context ● No need for the data object being referenced to be in memory
  • 10.
  • 11.
    Defining A variable orconstant that is defined concretely by means of a data type
  • 12.
    Literals ● Belongs tothe Fixed Data Object ● Used to especify fixed values in the programs ● Literals can be: – Numeric literals – Text literals
  • 13.
    Text Symbols ● Storedin the Text pool ● Used to allow abap to be multilingual. ● They are identified with a three alfanumeric ID ● Can be Translated
  • 14.
    Variables ● Are DataObjects that can be declared ● They can be declared using: – DATA – STATICS – CLASS-DATA – PARAMETERS – SELECT-OPTIONS – RANGES
  • 15.
    Constants ● Defined bythe keyword CONSTANTS ● Works similar to literals ● The value addition is mandatory
  • 16.
    Interface Work Areas ●Are data objects that are used to pass data between: – Screens and ABAP programs ● Tables – Logical databases and ABAP programs ● Nodes – ABAP programs and external subrutines ● COMMON PART
  • 17.
    Predifined Data Objects ●There is no need to be declared ● They are always present at runtime ● There are two: – Space – SY ● SY-SUBRC: Return code for ABAP statements ● SY-UNAME: logon name of the user ● SY-REPID: Current ABAP program ● SY-TCODE: current transaction ● SY-INDEX: Number of the current loop pass