<?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 Re: function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/4389436#M1043845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check in table TCURR may field UKURS is not populated..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also u can execute this sample code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZEXAMPLE.

DATA: XRATE  TYPE F,

      LAMT   TYPE P,

      FFACT  TYPE F,

      LFACT  TYPE F.

PARAMETERS: FCURR  LIKE TCURC-WAERS,

            LCURR  LIKE TCURC-WAERS,

            FAMT   TYPE P.

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

     EXPORTING

          DATE             = SY-DATUM

          FOREIGN_AMOUNT   = FAMT

          FOREIGN_CURRENCY = FCURR

          LOCAL_CURRENCY   = LCURR

     IMPORTING

          EXCHANGE_RATE    = XRATE

          FOREIGN_FACTOR   = FFACT

          LOCAL_AMOUNT     = LAMT

          LOCAL_FACTOR     = LFACT

     EXCEPTIONS

          NO_RATE_FOUND    = 1

          OVERFLOW         = 2

          NO_FACTORS_FOUND = 3

          NO_SPREAD_FOUND  = 4

          DERIVED_2_TIMES  = 5

          OTHERS           = 6.

IF SY-SUBRC EQ 0.

  WRITE:/ FAMT, 'CONVERTED FROM', FCURR, 'TO', LCURR, 'IS:', LAMT.

  WRITE:/ 'EXCHANGE RATE:', XRATE,

        / 'FOREIGN FACTOR:', FFACT,

        / 'LOCAL FACTOR:', LFACT.

ELSE.

  WRITE:/ FAMT, 'NOT CONVERTED'.

ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Aug 2008 15:32:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-21T15:32:06Z</dc:date>
    <item>
      <title>function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/4389435#M1043844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;i want to convert the currency from us $ to inr.&lt;/P&gt;&lt;P&gt;for that i am using a function module CONVERT_TO_LOCAL_CURRENCY.&lt;/P&gt;&lt;P&gt;but it is giving me an error that rate is not defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nilabichi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 15:18:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/4389435#M1043844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-21T15:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/4389436#M1043845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check in table TCURR may field UKURS is not populated..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also u can execute this sample code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT ZEXAMPLE.

DATA: XRATE  TYPE F,

      LAMT   TYPE P,

      FFACT  TYPE F,

      LFACT  TYPE F.

PARAMETERS: FCURR  LIKE TCURC-WAERS,

            LCURR  LIKE TCURC-WAERS,

            FAMT   TYPE P.

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

     EXPORTING

          DATE             = SY-DATUM

          FOREIGN_AMOUNT   = FAMT

          FOREIGN_CURRENCY = FCURR

          LOCAL_CURRENCY   = LCURR

     IMPORTING

          EXCHANGE_RATE    = XRATE

          FOREIGN_FACTOR   = FFACT

          LOCAL_AMOUNT     = LAMT

          LOCAL_FACTOR     = LFACT

     EXCEPTIONS

          NO_RATE_FOUND    = 1

          OVERFLOW         = 2

          NO_FACTORS_FOUND = 3

          NO_SPREAD_FOUND  = 4

          DERIVED_2_TIMES  = 5

          OTHERS           = 6.

IF SY-SUBRC EQ 0.

  WRITE:/ FAMT, 'CONVERTED FROM', FCURR, 'TO', LCURR, 'IS:', LAMT.

  WRITE:/ 'EXCHANGE RATE:', XRATE,

        / 'FOREIGN FACTOR:', FFACT,

        / 'LOCAL FACTOR:', LFACT.

ELSE.

  WRITE:/ FAMT, 'NOT CONVERTED'.

ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Aug 2008 15:32:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/4389436#M1043845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-21T15:32:06Z</dc:date>
    </item>
  </channel>
</rss>

