0% found this document useful (0 votes)
66 views

ABAP Elementary Data Types: C: Character Text N: Numeric Text

This document discusses ABAP data types and declarations. It covers character, numeric, integer, date, packed number, time, floating point, and hexadecimal data types. It also discusses declaring variables, assigning initial and default values, declaring "like" fields, constants, and user-defined data types. The slides provide examples of declaring different types of variables and constants.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views

ABAP Elementary Data Types: C: Character Text N: Numeric Text

This document discusses ABAP data types and declarations. It covers character, numeric, integer, date, packed number, time, floating point, and hexadecimal data types. It also discusses declaring variables, assigning initial and default values, declaring "like" fields, constants, and user-defined data types. The slides provide examples of declaring different types of variables and constants.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 8

IBM Global Services

ABAP Elementary Data Types

C: Character Text

N: Numeric Text

I: Integer

D: Date

P: Packed #

T: Time

F: Floating Point #

X: Hexadecimal #

Slide 1

ABAP Data Declarations | 1.04 |

IBM Global Services

Declaring Variables

DATA: PLAYER(35) TYPE C, NICKNAME(35), POINTS TYPE I, GAMES TYPE I AVERAGE(5) TYPE P, STARTER, ACQUIRED TYPE D.

VALUE 10,

Slide 2

ABAP Data Declarations | 1.04 |

IBM Global Services

Initial Values

C: (blank) I: zero P: zero F: zeroes

N: zeroes D: 00000000 T: 000000 X: 00

The CLEAR statement sets a field back to its initial value, not its default value.
Slide 3 ABAP Data Declarations | 1.04 |

IBM Global Services

Assigning Default Values

DATA: PLAYER(35) TYPE C, NICKNAME(35) VALUE Dr. J, POINTS TYPE I VALUE 255, GAMES TYPE I VALUE 10, AVERAGE(5) TYPE P VALUE 25.5, STARTER VALUE Yes, ACQUIRED TYPE D VALUE 19760610.

Slide 4

ABAP Data Declarations | 1.04 |

IBM Global Services

Declaring Like Fields

DATA: PLAYER(35) TYPE C VALUE Julius Erving, NICKNAME(35), ACQUIRED TYPE D. Use the LIKE addition to declare fields with the same format (i.e., data type and length) DATA: PLAYER(35) TYPE C VALUE Julius Erving, NICKNAME LIKE PLAYER, ACQUIRED LIKE SY-DATUM.
Slide 5 ABAP Data Declarations | 1.04 |

IBM Global Services

Declaring Constants

The VALUE addition is required.

CONSTANTS: TEAM1(20) TYPE C VALUE 76ers, TEAM2 LIKE TEAM1 VALUE Celtics, TOT_GAMES TYPE I VALUE 82.

If you attempt to change the value of a constant, a syntax error will occur.
Slide 6 ABAP Data Declarations | 1.04 |

IBM Global Services

User-Defined Data Types

TYPES: NAME(35) TYPE C, TEAMS(20) TYPE C. DATA: PLAYER TYPE NAME VALUE Troy Aikman, NICKNAME LIKE PLAYER. CONSTANTS: TEAM1 TYPE TEAMS VALUE Cowboys, TEAM2 LIKE TEAM1 VALUE Packers.

A user-defined data type created with the TYPES statement is used to specify a fields data type in the TYPE addition of the DATA or CONSTANTS statements.

Slide 7

ABAP Data Declarations | 1.04 |

IBM Global Services

Output Characteristic for Data Types


Standard Length C = defined length I = 12 P = (2 * defined length) + 1 F = 22 N = defined length D = 10 T =8 X = (2 * defined length) Justification C = left-justified I = right-justified P = right-justified F = right-justified N = left-justified D = left-justified

T = left-justified
X = left-justified

Slide 8

ABAP Data Declarations | 1.04 |

You might also like