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

help in field type

Former Member
0 Likes
982

Hallow I have a problem in calculation the problem is that I wont to double 2 numbers from different type and the program bring me rounded number

I wont just the real number the types for the 2 numbers is

<b>Score is type N4</b> and <b>weighiting is type DEC3_2</b>

In my program I do like that

LOOP AT score_tab INTO wa_score_tab.

<b>wa_score_tab-score_sum</b> = ( wa_score_tab-weighting * wa_score_tab-score ) / 100.

MODIFY score_tab FROM wa_score_tab TRANSPORTING score_sum .

ENDLOOP.

I wont like

(77*5)/100 = 3.85

And not 4 like I have now.

<b>Which type I have to declare score_sum.</b>

regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
957

hi everyone

it help in the program but i have structre that i buield in se11 how i declare it their

becouse type p is erorr.

regardas

Hallow I have a problem in calculation the problem is that I wont to double 2 numbers from different type and the program bring me rounded number

I wont just the real number the types for the 2 numbers is

<b>Score is type N4</b> and <b>weighiting is type DEC3_2</b>

In my program I do like that

LOOP AT score_tab INTO wa_score_tab.

<b>wa_score_tab-score_sum</b> = ( wa_score_tab-weighting * wa_score_tab-score ) / 100.

MODIFY score_tab FROM wa_score_tab TRANSPORTING score_sum .

ENDLOOP.

I wont like

(77*5)/100 = 3.85

And not 4 like I have now.

<b>Which type I have to declare score_sum.</b>

regards

8 REPLIES 8
Read only

Former Member
0 Likes
957
data : sum type P decimals 2.
Read only

0 Likes
957

hi santosh

it help in the program but i have structre that i buield in se11 how i declare it their

becouse type p is erorr.

regardas

Read only

Former Member
0 Likes
957

Hi,

Use packed data type for i.

Regards,

Sreevani

Read only

0 Likes
957

Use Packed decimal type P and u can limit the how many decimal place u want.

Data: sum type P decimals 2.

Read only

Former Member
0 Likes
957

declare it as TYPE P DECIMALS 2

and make sure that in the attributes(in menu Goto-->Attributes) of the program fixed point arithmetic is checked

Read only

Former Member
0 Likes
957

Hi,

Define wa_score_tab-score_sum as the <b>same type of weighiting</b>.

U will get the correct output.

Reward if this helsp.

Read only

Former Member
0 Likes
958

hi everyone

it help in the program but i have structre that i buield in se11 how i declare it their

becouse type p is erorr.

regardas

Read only

0 Likes
957

give the dataelement as DEC8_2 in SE11