‎2008 Mar 09 10:24 AM
HI everybody:
why '19955011' (type D) 's INVERTED-DATE TYPE value is
' 80049488'
‎2008 Mar 09 10:44 AM
Hi,
Inverted Dates
'19955011' (type D) 's INVERTED-DATE TYPE value is
' 80049488' as abap uses nine's complement for the calculation
In some cases (for example, when sorting dates in descending order), it is useful to convert a date from format D to an inverted date by using the keyword CONVERT.
CONVERT DATE <d1> INTO INVERTED-DATE <d2>.
Afterwards, you can convert the inverted data back into a normal date using the statement
CONVERT INVERTED-DATE <d1> INTO DATE <d2>.
These statements convert the field <d1> from the formats DATE or INVERTED-DATE to the formats INVERTED-DATE or DATE and assign it to the field <d2>.
For the conversion, ABAP forms the nine's complement.
Regards
‎2008 Mar 09 10:38 AM
‎2008 Mar 09 10:41 AM
IN program as following :
DATA: ODATE TYPE D VALUE '19955011',
IDATE LIKE ODATE.
DATA FIELD(8).
FIELD = ODATE. WRITE / FIELD.
CONVERT DATE ODATE INTO INVERTED-DATE IDATE.
FIELD = IDATE. WRITE / FIELD.
CONVERT INVERTED-DATE IDATE INTO DATE ODATE.
FIELD = ODATE. WRITE / FIELD.
输出如下:
19955011
80049488
19955011
TKS Atish Sarda !
‎2008 Mar 09 10:45 AM
Hi Sophie,
Inverted date is nothing but each digit -9
So you can get as why it is shown like that.
This is no longer is used now.
Check below SAP help
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb334a358411d1829f0000e829fbfe/content.htm
Regards,
Atish
‎2008 Mar 09 10:53 AM
‎2008 Mar 09 10:44 AM
Hi,
Inverted Dates
'19955011' (type D) 's INVERTED-DATE TYPE value is
' 80049488' as abap uses nine's complement for the calculation
In some cases (for example, when sorting dates in descending order), it is useful to convert a date from format D to an inverted date by using the keyword CONVERT.
CONVERT DATE <d1> INTO INVERTED-DATE <d2>.
Afterwards, you can convert the inverted data back into a normal date using the statement
CONVERT INVERTED-DATE <d1> INTO DATE <d2>.
These statements convert the field <d1> from the formats DATE or INVERTED-DATE to the formats INVERTED-DATE or DATE and assign it to the field <d2>.
For the conversion, ABAP forms the nine's complement.
Regards