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

Urgent Regarding round off values in script

Former Member
0 Likes
705

Hi Gurus,

I want to display round off values in total amount . Order conformation

i wrote one suroutine but it is not working , it is going for dump.

Eg:- total amount = 10004.49 it should display in 10004.

total amount = 10004.51 it should display in 10005.

Plz help.

REPORT ZVALUES.

tables:komk.

form round TABLEs INTAB Structure ITCSY

OUTTAB structure ITCSY.

data: w_fkwrt type fkwrt,

w_fkwr type fkwrt.

read table intab with key name = 'KOMK-FKWRT'.

if sy-subrc = 0.

w_fkwrt = intab-value.

w_fkwr = ceil( w_fkwrt ).

outtab-value = w_fkwr.

condense outtab-value.

modify outtab transporting value.

endif.

endform.

in layout i call this subroutine like this.

/:DEFINE &KOMK-FKWRT1& := &KOMK-FKWRT&.

/:PERFORM ROUND IN PROGRAM ZVALUES.

/:USING &KOMK-FKWRT&.

/:CHANGING &KOMK-FKWRT1&.

/:ENDPERFORM.

SU Final amount,,,,,,,,,,,,,,,,&KOMK-FKWRT(I13)&

Thanks & Regards,

Vamshi

Hi Gurus,

I want to display round off values in total amount . Order conformation

i wrote one suroutine but it is not working , it is going for dump.

Eg:- total amount = 10004.49 it should display in 10004.

total amount = 10004.51 it should display in 10005.

Plz help.

REPORT ZVALUES.

tables:komk.

form round TABLEs INTAB Structure ITCSY

OUTTAB structure ITCSY.

data: w_fkwrt type fkwrt,

w_fkwr type fkwrt.

read table intab with key name = 'KOMK-FKWRT'.

if sy-subrc = 0.

w_fkwrt = intab-value.

w_fkwr = ceil( w_fkwrt ).

outtab-value = w_fkwr.

condense outtab-value.

modify outtab transporting value.

endif.

endform.

in layout i call this subroutine like this.

/:DEFINE &KOMK-FKWRT1& := &KOMK-FKWRT&.

/:PERFORM ROUND IN PROGRAM ZVALUES.

/:USING &KOMK-FKWRT&.

/:CHANGING &KOMK-FKWRT1&.

/:ENDPERFORM.

SU Final amount,,,,,,,,,,,,,,,,&KOMK-FKWRT(I13)&

Thanks & Regards,

Vamshi

3 REPLIES 3
Read only

Former Member
0 Likes
598

Use this FM

CALL FUNCTION 'HR_IN_ROUND_AMT'
  EXPORTING
    amount        = p_amt
    rndoff        = '100'.
   RNDLMT        = 'N'
 IMPORTING
   RETAMT        =
   DLTAMT        =

Read only

JozsefSzikszai
Active Contributor
0 Likes
598

hi Vamshi,

1. modify outtab transporting value <b>WHERE name = 'KOMK-FKWRT1'</b>

2. for rounding use FM ROUND

ec

Message was edited by:

Eric Cartman

Read only

Former Member
0 Likes
598

why don't you just use the type conversion. the basic rule.

sorry, if i am wrong. i am an amateur, new to ABAP.

If i am right, please give me some points and make my day.

thank you,

Niran.