01-09-2015 5:09 AM
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
01-09-2015 5: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.
01-09-2015 5:39 AM
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
01-09-2015 6:17 AM
Hi kanishka,
Kindly share the dump screenshot.
Regards
Rajkumar Narasimman
01-09-2015 5: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.
01-09-2015 5:46 AM
Hi Kanishka,
Have you checked in your program about the fixed Arithmetic.Error may be due to this.
With Regards
Arun VS
01-09-2015 6:11 AM
01-09-2015 7: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
01-09-2015 7: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
01-09-2015 7: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
01-09-2015 11:42 AM
Hi,
Can you please share your code .
- Data declarations.
- Field catalog buildup code.
Regards.
01-09-2015 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
01-12-2015 3:51 AM
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
01-12-2015 4:45 AM
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
01-12-2015 5:42 AM
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.
01-12-2015 5:44 AM
Hi,
Have you checked the fixed airthematic check in your program ?
With Regards
Arun VS
01-12-2015 5:46 AM
Hi Kanishka,
Please check the user default settings in SU01 i.e how the decimal places are defined.
Thanks & Regards,
Seshadri.