<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic currency conversion in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/1626872#M280019</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friends,&lt;/P&gt;&lt;P&gt;In Lsmw i have a requirement of converting currency format to usersetting format for eg if the input is&lt;/P&gt;&lt;P&gt;1,2345.678 and my system settings is 1.2345,678&lt;/P&gt;&lt;P&gt;the conversion should convert from input format to usersetting format.&lt;/P&gt;&lt;P&gt;there are few subroutines which will do the work but the problem is the value we are getting at  the end is not acceptable&lt;/P&gt;&lt;P&gt;for eg if we give input as 123.67 as input it will give result as 123.6700 it is adding extra zeros at the end&lt;/P&gt;&lt;P&gt;can any one suggest me  a solution.&lt;/P&gt;&lt;P&gt;thanks and regards&lt;/P&gt;&lt;P&gt;srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Oct 2006 14:32:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-06T14:32:04Z</dc:date>
    <item>
      <title>currency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/1626872#M280019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi friends,&lt;/P&gt;&lt;P&gt;In Lsmw i have a requirement of converting currency format to usersetting format for eg if the input is&lt;/P&gt;&lt;P&gt;1,2345.678 and my system settings is 1.2345,678&lt;/P&gt;&lt;P&gt;the conversion should convert from input format to usersetting format.&lt;/P&gt;&lt;P&gt;there are few subroutines which will do the work but the problem is the value we are getting at  the end is not acceptable&lt;/P&gt;&lt;P&gt;for eg if we give input as 123.67 as input it will give result as 123.6700 it is adding extra zeros at the end&lt;/P&gt;&lt;P&gt;can any one suggest me  a solution.&lt;/P&gt;&lt;P&gt;thanks and regards&lt;/P&gt;&lt;P&gt;srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 14:32:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/1626872#M280019</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T14:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: currency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/1626873#M280020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Srini,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the same for converting the decimals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below logic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lwa_usr01    TYPE usr01,&lt;/P&gt;&lt;P&gt;     wa_eanl-zzpressure type zeanl-zzpressure, "(Dec 8, 3)&lt;/P&gt;&lt;P&gt;lws_press    TYPE char10,&lt;/P&gt;&lt;P&gt;        lws_pres_num TYPE char5,&lt;/P&gt;&lt;P&gt;        lws_pres_dec TYPE char7,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Check for User's Decimal notation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  SELECT SINGLE *&lt;/P&gt;&lt;P&gt;                FROM usr01&lt;/P&gt;&lt;P&gt;                INTO lwa_usr01&lt;/P&gt;&lt;P&gt;                WHERE bname EQ sy-uname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Convert Pressure from 0.00 to 0.0000000&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  IF NOT wa_eanl-zzpressure IS INITIAL.&lt;/P&gt;&lt;P&gt;    lws_press = wa_eanl-zzpressure.&lt;/P&gt;&lt;P&gt;    IF lwa_usr01-dcpfm EQ c_x.&lt;/P&gt;&lt;P&gt;    ELSEIF lwa_usr01-dcpfm IS INITIAL.&lt;/P&gt;&lt;P&gt;      TRANSLATE lws_press USING '. '.&lt;/P&gt;&lt;P&gt;      TRANSLATE lws_press USING ',.'.&lt;/P&gt;&lt;P&gt;      CONDENSE lws_press NO-GAPS.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    SPLIT lws_press AT '.' INTO lws_pres_num lws_pres_dec.&lt;/P&gt;&lt;P&gt;    CONDENSE: lws_pres_num, lws_pres_dec.&lt;/P&gt;&lt;P&gt;    CONCATENATE lws_pres_dec '0000' INTO lws_pres_dec.&lt;/P&gt;&lt;P&gt;    CONCATENATE lws_pres_num lws_pres_dec INTO&lt;/P&gt;&lt;P&gt;                             lws_pressure SEPARATED BY '.'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;PRakash.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 14:43:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/1626873#M280020</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T14:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: currency conversion</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/1626874#M280021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;look at the below program:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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 
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  currency_conversion
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;P_GD_FCURR  text
*      --&amp;gt;P_GD_TCURR  text
*      --&amp;gt;P_GD_DATE   text
*      &amp;lt;--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
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 15:10:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/currency-conversion/m-p/1626874#M280021</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T15:10:37Z</dc:date>
    </item>
  </channel>
</rss>

