I load a flatfile into an ODS. Amounts with currencies like JPY and PTE are loaded into the ODS a factor 100 to small. For example the flatfile has an amount in JPY '00000000003445.00' and this shows up in the ODS as 34.45. (it should be 3445.00).
While searching SDN and OSS I found some notes on the <b>display</b> of currencies with more or less than 2 decimals, but a problem during loading seems to be different from that one.
Hi,
Write this code in Start routine of Trtansfer Rule.
************************
if TRAN_STRUCTURE-CURRNECY = 'JPY' or 'PTE'.
TRAN_STRUCTURE-AMOUNT = TRAN_STRUCTURE-AMOUNT * 100.
Endif.
************************
Code can have some error..try to solve it..
Regards,
San!
Away from my system ðŸ˜”
Hi Jans,
I guess your User settings has the Decimal Setting set to ','(comma). Please change your flat file currency value to 3445,00. This should solve your problem.
We can change the decimals to '.' from ',' in the User Settings as well.
Regards,
Praveen.
Dear SDN colleagues,
I found a solution: SAP always loads keyfigures wrong if the valuta has less than 2 decimal places. That is, if you load JPY 2443 then this will appear as JPY 24.43 in an ODS or CUBE. However when you build a query then the figure is automatically corrected for display.
Now, if one wants to calculate with these keyfigures then the calculations will go wrong because no automatic correction will take place. In this case you must correct manually (ABAP) by multipying by a factor to compensate for the decimal notation.
The ABAP to do this correctly is this:
DATA: l_currdec LIKE tcurx-currdec, shift(2) TYPE p, corfac TYPE /bi0/oiamount. "17 with 2 decimals. * Collect number of decimals as quickly as possible. SELECT SINGLE currdec FROM tcurx INTO l_currdec WHERE currkey = COMM_STRUCTURE-currency. IF sy-subrc = 0. shift = 2 - l_currdec. corfac = 10 ** shift. result = COMM_STRUCTURE-my_kf * corfac. ENDIF.
Add a comment