Application Development 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: 

Decimal Place wrong in abap report

Former Member
0 Kudos

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

16 REPLIES 16

rajkumarnarasimman
Active Contributor
0 Kudos

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.

0 Kudos

Thanks for your reply rajkumar ,

  i am using the PR table to retrieve data  ,i have used the ref key it will generate a dump

0 Kudos

Hi kanishka,

Kindly share the dump screenshot.

Regards

Rajkumar Narasimman

rosenberg_eitan
Active Contributor
0 Kudos

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.

venuarun
Active Participant
0 Kudos

Hi Kanishka,

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

With Regards

Arun VS

Former Member
0 Kudos

Hi,

Check your field type and length

cheers

former_member192023
Active Participant
0 Kudos

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

raymond_giuseppi
Active Contributor
0 Kudos

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

former_member202818
Active Contributor
0 Kudos

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

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Can you please share your code .

- Data declarations.

- Field catalog buildup  code.

Regards.

former_member183607
Contributor
0 Kudos

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

Former Member
0 Kudos

Hi All

this is my simple code  ..

data amount like MEREQ3320-GSWRT.

    select sum( RLWRT ) from EBAN

        into amount

        where BANFN = it_PR-BANFN and

        FRGKZ ='Y' and

        LOEKZ <>'X' and

        BANPR <> '08' .

Table values is 2,000,000 but its retrieve as 2,000,0.00 .

Thanks

kanishka

0 Kudos

Hi,

     Please Check Both Data elements are having different Output Length

     MEREQ3320-GSWRT. --- 13.2   output length 16

     EBAN-RLWRT      ---   15.2  & output length 20.

     Both are of different length,

     You may declare your Amount variable same as Rlwrt for your required output.

Regards:

Somendra Shukla

0 Kudos

Hi,

I just notice that there is a possibility that a "Purchase Requisition" can contain multiple currency .

I believe that you need to check this possibility in your site.

Regards.

0 Kudos

Hi,

Have you checked the fixed airthematic check in your program ?

With Regards

Arun VS

Former Member
0 Kudos

Hi Kanishka,

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

Thanks & Regards,

Seshadri.