Skip to Content
author's profile photo Former Member
Former Member

Urgent Regarding round off values in script

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Dec 04, 2007 at 04:31 PM

    Use this FM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 04, 2007 at 04:32 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 09:11 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.