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

Floating point to date conversion

0 Likes
4,190

Do any Function module is available for converting the Date into floating point value. I have tried using FM- CTCV_CONVERT_DATE_TO_FLOAT but straight away using it is not working.

Can some help me is there any custom logic/ code additionally to be written along with this FM

Regards

Akshay

8 REPLIES 8
Read only

FredericGirod
Active Contributor
3,753

Why do you want to convert a date in Float ??

Read only

abo
Active Contributor
3,753
frdric.girod

floating appointment? 😄

Read only

matt
Active Contributor
3,753

Converting to a timestamp gives a decimal number. Is that what you mean? Look up the abap keyword documentation for CONVERT.

Read only

Sandra_Rossi
Active Contributor
3,753

This conversion works well as you can see, no need of a function module!

DATA(float) = CONV f( CONV d( '20211005' ) ).
ASSERT float = 738069.
Read only

0 Likes
3,753

Hello experts,
Thank you for your suggestions
I am trying to convert the date format into the float format.

This I am doing as I need to pass the dates through IT-AUSP table ATFLV Field.

And the date is user input (SY-Datum) while datatype of ATFLV field is Float. So conversion needed.

Please suggest

Regards

Akshay

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,753

As you can see in my answer, the date format is converted into the float format. Or maybe you expect a different conversion method?

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,753

Or in fact, maybe you don't want any value conversion?

DATA(date) = CONV d( '20211005' ).
DATA(ausp) = VALUE ausp( atflv = CONV string( date ) ).
ASSERT ausp-atflv = 20211005.