Skip to Content
avatar image
Former Member

Decimal Place wrong in abap report

Dear Experts,

I have developed one report and in the amount column decimal place is  wrong when its retrieve to internal table.

Actual amount is 2,000,000 and but it take as 2,000,0.00.. i have used BAPI_CURRENCY_CONV_TO_INTERNAL function its also don’t help to get correct amount ,

Any idea why is that..

Thanks for advice

Kanishka

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

11 Answers

  • avatar image
    Former Member
    Jan 09, 2015 at 05:46 AM

    Hi Kanishka,

    Have you checked in your program about the fixed Arithmetic.Error  may be due to this.

    With Regards

    Arun VS


    Capture.PNG (13.8 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 05:35 AM

    Hi,

    If You use ALV you need to use the currency field in the field catalog .

    See ALV TUTOTIAL FOR BEGINERS WITH EXAMPLES - ABAP Development - SCN Wiki

    Cfieldname

    Ctabname


    Is that JPY ?

    regards.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 12, 2015 at 05:46 AM

    Hi Kanishka,

    Please check the user default settings in SU01 i.e how the decimal places are defined.

    Thanks & Regards,

    Seshadri.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 05:13 AM

    Hi Kanishka,

    If it report, use the reference field and reference table in field catalog.  It will show the value as expected.

    wa_fieldcatalog-REF_FIELD =  'Fieldname'

    wa_fieldcatalog-REF_TABLE = 'Tablename'.

    You can find the currency reference in structure as show below

    Also find the below link.

    Reference Fields and Reference Tables -  ABAP Dictionary - SAP Library

    Regards

    Rajkumar Narasimman.


    zvnhdr.png (83.2 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09, 2015 at 06:11 AM

    Hi,

    Check your field type and length

    cheers

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09, 2015 at 07:03 AM

    Hi Kanishka San,

    In Japanese, The amount value in table was divided 100 times in some situation.

    Please compare the values in table in se16n and PR  in me53n.

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 07:39 AM

    Did you use the correct currency code to determinate the number of decimal places?

    NB : Same numeric value is stored with different values in internal format if number of decimal places is different -> ref Currency Fields.

    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09, 2015 at 07:42 AM

    HI Kanishka,

    For your information.

    Normally amounts are saved in table with currency key. This field will be with 2 decimal places.

    But there are currencies which has decimal places more then 3.
    In such cases what SAP do is..

    For example Currency KWD(dec 3).

    Amount 100.123

    Internally save as 1001.23

    While displaying this we must give reference currency.(In field catalog: CFIELDNAME = 'WAERS' )

    Try this..

    Data l_amt(4) P dec 2.

    l_amt = 1001.23.

    Write l_amt currency 'KWD'.

    Output will be 100.123

    Regards

    Sreekanth

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 11:42 AM

    Hi,

    Can you please share your code .

    - Data declarations.

    - Field catalog buildup  code.

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 12:01 PM

    Hi,

       

         Possible Reason may be

         1.Check Your Internal table declaration

         2.Or Sequences in select Query (May use into Corresponding fields)

         3.May require modification in field catalog ,

         But you are saying at the time of data retrieval , So Check for first two cause.

    Regards

    Add comment
    10|10000 characters needed characters exceeded