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

Convert Breakdown time

former_member328875
Participant
0 Likes
872

Hi experts,

Breakdown time in format like 5.1840000000000000E+05 how it can be converted like 144.00

Thanks,

saquib Khan

1 ACCEPTED SOLUTION
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
818

Hello Saquib Khan.

DATA: fvar type f,

          pvar type p decimals 2.
fvar = '5.1840000000000000E+05'.

pvar = fvar / 3600. "(to get your desired result 144.00 )


Regards.

5 REPLIES 5
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
819

Hello Saquib Khan.

DATA: fvar type f,

          pvar type p decimals 2.
fvar = '5.1840000000000000E+05'.

pvar = fvar / 3600. "(to get your desired result 144.00 )


Regards.

Read only

0 Likes
818

Thanks Arun. I it works but I want to know the reason why in SAP many values are not in actual format but in exponent forms n why conversion is required.

regards,

Saquib

Read only

0 Likes
818

Very good question Saquib.

But frankly I don't know the reason behind it.

If I come to know it, I will let you know surely.

Regards.

Read only

0 Likes
818

Hi Saquib,

This is the output representation for an F type field.

Here you can find more informations:

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9e2335c111d1829f0000e829fbfe/content.htm

and subsequents:

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fd9358411d1829f0000e829fbfe/content.htm

You can see an F field has a size of 8 bytes, but outputs with 22 characters.

Here

http://help.sap.com/saphelp_40b/helpdata/en/34/8e732f6df74873e10000009b38f9b8/content.htm

you can found an output example for P and F type fields.

If your question was about desing, well, we should try to guess... 🙂

Regards.

Danilo Schembri

Read only

Former Member
0 Likes
818

Hi Saquib,

5.1840000000000000E+05 is in hex format(seconds i guess),so you need to move this to a integer then just divide by number as you with(by 60 for min and by 3600 for hr).

Regards,

Supratik