ARTIClE
Conversion of Integer Numbers to Bytes
This example demonstrates the conversion of integers into byte fields
and strings.
ABAP_SOURCE_CODE
ABAP_EXEC
ABAP_DESCRIPTION
This program takes numbers of the data types b , s , and
i ,
und int8 ,
that cover the entire value range and assigns them to byte fields of
the lengths 1, 2, 4, and 8 and to a byte string and displays them in a
classic list.
To calculate the numbers using powers of two, the
calculation type decfloat34 is forced as a results field
(using a decimal floating point number). If the integer types are used
directly as results fields, the calculation type is f .
F�r genaue Berechnungen mit dem Typ int8 hat der Rechentyp
f aber nicht gen�gend Dezimalstellen und kann sogar zu einem
�berlauf f�hren wenn an der Grenze des Wertebereichs von int8
gerundet wird.
.
This example highlights the different lengths that can occur for these
assignments to byte strings. It also shows that, in the case of
assignments of the type s to x , a field length of 4 bytes
is required for negative numbers.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved