CONVERT (ABAP Keyword) introduction and details
CONVERT
Variants
1.
CONVERT DATE f1 INTO INVERTED-DATE f2.
2. CONVERT INVERTED-DATE f1 INTO DATE
f2.
Effect
Allows conversion between different formats which do not
have their own type (see also MOVE ).
The field f1 is converted from the
source format to the target format and placed in f2 .
At present, the
following formats are supported:
DATE ==> INVERTED-DATE INVERTED-DATE
==> DATE
Both formats form the nine's complement of internal date
representation, e.g. 19950511 ==> 80049488 or 80049488 ==> 19950511. In
inverse date format, the most recent date has the lowest numerical value. This
is useful when sorting date specifications.
Note
The technique of
modifying the sequence of dates by inverting the internal date format is only
used in very rare cases. For example, you can sort internal tables in ascending
or descending date order much more elegantly with the additons ... ASCENDING
bzw. ... DESCENDING of the SORT statement.
Example
DATA DATE_INV
LIKE SY-DATUM.
CONVERT DATE SY-DATUM INTO INVERTED-DATE
DATE_INV.
If, for example, the internal representation of 11.05.95 in
SY-DATUM is 19950511, the value of DATE_INV after execution of the CONVERT
statement is 80049488.
Note
Runtime
errors
CONVERT_ILLEGAL_CONVERSION : Conversion not possible due to
incorrect field length.
Related 10 ABAP Syntax Tutorials
Most readed SAP Tutorials
- WRITE - Output to a list ( SAP ABAP Keyword)
WRITE ( Output to a list ) is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - List of SAP HR TABLES and Infotypes tables
Detailed full list of tables and infotypes used in SAP HR module. - List of SAP MM Transaction codes
This documentation covers the details of SAP MM Transaction codes - SELECT-OPTIONS ( SAP ABAP Keyword)
SELECT-OPTIONS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - FI Accounts Receivable and Accounts Payable | SAP FI PDF manual
The following topics are an introduction to the Accounts Receivable and Accounts Payable application components. - SELECT clause ( SAP ABAP Keyword)
SELECT clause is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - SAP MM Process Flow
The typical procurement cycle for a service or material consists of the following phases:
Latest Added SAP documents
- 9KE9 Transaction code
Details about SAP transaction code 9KE9 - 9KE8 Transaction code
Details about SAP transaction code 9KE8 - 9KE7 Transaction code
Details about SAP transaction code 9KE7 - 9KE6 Transaction code
Details about SAP transaction code 9KE6 - 9KE5 Transaction code
Details about SAP transaction code 9KE5 - 9KE4 Transaction code
Details about SAP transaction code 9KE4 - 9KE3 Transaction code
Details about SAP transaction code 9KE3 - 9KE2 Transaction code
Details about SAP transaction code 9KE2 - 9KE1 Transaction code
Details about SAP transaction code 9KE1 - 9KE0 Transaction code
Details about SAP transaction code 9KE0