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

number conversion

Former Member
0 Likes
571

hi,

1.I have a doubt.if i do arithmetic operation on two floating point numbers(data type F) and assign it to a packed number(P) how will it affect the final result.

2.Another question how can i convert a negative packed number into positive packed number.

Please answer.

thanks and regards,

Mahesh

3 REPLIES 3
Read only

rainer_hbenthal
Active Contributor
0 Likes
529

a) you will have rounding errors.

b) var = - var.

Read only

Former Member
0 Likes
529

hi

good

check this

This link will give detail descrition abt datatypes.

http://help.sap.com/saphelp_webas620/helpdata/en/fc/eb3434358411d1829f0000e829fbfe/content.htm

Data Type Code Length Description

b 1 1-byte integer

C 1 - ? Character string

D 8 Date (yyyymmdd)

F 8 Floating point number

I 4 4-byte integer

N 1 - ? Digits-only character string

P Binary Coded Decimal (packed) number

s 2 2-byte integer

T 6 Time (hhmmss)

X 1 - ? Raw data

INTLEN tells us the number of bytes used by this field; DECIMALS the number of decimals for packed and floating point numbers.

reward point if helpful.

thanks

mrutyun^

Read only

Former Member
0 Likes
529

HI,

1)we will get round off errors.

2)here num is pack type variable.

num = abs( num ).

<b>example</b>

DATA:num TYPE p value '-1.23' DECIMALS 2.

write:/ num.

num = abs( num ).

write:/ num.

rgds,

bharat.