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 get values

Former Member
0 Likes
1,097

Hi,

Iam trying to get values from IE02->class overview->charecteristic values using BAPI_OBJCL_GETDETAIL.

In this BAPI iam getting date values in char format like

2.0050922000000000E07,2.0050923000000000E07.

How can i convert these values into date format?

reward guaranteed

cheers

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,050

Hi Kaki,

You can use Function module :

CTCV_CONVERT_FLOAT_TO_DATE

Please pass you float value(2.0050922000000000E+07) and this will convert your float valueto internal date format(as 20050922).

Hope this will help you.

Lanka

Hi,

Iam trying to get values from IE02->class overview->charecteristic values using BAPI_OBJCL_GETDETAIL.

In this BAPI iam getting date values in char format like

2.0050922000000000E07,2.0050923000000000E07.

How can i convert these values into date format?

reward guaranteed

cheers

kaki

6 REPLIES 6
Read only

Former Member
0 Likes
1,051

Hi Kaki,

You can use Function module :

CTCV_CONVERT_FLOAT_TO_DATE

Please pass you float value(2.0050922000000000E+07) and this will convert your float valueto internal date format(as 20050922).

Hope this will help you.

Lanka

Read only

0 Likes
1,050

Thank you murthy,

full points alloted.

cheers

kaki

Read only

Former Member
0 Likes
1,050

Hi Kaki,

Just convert hte floating point to a Packed number and the n convert it into date. i hope it works.

regards

Read only

0 Likes
1,050

Lanka suggestion works good too. Basically does the same thing.




report  zrich_0001.


data: char(30) type c value '2.0050922000000000E+07'.
data: f type CAWN-ATFLV.
data: date type sy-datum.

f =  char.
call function 'CTCV_CONVERT_FLOAT_TO_DATE'
  exporting
    float = f
  importing
    date  = char.

date = char.
write:/ date.

REgards,

Rich Heilman

Read only

0 Likes
1,050

thank you rich

points alloted

kaki

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,050

If that value is truly coming in a character field, you can do something like this.



report  zrich_0001.


data: char(30) type c value '2.0050922000000000E+07'.
data: f type f.
data: p(5) type p.
data: date type sy-datum.

f =  char.

p  = f .
char = p.
shift char left deleting leading space.
date = char.

write:/ date.

Regards,

Rich Heilman