<?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: Issue with Function Module... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-function-module/m-p/1701190#M307397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Badrinath,&lt;/P&gt;&lt;P&gt;Welcome to SDN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i guess right then you are asking the question that whether to include the new functionality in existing function module or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can edit the same function module. &lt;/P&gt;&lt;P&gt;but prefrably u can create a new function module.&lt;/P&gt;&lt;P&gt;you have all the details with you u need to check the condition of  I_ICR in calling program and then call the new FM or the old one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;creating new function module will also keep the modularisation and clean code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Nov 2006 13:33:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-21T13:33:25Z</dc:date>
    <item>
      <title>Issue with Function Module...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-function-module/m-p/1701189#M307396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Frnzs,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my issue..Plz go thru it..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a function module (YFSF_ICR_GET_EXCHG_RATE_ODS).&lt;/P&gt;&lt;P&gt;the function performs the current logic without any changes,&lt;/P&gt;&lt;P&gt;that is reading SPOT rates for actuals (the planning cycle is empty) or S rates&lt;/P&gt;&lt;P&gt;for forecasts based on the planning cycle. Nothing needs to be changed here &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concultion : Based on flag I_ICR ni , we have to read new exchange rates ( From ODS)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the fucntion module code is here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION yfsf_icr_get_exchg_rate_ods.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;*" IMPORTING&lt;/P&gt;&lt;P&gt;*" REFERENCE(I_PLANCYC) TYPE /BIC/OIYPLANCYC OPTIONAL&lt;/P&gt;&lt;P&gt;*" REFERENCE(I_SALESORG) TYPE /BI0/OISALESORG OPTIONAL&lt;/P&gt;&lt;P&gt;*" REFERENCE(I_IC) TYPE /BIC/OIYINVCURR&lt;/P&gt;&lt;P&gt;*" REFERENCE(I_RC) TYPE /BIC/OIYREPCURR&lt;/P&gt;&lt;P&gt;*" REFERENCE(I_FISCPER) TYPE /BI0/OIFISCPER&lt;/P&gt;&lt;P&gt;*" EXPORTING&lt;/P&gt;&lt;P&gt;*" REFERENCE(E_EXG) TYPE /BI0/OIEXCHG_RATE&lt;/P&gt;&lt;P&gt;*" EXCEPTIONS&lt;/P&gt;&lt;P&gt;*" NO_RATE_FOUND&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;DATA: l_s_exg TYPE /bic/ayfsfexg00,&lt;/P&gt;&lt;P&gt;l_t_exg TYPE /bic/ayfsfexg00 OCCURS 0,&lt;/P&gt;&lt;P&gt;l_year TYPE /bi0/oifiscyear.&lt;/P&gt;&lt;P&gt;IF i_plancyc IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Actuals&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;FREE l_t_exg.&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE l_t_exg&lt;/P&gt;&lt;P&gt;FROM /bic/ayfsfexg00&lt;/P&gt;&lt;P&gt;WHERE fiscper &amp;lt;= i_fiscper&lt;/P&gt;&lt;P&gt;AND fiscvarnt = 'JJ'&lt;/P&gt;&lt;P&gt;AND /bic/yrepcurr = i_rc&lt;/P&gt;&lt;P&gt;AND /bic/yinvcurr = i_ic&lt;/P&gt;&lt;P&gt;AND /bic/yplancyc = ''&lt;/P&gt;&lt;P&gt;AND /bic/yexchtype = 'SPOT'&lt;/P&gt;&lt;P&gt;ORDER BY fiscper DESCENDING.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;RAISE no_rate_found.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;READ TABLE l_t_exg INTO l_s_exg INDEX 1.&lt;/P&gt;&lt;P&gt;e_exg = l_s_exg-exchg_rate.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Forecasts&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;l_year = i_fiscper+0(4).&lt;/P&gt;&lt;P&gt;SELECT SINGLE *&lt;/P&gt;&lt;P&gt;INTO l_s_exg&lt;/P&gt;&lt;P&gt;FROM /bic/ayfsfexg00&lt;/P&gt;&lt;P&gt;WHERE fiscvarnt = 'JJ'&lt;/P&gt;&lt;P&gt;AND fiscyear = l_year&lt;/P&gt;&lt;P&gt;AND salesorg = i_salesorg&lt;/P&gt;&lt;P&gt;AND /bic/yrepcurr = i_rc&lt;/P&gt;&lt;P&gt;AND /bic/yinvcurr = i_ic&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AND /bic/yplancyc = i_plancyc&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;AND /bic/yplancyc = ''&lt;/P&gt;&lt;P&gt;AND /bic/yexchtype = 'S'&lt;/P&gt;&lt;P&gt;AND exchg_rate GE '0.0000001'.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;RAISE no_rate_found.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;e_exg = l_s_exg-exchg_rate.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDFUNCTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok &lt;/P&gt;&lt;P&gt;now my requirement is that I need to enhance the Function module for reading exchange rates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for this i got the following information:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- It requires an additional flag I_ICR for instance that can be empty or 'X'&lt;/P&gt;&lt;P&gt;for instance &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- If the flag is empty, the function performs the current logic without any changes,&lt;/P&gt;&lt;P&gt;that is reading SPOT rates for actuals (the planning cycle is empty) or S rates&lt;/P&gt;&lt;P&gt;for forecasts based on the planning cycle. Nothing needs to be changed here &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- If the flag is 'X', the function reads a new exchange rate type, let's call&lt;/P&gt;&lt;P&gt;it "ICR". As stated in the requirements and functional specs, these exchange rates&lt;/P&gt;&lt;P&gt;are the Reuter rates valid for a complete year. These are fixed rates so no planning&lt;/P&gt;&lt;P&gt;cycle. The users will enter records in the format (year, reporting currency, invoicing&lt;/P&gt;&lt;P&gt;currency, exchange rate). If the input flag I_ICR is X, the function determines&lt;/P&gt;&lt;P&gt;the year based on the input period, then, based on the year it selects on the same&lt;/P&gt;&lt;P&gt;table as for the other exchange rates with a restriction on exchange rate type "ICR",&lt;/P&gt;&lt;P&gt;year, from and to currency and return the exchange rate &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Update rules. There are two: &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- To the consolidation ODS. No changes are required there; the function has to&lt;/P&gt;&lt;P&gt;read either S or SPOT rates (I_ICR flag is empty) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- From the consolidation ODS to the cube. As stated in my previous email, the&lt;/P&gt;&lt;P&gt;from currency is the one available in the data package. The to currency is determined by reading the sales organization master data (reporting currency attribute) based on the inter-company sales organization (also available in the incoming record). It then calls the function module above with the parameter I_ICR set to 'X' so it reads the Reuter rates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess i need to create another function module and can be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Observation&lt;/P&gt;&lt;P&gt;ODS table fields.&lt;/P&gt;&lt;P&gt;- &lt;/P&gt;&lt;P&gt;- FISCPER &lt;/P&gt;&lt;P&gt;- FISCVARNT JJ &lt;/P&gt;&lt;P&gt;- FISCYEAR 2006&lt;/P&gt;&lt;P&gt;- /BIC/YREPCURR EUR &lt;/P&gt;&lt;P&gt;- /BIC/YINVCURR JPY &lt;/P&gt;&lt;P&gt;- SALESORG 0010&lt;/P&gt;&lt;P&gt;- /BIC/YMRC 3090&lt;/P&gt;&lt;P&gt;- /BIC/YPLANCYC &lt;/P&gt;&lt;P&gt;- /BIC/YEXCHTYPE S &lt;/P&gt;&lt;P&gt;- - RECORDMODE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 13:22:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-function-module/m-p/1701189#M307396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T13:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Function Module...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-function-module/m-p/1701190#M307397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Badrinath,&lt;/P&gt;&lt;P&gt;Welcome to SDN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i guess right then you are asking the question that whether to include the new functionality in existing function module or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can edit the same function module. &lt;/P&gt;&lt;P&gt;but prefrably u can create a new function module.&lt;/P&gt;&lt;P&gt;you have all the details with you u need to check the condition of  I_ICR in calling program and then call the new FM or the old one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;creating new function module will also keep the modularisation and clean code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 13:33:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-function-module/m-p/1701190#M307397</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T13:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with Function Module...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-function-module/m-p/1701191#M307398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;instead of new FM...create a import parameter as flag. pass value to this flag.&lt;/P&gt;&lt;P&gt;when space...leave it and it executes...when 'X' copy the same code and also add ur code according to the requirement and use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 13:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-function-module/m-p/1701191#M307398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T13:44:25Z</dc:date>
    </item>
  </channel>
</rss>

