cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with 'JPY' currency loading from flatfile

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

you have to upload the flat file using the currency conversion flag in your InfoPackage. A prerequisit is the unit for each amount in the unit column of your transfer structure and the maintenance of the table TCURX (number of decimals of the different currencys). During the upload the amounts with currency JPY are mulipied by 100.

Cheers!

Tanja

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

former_member188972
Active Contributor
0 Kudos

No you don't have to make abap routine but you must mark the flag

"Currency conversion for External system" on the external data tab.

Regards,

Sergio

Former Member
0 Kudos

This flag IS marked in my situation. Nevertheless, if I want to perform calculations on the data (i.e. in the update rules between 2 ODSes) I must correct for the effect described above.

My dataflow goes from


Flatfile -> ODS -> CUBE1 -> Query1
             ---> CUBE2 -> Query2

Between ODS and CUBE2 is an ABAP that does a (non-standard) currency conversion to EUR. In this ABAP I must correct for the effect otherwise Query2 reports the results a factor 100 to low. In query1 the data in document currency is reported correctly without correction.

former_member188972
Active Contributor
0 Kudos

I suggest to you to call the standard function

CONVERT_TO_LOCAL_CURRENCY

in your transfer/update rule.

It's best then use the sap-variable with different meaning.

regards,

Sergio

Former Member
0 Kudos

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.

Former Member
0 Kudos

If that would be true the problem would also occur with other valuta like USD. The problem that I describe really only occurs with JPY and PTE.

Former Member
0 Kudos

Hi Jans,

Sorry, Didnt read your post completely.

Not sure why, but would it be possible that usually JPY conversion is done in 100 Units.

Regards,

Praveen.