16 Kasım 2008 Pazar

Data Types and Data Objects















In SAP Web As 6.10 and later, you can also specify the length after the LENGTH additon.Eg.
TYPE TYPE LENGTH
DATA TYPE LENGTH

Literals are data objects that are defined in the source text of a program and whose values are uniquely defined.the Abap runtime environment differentiates between three types of literals.

a)numeric literals
b)Text field literals
c)string literals

To display a single quote within a text field literal, you have to enter it twice

The TABLES statement always creates data objects that are visible program-wide.Data Objects that are created with the TABLES statement are always visible in the entire program,even if the statement appears within a subroutine or function module.

Data objects in modules and event blocks are always global.

In contrast to many other programming languages,the result of integer arithmetic in ABAP is rounded up or down to the nearest integer.

Data int type i.
int = 4 / 10. "Result 0
int = 5 / 10. "Result 1

Moreover- again in contrast to many other programming languages all interim results are also rounded.
Metin Rengi
int = 10 * ( 4 / 10 ). "Result 0
int = ( 10 * 4 ) / 10. "Result 1

Floating point arithmetic

Data: float type f,
pack type p decimals 2.
float = 73050 * '0.0727'. "Result 5.3107349999999997E+03
pack = float.
write pack. "Result 5310.73

Packed Number



Mixed Arithmetic Expressions













Caution: When trigonometry functions and other scientific functions,
logarithms and exponential functions (including the ** operator) are used,
floating point arithmetic is always used for calculation.




Hiç yorum yok: