Howdy,
I'm creating a BDC and I read in the rate from table KONP. However in some cases the rate is ten times the value it should be?
In my example KONP-KBETR has a value of '500.000-' in VK13 but when I look at the table it the field is tored as a value of '5000.00-'?
Does anyone know why this happens and how to retrieve the correct value?
Many Thanks!
SAP stores these values without any decimals and then you have to devide the value by 1000.
For example,
500000 / 1000 = 500.000
Hi Steve
The field KBETR is numeric field with 2 decimal, but the value % are often value with 3 decimals.
So the system can store a value whit 3 decimal in a field with 2 decimal only moltiplying the value for 10.
Infact if you have 10,324 %, so SAP moltiply it for 10, it'll be 103,24 and this value is stored.
A routine input/ouput does thi conversion:
- Input: value * 10;
- Output: value / 10;
This routine depends on the currency field that controls KBETR in structure KONP. This field is RV13A-KONWA, if you check the standard program use field KONP-KBETR in screen you can see they fill RV13A-KONWA with 3.
Max
Steve,
for BDC you need external representation, This is achieved with WRITE KONP-KBETR TO bdcdata-fval.
It will we formatted according to the currency field KONWA: Japanese yen no decimals, USD and EUR 2 decimals, Libya pounds (?) 3 decimals.
Regards,
Clemens
P.S. You can use the CURRENCY addition for WRITE. Don't trust 'divide by something' recommendations. They will fail earlier or later.
Hi,
I think the rate amount in VK13 has 3 decimals. But KONP-KBETR has only 2 decimals. In order to store the data, so 500.000 is tored as 5000.00.
Solution: you may find a function module to transfer... or divide 10 directly...
Regards
Heinz
Hai Steve,
This happens only in the case of percentage i.e. if KONP-KRECH = 'A'(percentage) then KBETR should be divided by 10 when you use the value. Because 15% is stored in the table as 150.00.
The same case occurs in your KONV table also.
You can check that.
Regards
Binoo
NB:Plz award points if the information helped you.
Hi Steve,
Please check this out.
Table TCURX has the no.of decimal places for the currency that has decimals other than 2. So read the number of decimals from this table then take the whole number of KONP-KBETR ( in your case 500000 as ignoring the decimal in the number ) then dIvide it by the number of decimal you read from the table for the currency key KONP-KONWA i guess.
Thanks,
Swetha.
Add a comment