<?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/2726304#M632728</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BAPI_COMPANYCODE_GET_PERIOD.&lt;/P&gt;&lt;P&gt;Retrieve fiscal year and period:&lt;/P&gt;&lt;P&gt;The below code shows how to use function modules BAPI_COMPANYCODE_GET_PERIOD and &lt;/P&gt;&lt;P&gt;DETERMINE_PERIOD to retrieve fiscal year and fiscal period for a specific date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*.......................................................................&lt;/P&gt;&lt;P&gt;*: Report: ZFISCALYR :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: Author: :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: Date : 2007 :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: Description: Demonstrates how to return the corresponding fiscal :&lt;/P&gt;&lt;P&gt;*: year and posting period for a company code and posting :&lt;/P&gt;&lt;P&gt;*: date or posting date and fiscal year variant. :&lt;/P&gt;&lt;P&gt;*:.....................................................................:&lt;/P&gt;&lt;P&gt;REPORT zfiscalyr NO STANDARD PAGE HEADING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_bukrs TYPE ekko-bukrs,&lt;/P&gt;&lt;P&gt;p_bedat TYPE ekko-bedat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gd_fiscalyr TYPE bapi0002_4-fiscal_year,&lt;/P&gt;&lt;P&gt;gd_fiscalp TYPE bapi0002_4-fiscal_period.&lt;/P&gt;&lt;P&gt;DATA: gd_fiscalyr2 TYPE T009B-BDATJ,&lt;/P&gt;&lt;P&gt;gd_fiscalp2 TYPE bapi0002_4-fiscal_period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gd_periv TYPE t009-periv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get fiscal year and period - (requires date and company code)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;companycodeid = p_bukrs&lt;/P&gt;&lt;P&gt;posting_date = p_bedat&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;fiscal_year = gd_fiscalyr&lt;/P&gt;&lt;P&gt;fiscal_period = gd_fiscalp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Alternative fiscal year function module&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;- (requires date and fiscal year variant code from T009 table)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;gets first entry in fiscal year variant table (will need to choose&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;correct one from table rather than just using first entry)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT SINGLE periv&lt;/P&gt;&lt;P&gt;FROM t009&lt;/P&gt;&lt;P&gt;INTO gd_periv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get fiscal year and period&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'DETERMINE_PERIOD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;date = p_bedat&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PERIOD_IN = '000'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;version = gd_periv&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;period = gd_fiscalp2&lt;/P&gt;&lt;P&gt;year = gd_fiscalyr2&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;period_in_not_valid = 1&lt;/P&gt;&lt;P&gt;period_not_assigned = 2&lt;/P&gt;&lt;P&gt;version_undefined = 3&lt;/P&gt;&lt;P&gt;OTHERS = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',&lt;/P&gt;&lt;P&gt;/ 'Fiscal year is:', gd_fiscalyr,&lt;/P&gt;&lt;P&gt;/ 'Fiscal period is:', gd_fiscalp.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/ 'From function module: DETERMINE_PERIOD',&lt;/P&gt;&lt;P&gt;/ 'Fiscal year is:', gd_fiscalyr2,&lt;/P&gt;&lt;P&gt;/ 'Fiscal period is:', gd_fiscalp2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward all helpful points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Sep 2007 06:09:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-06T06:09:21Z</dc:date>
    <item>
      <title>Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726303#M632727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gays,&lt;/P&gt;&lt;P&gt;            Can you tell me any function module. In that i could pass fiscal year -2007, and period i.e 01. so it could return the month. for that period of fiscal yea.&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;Mukesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 06:06:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726303#M632727</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T06:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726304#M632728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BAPI_COMPANYCODE_GET_PERIOD.&lt;/P&gt;&lt;P&gt;Retrieve fiscal year and period:&lt;/P&gt;&lt;P&gt;The below code shows how to use function modules BAPI_COMPANYCODE_GET_PERIOD and &lt;/P&gt;&lt;P&gt;DETERMINE_PERIOD to retrieve fiscal year and fiscal period for a specific date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*.......................................................................&lt;/P&gt;&lt;P&gt;*: Report: ZFISCALYR :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: Author: :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: Date : 2007 :&lt;/P&gt;&lt;P&gt;*: :&lt;/P&gt;&lt;P&gt;*: Description: Demonstrates how to return the corresponding fiscal :&lt;/P&gt;&lt;P&gt;*: year and posting period for a company code and posting :&lt;/P&gt;&lt;P&gt;*: date or posting date and fiscal year variant. :&lt;/P&gt;&lt;P&gt;*:.....................................................................:&lt;/P&gt;&lt;P&gt;REPORT zfiscalyr NO STANDARD PAGE HEADING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES: ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_bukrs TYPE ekko-bukrs,&lt;/P&gt;&lt;P&gt;p_bedat TYPE ekko-bedat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gd_fiscalyr TYPE bapi0002_4-fiscal_year,&lt;/P&gt;&lt;P&gt;gd_fiscalp TYPE bapi0002_4-fiscal_period.&lt;/P&gt;&lt;P&gt;DATA: gd_fiscalyr2 TYPE T009B-BDATJ,&lt;/P&gt;&lt;P&gt;gd_fiscalp2 TYPE bapi0002_4-fiscal_period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gd_periv TYPE t009-periv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get fiscal year and period - (requires date and company code)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;companycodeid = p_bukrs&lt;/P&gt;&lt;P&gt;posting_date = p_bedat&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;fiscal_year = gd_fiscalyr&lt;/P&gt;&lt;P&gt;fiscal_period = gd_fiscalp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Alternative fiscal year function module&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;- (requires date and fiscal year variant code from T009 table)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;gets first entry in fiscal year variant table (will need to choose&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;correct one from table rather than just using first entry)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT SINGLE periv&lt;/P&gt;&lt;P&gt;FROM t009&lt;/P&gt;&lt;P&gt;INTO gd_periv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get fiscal year and period&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'DETERMINE_PERIOD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;date = p_bedat&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PERIOD_IN = '000'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;version = gd_periv&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;period = gd_fiscalp2&lt;/P&gt;&lt;P&gt;year = gd_fiscalyr2&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;period_in_not_valid = 1&lt;/P&gt;&lt;P&gt;period_not_assigned = 2&lt;/P&gt;&lt;P&gt;version_undefined = 3&lt;/P&gt;&lt;P&gt;OTHERS = 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',&lt;/P&gt;&lt;P&gt;/ 'Fiscal year is:', gd_fiscalyr,&lt;/P&gt;&lt;P&gt;/ 'Fiscal period is:', gd_fiscalp.&lt;/P&gt;&lt;P&gt;SKIP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/ 'From function module: DETERMINE_PERIOD',&lt;/P&gt;&lt;P&gt;/ 'Fiscal year is:', gd_fiscalyr2,&lt;/P&gt;&lt;P&gt;/ 'Fiscal period is:', gd_fiscalp2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward all helpful points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 06:09:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726304#M632728</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T06:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726305#M632729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mukesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The requirement is not clear.....Could you explain lit bit more,.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose i  am passing fiscal year as 2007 and period as 01 .....which month you  need to  display.&lt;/P&gt;&lt;P&gt;Because every month has period called 01 ,02 etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Best Regards,&lt;/P&gt;&lt;P&gt;Vinoth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 06:13:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726305#M632729</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T06:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726306#M632730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dubey,&lt;/P&gt;&lt;P&gt;Period concept is different for each company,For example some companies defined period 01 means January or some companies define April is period '01'.&lt;/P&gt;&lt;P&gt;based on how many periods and which period is pertaing to month you have to calculate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ameer Baba.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 06:26:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726306#M632730</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T06:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726307#M632731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there is a fiscal year change onword 2009 jan to dec but in previous year fiscal year 2008 .Aug to july. i dont want to heard code value so i need FM so i could pass fiscal year and period and it could return month(july or 07).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 06:47:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726307#M632731</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T06:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726308#M632732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is 12 fiscal  period.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2007 06:50:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/2726308#M632732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-06T06:50:36Z</dc:date>
    </item>
  </channel>
</rss>

