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

exchange rate conversion

hi , iam facing one problem.

CALL FUNCTION 'READ_EXCHANGE_RATE'

EXPORTING

client = sy-mandt

date = sy-datum

foreign_currency = 'GBP'

local_currency = 'USD'

type_of_rate = 'DB'

IMPORTING

exchange_rate = lv_ukurs

EXCEPTIONS

no_rate_found = 1

no_factors_found = 2

no_spread_found = 3

derived_2_times = 4

overflow = 5

zero_rate = 6

OTHERS = 7.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

through this FM i am getting exchange rate(lv_ukurs) as 1.96667

but in mine TCURR table it is 1.6667

WHY IS THE DIFFERENCE

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 03, 2007 at 08:26 AM

    Try running the function module in debug to find out how it's doing the calculation.

    I don't know what rate type "DB" represents, but you may find it involves more in its calculation than entries in TCURR. Check also what entries you have in TCURS and TCURF. In might also be useful to know what entry you have for DB in TCURV.

    matt

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 09:08 AM

    Hai Anurodh,

    Check this ...... may be it helps u if u missed any thing.

    <b>type_rate:</b>Type of rate

    <b>M=Average rate</b>

    <b>G=Bank buying rate</b>

    <b>B=bank selling rate</b>

    We Get Exchange rate for that day, foreign factor, Local factor.

    And Foreign currency can be calculated as below mentioned in IF ENDIF

    DATA: l_er TYPE tcurr-ukurs, &quot;

    <b>l_ff TYPE</b> tcurr-ffact,

    <b>l_lf TYPE</b> tcurr-tfact,

    <b>l_erate</b>(12) TYPE c,

    CALL FUNCTION 'READ_EXCHANGE_RATE'

    EXPORTING

    date = sy-datum

    foreign_currency = wa_bseg-pswsl

    local_currency =<b> c_euro</b>

    type_of_rate =<b> 'M'</b>

    IMPORTING

    exchange_rate =<b> l_er</b>

    foreign_factor =<b> l_ff</b>

    local_factor = <b>l_lf</b>

    EXCEPTIONS

    no_rate_found = 1

    no_factors_found = 2

    no_spread_found = 3

    derived_2_times = 4

    overflow = 5

    OTHERS = 6.

    IF sy-subrc = 0.

    <b>l_erate = l_er / ( l_ff / l_lf ).</b>

    <b>wa_itab-wrbtr = wa_itab-wrbtr * l_erate.</b>

    ENDIF.

    Debug the function module and see where the differnce is comming.

    <b>reward for useful answers</b>

    regards,

    sunil kumar.

    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.