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

Function module for Currency conversion is required.

If a purchase request amount is in one currency, I need to convert to "EUR" currency.

Please let me know the Function module / conversion routine.

If there is any specific FM/routine exists to convert European currencies (like GBP/SEK/DEK/NEK/ swiss fanc) to "EURO", then also please let me know.

Thanks in advance!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Sep 07, 2007 at 02:15 PM

    CONVERT_TO_LOCAL_CURRENCY

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 02:15 PM

    Hi Kpreddy

    if use this FM it should work fine

    CONVERT_TO_LOCAL_CURRENCY

    If need to know what to pass in just let me know and I'll post and example

    Conor.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 02:17 PM

    Hi,

    Here is the example program to convert the currency

    
    DATA: gd_fcurr TYPE tcurr-fcurr,
          gd_tcurr TYPE tcurr-tcurr,
          gd_date  TYPE sy-datum,
          gd_value TYPE i.
    
    gd_fcurr = 'EUR'.
    gd_tcurr = 'GBP'.
    gd_date  = sy-datum.
    gd_value = 10.
    
    PERFORM currency_conversion USING gd_fcurr
                                      gd_tcurr
                                      gd_date
                             CHANGING gd_value.
    
    
    
    * Convert value to Currency value 
    *&---------------------------------------------------------------------*
    *&      Form  currency_conversion
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *      -->P_GD_FCURR  text
    *      -->P_GD_TCURR  text
    *      -->P_GD_DATE   text
    *      <--P_GD_VALUE  text
    *----------------------------------------------------------------------*
    FORM currency_conversion  USING    p_fcurr
                                       p_tcurr
                                       p_date
                              CHANGING p_value.
    
      DATA: t_er        TYPE tcurr-ukurs,
            t_ff        TYPE tcurr-ffact,
            t_lf        TYPE tcurr-tfact,
            t_vfd       TYPE datum,
            ld_erate(12)   TYPE c.
    
      CALL FUNCTION 'READ_EXCHANGE_RATE'
        EXPORTING
    *       CLIENT                  = SY-MANDT
          date                    = p_date
          foreign_currency        = p_fcurr
          local_currency          = p_tcurr
          TYPE_OF_RATE            = 'M'
    *       EXACT_DATE              = ' '
       IMPORTING
          exchange_rate           = t_er
          foreign_factor          = t_ff
          local_factor            = t_lf
          valid_from_date         = t_vfd
    *       DERIVED_RATE_TYPE       =
    *       FIXED_RATE              =
    *       OLDEST_RATE_FROM        =
       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 EQ 0.
        ld_erate = t_er / ( t_ff / t_lf ).
        p_value = p_value * ld_erate.
      ENDIF.
    ENDFORM.                    " currency_conversion
    
    
    

    Regards

    Sudheer

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 02:19 PM

    Hi,

    Try

    CURRENCY_CONVERTING_FACTOR - multiply/divide factor for a currency

    BAPI_CURRENCY_CONV_TO_EXTERNAL - Conversion of Currency Amounts into External Data Format

    <b><REMOVED BY MODERATOR></b>

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 02:20 PM

    Hi

    these are the Fm availavble in sap on currency

    <b>Amount and currency functions</b>

    <b>CURRENCY_AMOUNT_SAP_TO_IDOC</b> - Convert currency to IDOC format

    <b>CONVERT_TO_LOCAL_CURRENCY </b> - Conversion of currency

    <b>HRCM_AMOUNT_TO_STRING_CONVERT</b> - Convert amount to string

    <b>HRCM_STRING_TO_AMOUNT_CONVERT</b> - Convert amount from string

    <b>CLOI_PUT_SIGN_IN_FRONT</b> Move the negative sign from the left hand side of a number, to the right hand side of the number. Note that The result will be left justified (like all

    character fields), not right justifed as numbers normally are.

    <b>CONVERT_TO_FOREIGN_CURRENCY</b> Convert local currency to foreign currency.

    <b>CONVERT_TO_LOCAL_CURRENCY</b> Convert from foreign currency to local currency

    <b><REMOVED BY MODERATOR></b>

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2007 at 02:26 PM

    Hi, You can use the below FM :-

    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

    EXPORTING

    date = gv_firstday1 ====> date to be mentioned

    foreign_amount = 123.00 ====> Give the Amount to which to currency

    foreign_currency = 'GBP' ====>To Currency

    local_currency = 'USD' ====>From Currency

    type_of_rate = 'M' ====> Type of rate (Month begin type)

    IMPORTING

    exchange_rate = cv_lv_ukurs =====> Exchnage rate on the day

    local_amount = cv_vallc1 =====> Amount after calculation amt

    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.

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

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

    ENDIF.

    Thanks,

    Sri.

    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.