<?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 Posting period function in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-period-function/m-p/3465919#M833006</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;anyone knows functions to find out posting periods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exporting - sy-datum and v3 will get current posting periods (01 apr 2007 to 30 mar 2008)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards&lt;/P&gt;&lt;P&gt;Jijo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Feb 2008 13:14:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-26T13:14:36Z</dc:date>
    <item>
      <title>Posting period function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-period-function/m-p/3465919#M833006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;anyone knows functions to find out posting periods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exporting - sy-datum and v3 will get current posting periods (01 apr 2007 to 30 mar 2008)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks and regards&lt;/P&gt;&lt;P&gt;Jijo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2008 13:14:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-period-function/m-p/3465919#M833006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-26T13:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Posting period function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-period-function/m-p/3465920#M833007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check....&lt;/P&gt;&lt;P&gt;DETERMINE_PERIOD&lt;/P&gt;&lt;P&gt;G_PERIOD_ALLOWED_CHECK&lt;/P&gt;&lt;P&gt;PROGNOSEPERIODEN_ERMITTELN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2008 13:25:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-period-function/m-p/3465920#M833007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-26T13:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Posting period function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/posting-period-function/m-p/3465921#M833008</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;Please refer to the code below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


REPORT  zfiscalyr NO STANDARD PAGE HEADING.

TABLES: ekko.

PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                p_bedat TYPE ekko-bedat.

DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
      gd_fiscalp   TYPE bapi0002_4-fiscal_period.
DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
      gd_fiscalp2  TYPE bapi0002_4-fiscal_period.

DATA: gd_periv     TYPE t009-periv.

************************************************************************
*START-OF-SELECTION.
START-OF-SELECTION.

* get fiscal year and period - (requires date and company code)
  CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
    EXPORTING
      companycodeid = p_bukrs
      posting_date  = p_bedat
    IMPORTING
      fiscal_year   = gd_fiscalyr
      fiscal_period = gd_fiscalp.



* Alternative fiscal year function module
* - (requires date and fiscal year variant code from T009 table)
*--------------------------------------------------------------------

* gets first entry in fiscal year variant table (will need to choose
* correct one from table rather than just using first entry)
  SELECT SINGLE periv
    FROM t009
    INTO gd_periv.

* get fiscal year and period
  CALL FUNCTION 'DETERMINE_PERIOD'
    EXPORTING
      date                      = p_bedat
*    PERIOD_IN                 = '000'
      version                   = gd_periv
   IMPORTING
      period                    = gd_fiscalp2
      year                      = gd_fiscalyr2
   EXCEPTIONS
      period_in_not_valid       = 1
      period_not_assigned       = 2
      version_undefined         = 3
      OTHERS                    = 4.


************************************************************************
*END-OF-SELECTION.
END-OF-SELECTION.
  WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
        / 'Fiscal year is:', gd_fiscalyr,
        / 'Fiscal period is:', gd_fiscalp.
  SKIP.

  WRITE:/ 'From function module: DETERMINE_PERIOD',
        / 'Fiscal year is:', gd_fiscalyr2,
        / 'Fiscal period is:', gd_fiscalp2.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Feb 2008 13:26:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/posting-period-function/m-p/3465921#M833008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-26T13:26:21Z</dc:date>
    </item>
  </channel>
</rss>

