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

Data type Conversion from floating to fixed number

Former Member
0 Likes
5,282

Hi,

Whether any BAPI to convert floating point numbers like " 9.000000000000000E+05 to decimal like 900000.00 ".

Regards,

Hari

3 REPLIES 3
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,551

MOVE or COMPUTE, automatic conversion will be executed, look at [Conversion table for source field type decfloat16, decfloat34 |http://help.sap.com/abapdocu/en/ABENCONVERSION_TYPE_DECFLOAT.htm]

If your question is related to BAPI and quantity and amount field in BAPI, look also at [Converting Between Int. and Ext. Data Formats and Structures|http://help.sap.com/saphelp_nw04/helpdata/EN/a5/3ec9ea4ac011d1894e0000e829fbbd/frameset.htm]

Regards,

Raymond

Read only

Former Member
0 Likes
1,551

Hello

No need bapi for this.

Declare new variable and move value:


data: val1 type f, val2 type i.
val1 = '9.000000000000000E+05'.
val2 = val1.

Read only

Former Member
0 Likes
1,551

Hi Hari,

Try with this.

data: val1 type f, val2 type p DECIMALS 2.

val1 = '9.000000000000000E+05'.

val2 = val1.

If it helps to you, please mark that question as resolved.

Thanks,

Sreekala.