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

round off

Former Member
0 Likes
1,497

hi,

help me in this issue

how to round off the decimal places like 86.67 to 86.70

like that.

thanks in advance

kiran kumar

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
971

hi,

<b>DATA: VAR1 TYPE P DECIMALS 2,

RES TYPE P DECIMALS 2.</b>

VAR1 = '12.33'.

RES = ROUND( VAR1 ).

WRITE RES.

rgds

anver

if hlped pls mark points.

<i>is it working, pls let me know</i>

Message was edited by: Anversha s

8 REPLIES 8
Read only

anversha_s
Active Contributor
0 Likes
972

hi,

<b>DATA: VAR1 TYPE P DECIMALS 2,

RES TYPE P DECIMALS 2.</b>

VAR1 = '12.33'.

RES = ROUND( VAR1 ).

WRITE RES.

rgds

anver

if hlped pls mark points.

<i>is it working, pls let me know</i>

Message was edited by: Anversha s

Read only

0 Likes
971

hi Anversha,

i have to make whole one amount column to be rounded off . i think i can use what u have written

is it right and one more thing anversha can u plz tell how to update the tables using change_document in fi.

thanks in advance

kiran kumar

Message was edited by: kiran kumar

Message was edited by: kiran kumar

Read only

0 Likes
971

hi kiram,

for amount u can use <b>ROUND</b> do that.

chk some FM also.

<b>ROUND_AMOUNT

FI_ROUND_AMOUNT</b>

anothe FM <b>HR_IN_ROUND_AMT</b>

u can use any of these . ROUND will work perfectly.

rgds

anver

<i>did it work or any help needed.</i>

if hlped pls mark points

Read only

0 Likes
971

hi anersha,

i have gien amount as some 200,37 and company code as some 0101 and currency as gbp but it s should same value as result.

and can u plz tell tell how can we use change_document

functional module.

thanks in advance

Read only

0 Likes
971

hi,

chk the sample code.

REPORT ZEXAMPLE.

TABLES T001R.

DATA V_AMTOUT LIKE BSEG-WSKTO.

PARAMETERS P_AMTIN LIKE BSEG-WSKTO.

WRITE:/ 'Original amount:', P_AMTIN,

/ 'Company', 15 'Currency', 35 'Amount'.

ULINE.

LOOP AT T001R.

CALL FUNCTION 'ROUND_AMOUNT'

EXPORTING

AMOUNT_IN = P_AMTIN

COMPANY = T001R-BUKRS

CURRENCY = T001R-WAERS

IMPORTING

AMOUNT_OUT = V_AMTOUT.

WRITE:/ T001R-BUKRS, 15 T001R-WAERS, 25 V_AMTOUT.

ENDLOOP.

rgds

anver

if hlped pls mark points

Read only

0 Likes
971

hi,

Anversha

thanks it is working, can u plz tell tell how the change_document functional module will be used i need to update the zuonr and xref2 i dont know how many tables like bsid bsed needs to updated so how can i proceed with it

thanks in advance

kiran kumar

Read only

0 Likes
971
Read only

venkata_ramisetti
Active Contributor
0 Likes
971

Hi,

If you just want this functionality just for display purpose, then you can use the following option.

DATA: X TYPE P DECIMALS 3 VALUE '1.267'.

WRITE: /X DECIMALS 0, "output: 1

/X DECIMALS 2, "output: 1.27

/X DECIMALS 5. "output: 1.26700

Thanks

Ramakrishna