Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

INVERTED-DATE

Former Member
0 Likes
2,551

HI everybody:

why '19955011' (type D) 's INVERTED-DATE TYPE value is

' 80049488'

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,450

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

5 REPLIES 5
Read only

Former Member
0 Likes
1,450

HI,

Where did you got that value? In debugging?

Regards,

Atish

Read only

0 Likes
1,450

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.

&#36755;&#20986;&#22914;&#19979;&#65306;

19955011

80049488

19955011

TKS Atish Sarda !

Read only

0 Likes
1,450

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

Read only

0 Likes
1,450

Sincerely thanks all of kindly and excellent replies .

TKS.

Read only

Former Member
0 Likes
1,451

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