Skip to Content
author's profile photo Former Member
Former Member

currency conversion - translation rates

Hi,

The amount shall be converted from currency "GBP" to "AUD".

Therefore we have maintained:

- an exchange rate type (which contains "EUR" as the reference currency)

- the translation ratios for the combinations GBP-EUR, EUR-GBP, AUD-EUR, EUR-AUD

- the rates: GBP->EUR, EUR->AUD

Afterwards we used the function module "CONVERT_TO_LOCAL_CURRENCY";

however the result was returncode 3 - meaning "NO_FACTORS_FOUND"

However,if we maintain the translation ratio GBP-AUD,it works.

For me this seems to be not really logic:

The "cross rates" are determined in table tcurr but the "cross ratios" are not.

Is this true or what is/might be the error?

Thanks for your help, Kora

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 12:32 PM

    hi,

    check this thread...

    Cheers

    Alfred

    Reward with points for helpful answers.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 12:37 PM

    hi KORA ,

    just check this code ,,

    hope this gives u some help.

    regards,

    vijay

    -


    data: w_dec1 like tcurx-currdec,

    w_amt like ekpo-netwr,

    w_rate like tcurr-ukurs,

    w_fact1 like tcurr-ffact,

    w_fact2 like tcurr-ffact.

    parameters:

    p_curr1 like tcurc-waers default 'JPY',

    p_amt1 like ekpo-netwr default '7895',

    p_curr2 like tcurc-waers default 'SGD',

    pdate like sy-datum default '20061011'.

    end-of-selection.

    write:

    / 'Entered:',

    / ' from currency:', p_amt1 currency p_curr1, p_curr1, '<-', p_amt1,

    / ' to currency :', p_curr2,

    / ' on :', pdate.

    CALL FUNCTION 'FWOS_CURRENCY_DECIMALS_READ'

    EXPORTING

    I_CURRENCY = p_curr1

    IMPORTING

    E_DECIMALS = w_dec1

    EXCEPTIONS

    I_CURRENCY_INITIAL = 1

    OTHERS = 2.

    IF SY-SUBRC <> 0.

    w_dec1 = 2.

    ENDIF.

    p_amt1 = p_amt1 * 10 ** ( w_dec1 - 2 ).

    write:

    / 'after adjusting using currency decimals:',

    / ' from currency', p_amt1 currency p_curr1, p_curr1,

    '<-', p_amt1, '(', w_dec1, ')'.

    CALL FUNCTION 'CONVERT_TO_FOREIGN_CURRENCY'

    EXPORTING

    • CLIENT = SY-MANDT

    DATE = pdate

    FOREIGN_CURRENCY = p_curr2

    LOCAL_AMOUNT = p_amt1

    LOCAL_CURRENCY = p_curr1

    • RATE = 0

    • TYPE_OF_RATE = 'M'

    • READ_TCURR = 'X'

    IMPORTING

    EXCHANGE_RATE = w_rate

    FOREIGN_AMOUNT = w_amt

    FOREIGN_FACTOR = w_fact1

    LOCAL_FACTOR = w_fact2

    • EXCHANGE_RATEX =

    • DERIVED_RATE_TYPE =

    • FIXED_RATE =

    EXCEPTIONS

    NO_RATE_FOUND = 1

    OVERFLOW = 2

    NO_FACTORS_FOUND = 3

    NO_SPREAD_FOUND = 4

    DERIVED_2_TIMES = 5

    OTHERS = 6.

    IF SY-SUBRC <> 0.

    write: / 'Conversion to for.curr. failed:',

    p_curr1, '->', p_curr2, 'err.code=', sy-subrc.

    ELSE.

    write: / 'to For.curr:', p_amt1 currency p_curr1, p_curr1, '->',

    w_amt currency p_curr2, p_curr2,

    '(', w_rate, ')', w_fact1, w_fact2.

    ENDIF.

    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

    EXPORTING

    • CLIENT = SY-MANDT

    DATE = pdate

    FOREIGN_AMOUNT = p_amt1

    FOREIGN_CURRENCY = p_curr1

    LOCAL_CURRENCY = p_curr2

    • RATE = 0

    • TYPE_OF_RATE = 'M'

    • READ_TCURR = 'X'

    IMPORTING

    EXCHANGE_RATE = w_rate

    FOREIGN_FACTOR = w_fact1

    LOCAL_AMOUNT = w_amt

    LOCAL_FACTOR = w_fact2

    • EXCHANGE_RATEX =

    • FIXED_RATE =

    • DERIVED_RATE_TYPE =

    EXCEPTIONS

    NO_RATE_FOUND = 1

    OVERFLOW = 2

    NO_FACTORS_FOUND = 3

    NO_SPREAD_FOUND = 4

    DERIVED_2_TIMES = 5

    OTHERS = 6.

    IF SY-SUBRC <> 0.

    write: / 'Conversion to loc.curr. failed:',

    p_curr1, '->', p_curr2, 'err.code=', sy-subrc.

    ELSE.

    write: / 'to Loc.curr:', p_amt1 currency p_curr1, p_curr1, '->',

    w_amt currency p_curr2, p_curr2,

    '(', w_rate, ')', w_fact1, w_fact2.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 01:38 PM

    Hi,

    check table t006

    Regards

    amole

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 24, 2006 at 07:03 PM

    Hello,

    Thank you for your input so far -

    probably I have not expressed myself clearly enough.

    The decisive point is that using e.g the function module

    'CONVERT_TO_LOCAL_CURRENCY' the system can/does provide 'automatically' cross-rates for the table tcurr (rates) however not for table tcurf (factors).

    This has the consequence: if you would like translate e.g. GBP to AUD by using EUR as a reference currency the following entries are necessary:

    table tcurr: GBP -> EUR xxx

    EUR -> AUD xxx

    table tcurf: GBP -> AUD xxx

    As the reference currencies are (seemingly) not used in table tcurf for all possible combinations of currencies entries would have to be maintained.

    e.g. 120 currencies

    table tcurr: Curr X to EUR (120 entries)

    EUR to Curr X (120 entries)

    = 240 entries

    table tcurf: Curr X to Curr Y (120 * 119 entries)

    = 14280 entries

    Kind regards, Kora

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.