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

Problem in report.

Former Member
0 Likes
775

Hi friends,

I have a problem,

i have define box_no type i,

I_tab-BOX_NO = QUAN / 125000.

while dividing for eg:

300000/125000 = 2.4

but it display 2 .

if it is above .5 it display to

a approx value but if it is

below .5 it does not display

how can i display tthe values

2.4 to appox 3.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
757

Hi,

Try using ceil().

OR

use FM ROUND.

Thanks,

Sriram Ponna.

5 REPLIES 5
Read only

Former Member
0 Likes
758

Hi,

Try using ceil().

OR

use FM ROUND.

Thanks,

Sriram Ponna.

Read only

former_member188827
Active Contributor
0 Likes
757

data: zp TYPE p DECIMALS 2, zint TYPE i.

zp = frac( 300000 / 125000 ).

zint = 300000 / 125000 .

IF zp is NOT INITIAL.

zint = zint + 1.

ENDIF.

WRITE zint.

u can also do as follows:

data zp type p decimals 0.

zp = ceil( 300000 / 125000 ).

replace da numbers wid ur variables..

plz reward points if dis helps

Read only

Former Member
0 Likes
757

hi

it is like this becoz u have defined it integer ok

iif u want the output as u specified use

floor or seil key word

Cheers

Snehi Chouhan

Read only

Former Member
0 Likes
757
data : wsp1 type p DECIMALS 2,
         wsp type I.
        

  clear : wsp, wsp1.
  WSP = I_tab-BOX_NO.
  wsp1 = WSP - I_tab-BOX_NO.
  if wsp1 < 0.
    wsp = wsp + 1.
    ENDIF.

 I_tab-BOX_NO = wsp.
Read only

Former Member
0 Likes
757

This query is solved