cancel
Showing results for 
Search instead for 
Did you mean: 

Unconverted value of DATE

miske
Participant
0 Kudos

Hello everyone,

I have a simple select query,

Select gdatu, ukurs

FROM tcurr

INTO TABLE it_currency

But the values for GDATU I'm getting are like this for example 79889393. How can I solve this so I can get this type 06062011?

View Entire Topic
YorRombaut
Participant
0 Kudos

Hello,

This value is an inverted date, so you have 2 possibilities..

  1. Run your value through FM 'CONVERSION_EXIT_INVDT_OUTPUT'
  2. DATA(lv_uninverted_date) = 99999999 - inverted date value

Kind regards,

Yor

andreas_baldauf
Active Participant
0 Kudos

Hello Dame,

There are 2 more ways to convert the date.
- CONVERT INVERTED-DATE dat1 INTO DATE dat2.
- dat2 = dat1. TRANSLATE dat2 USING '09182736455463728190'.

These options are documented in the ABAP keyword documation for the statement CONVERT INVERTED-DATE.

Best regards,
Andreas

miske
Participant
0 Kudos

Dear Yor and Andreas,

thank you very much. That helped a lot.

If I may have a follow up question. How can I implement that in my query so it converts/translates all of my GDATU values? Can I somehow put that inside my select statement or do I have to do it some other way?

Regards,

Dame.

miske
Participant
0 Kudos

Just to add to my previous comment, if anybody else needs this. Since the Tcurr table is not that big i added loop after my select statement to change the values of that GDATU field.

LOOP AT it_currency INTO wa_currency.

TRANSLATE wa_currency-gdatu USING '09182736455463728190'.

APPEND wa_currency TO it_currency2.
ENDLOOP.

But if the table is bigger, this would slow the web service down. There's gotta be a faster and more efficient solution to this, If anyone knows it I would be happy to rewrite this code.
Regards,

Dame.