Ansicht
Dokumentation

ABAPOPEN_DATASET_ENDIAN - OPEN DATASET ENDIAN

ABAPOPEN_DATASET_ENDIAN - OPEN DATASET ENDIAN

General Data in Customer Master   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

OPEN DATASET, endian

Short Reference



... ${BIG$|LITTLE$} ENDIAN ...

Effect

This addition specifies that, when a legacy file is opened, numeric data objects of the type i, int8, decfloat16, decfloat34, f, or s are stored in the file in the byte order Big Endian or Little Endian. When a data object of these types is written or read, a conversion between these orders and the byte order of the current platform is performed, if necessary. If the addition is not specified, the byte order of the host computer of the current is used.

Notes

  • The statement SET DATASET can be used to specify a different byte order for an opened legacy file.
  • The addition ${BIG$|LITTLE$} ENDIAN replaces the use of the obsolete statement TRANSLATE NUMBER FORMAT in the case of file accesses.

Example

Opens a legacy binary file with different byte orders for writing. In each case, the integer 111 is written to the file and the content is read in binary format to a byte string. The results are 0000006F and 6F000000, that is, 111 in binary format in Big Endian and Little Endian.
READ DATASET dset INTO xstr.
CLOSE DATASET dset.
cl_demo_output=>write( xstr ).

OPEN DATASET dset FOR OUTPUT IN LEGACY BINARY MODE LITTLE ENDIAN.
TRANSFER 111 TO dset.
CLOSE DATASET dset.
OPEN DATASET dset FOR INPUT IN BINARY MODE
READ DATASET dset INTO xstr.
CLOSE DATASET dset.
cl_demo_output=>write( xstr ).

cl_demo_output=>display( ).

DELETE DATASET dset.






TXBHW - Original Tax Base Amount in Local Currency   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 2588 Date: 20240424 Time: 075417     sap01-206 ( 39 ms )