cancel
Showing results for 
Search instead for 
Did you mean: 

CONVERT_TO_LOCAL_CURRENCY in a routine

Former Member
0 Kudos

Hi,

  

Struggling with this error, I have searchd the forum but couldn't find anything relevant...

Is this a common error?

How to solve it?

In BW 7.3

I am using CONVERT_TO_LOCAL_CURRENCY in a routine where I have as input data

data: fl type AUSP-ATFLV.

data: p type p decimals 5.

fl = SOURCE_FIELDS-EXCHG_RATE. //where fl = 1,1538240000000000E+04

p = fl.

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'      
EXPORTING
            
     DATE                                 = 19.03.2013

     FOREIGN_AMOUNT         = 61,13      
     FOREIGN_CURRENCY    = EUR

     LOCAL_CURRENCY        = THB

     RATE                                 = p       
IMPORTING
                 
     LOCAL_AMOUNT = RESULT

EXCEPTIONS

     no_rate_found        = 1

     overflow                  = 2

     no_factors_found   = 3

     no_spread_found   = 4

     derived_2_times     = 5

    OTHERS                = 6.

Well,
this ends in error because function doesn't handle rate = 12538.24000 or better it doesn't handle any rate with 10 digits or more!

As we know we have in the World so many rates with E+04, E+05, a.s.o

How can we solve this?

 

Should I raise it to SAP?

Thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Paulo,

You are correct, SAP is not able to handle the exceeding data length. In the FM CONVERT_TO_LOCAL_CURRENCY the RATE ( RATE                                 = p   ) is of type UKURS_CURR field which is of 9 length with 5 decimal places. So if your input value exceeds this length FM will fail.

Define your data type P as UKURS_CURR.

i.e. DATA: p TYPE UKURS_CURR.

Then you should be good. However if you take it to SAP guys I doubt they will change it as it is a very generic FM which is used in almost every finance calculation in SAP so changing it will break SAP

Please let me know if there are any questions.

Thanks

Amit

Former Member
0 Kudos

Hi,

Thank you for your help and confirmation that I am not the only one seeing this error 🙂

I tried to convert to that type UKURS_CURR but I got an error on this step:

  data: fl type AUSP-ATFLV.

  data: p5 type UKURS_CURR.

  fl = SOURCE_FIELDS-EXCHG_RATE.

  p5 = fl.

An exception (CX_SY_CONVERSION_OVERFLOW) occurred in p5 when fl = 12345.45632

Any more ideas?

Thank you

As this function is used in so many FI calculations I wonder why there aren't so much "complains" like mine

former_member184494
Active Contributor
0 Kudos

Paulo,

If you execute the FM locally in SE37 and pass the same value - does it return a result ..?

If it does , then check the data types of your variables in the code - see if you can use a float instead of decimal or vice versa to see if that helps...

Former Member
0 Kudos

Hi Arun,

Already tried that and it gives exactly the same error.

Overflow!

The rate parameter doesn't accept 10 digits or higher