Ansicht
Dokumentation

ABAPCONVERT_DATE - CONVERT DATE

ABAPCONVERT_DATE - CONVERT DATE

BAL Application Log Documentation   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

CONVERT, DATE, INVERTED-DATE

Short Reference



CONVERT ${ ${DATE dat1 INTO INVERTED-DATE dat2$}
        $| ${INVERTED-DATE dat1 INTO DATE dat2$} $}.

Effect

These variants of the statement CONVERT are not allowed in classes. They convert the digits in a character-like data object in dat1 into their complement on nine (the difference to the number nine) and assign the result to the data object dat2. The data objects dat1 and dat2 must have a flat character-like data type with length 8. The same data object can be specified for dat2 as for dat1.

Notes

  • These forms of the statement CONVERT are not allowed in classes. They were previously used for sorting by date fields in internal tables and extracts for changing the sort direction. These have now been replaced by the additions ASCENDING and DESCENDING of the statement SORT. If necessary, the complement on nine can be formed using the following TRANSLATE statement:
dat2 = dat1.
TRANSLATE dat2 USING '09182736455463728190'.

Example

The following program section sorts the internal table sflight_tab in descending order by the fldate column.

The last nine lines can be replaced by a single line:

SORT sflight_tab BY fldate DESCENDING.

Exceptions

Non-Catchable Exceptions

  • Cause: Conversion not possible due to invalid field length
    Runtime Error: CONVERT_ILLEGAL_CONVERSION








ROGBILLS - Synchronize billing plans   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 2954 Date: 20240329 Time: 033137     sap01-206 ( 40 ms )