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

hOW TO

Former Member
0 Likes
664

Hello

I need too know how to convert from

2.0060315000000000E+07 to 2006.03.15

I have the code something like:

data: a type ATFLV, b type DATUM.

a = 2.0060315000000000E+07.

How to convert to

b = 2006.03.15 ??

Thanks!!

Gabriel

Message was edited by:

Gabriel Fernando Pulido V.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
640

If your user specifc settings for the date format are YYYY.MM.DD, then this coding will work.




data: a type f,
      n(8) type n,
      b type DATUM,
      c(10) type c.

a = '2.0060315000000000E+07'.
n = a.
b = n.
write b to c.

write:/ c.

Regards,

RIch Heilman

Message was edited by:

Rich Heilman

Hello

I need too know how to convert from

2.0060315000000000E+07 to 2006.03.15

I have the code something like:

data: a type ATFLV, b type DATUM.

a = 2.0060315000000000E+07.

How to convert to

b = 2006.03.15 ??

Thanks!!

Gabriel

Message was edited by:

Gabriel Fernando Pulido V.

4 REPLIES 4
Read only

Former Member
0 Likes
640

Hi Gabriel,

Check this function module <b>CTCV_CONVERT_FLOAT_TO_DATE</b>.

Thanks,

Vinay

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
641

If your user specifc settings for the date format are YYYY.MM.DD, then this coding will work.




data: a type f,
      n(8) type n,
      b type DATUM,
      c(10) type c.

a = '2.0060315000000000E+07'.
n = a.
b = n.
write b to c.

write:/ c.

Regards,

RIch Heilman

Message was edited by:

Rich Heilman

Read only

Former Member
0 Likes
640

Hi,

Please try FM CTCV_CONVERT_FLOAT_TO_DATE.

Regards,

Ferry Lianto

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
640

Or if your user specific format is not like that and you need to force that formatting, you can do this.



data: a type f,
      n(8) type n,
      b type DATUM,
      c(10) type c.

a = '2.0060315000000000E+07'.
n = a.
b = n.

concatenate b(4) '.' b+4(2) '.' b+6(2) into c.

write:/ c.

Regards,

RIch Heilman