<?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: Simple logic for the code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-logic-for-the-code/m-p/2190437#M466936</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;using MACRO's concept you can reduce the no. of lines in the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2007 09:56:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-04T09:56:07Z</dc:date>
    <item>
      <title>Simple logic for the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-logic-for-the-code/m-p/2190436#M466935</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;&lt;/P&gt;&lt;P&gt;      Please expalin the logic behind the code and how can we put it simpler this logic by reducing the number of lines of the following logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM fisical_period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data : l_start_month like v_start_month,&lt;/P&gt;&lt;P&gt;         l_end_month like v_end_month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: l_current_year like t009b-bdatj,&lt;/P&gt;&lt;P&gt;            l_variant like t009-periv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      call function 'CCODE_GET_FISCAL_YEAR_VARIANT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          company_code           = p_bukrs&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          fiscal_year_variant    = l_variant&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;          company_code_not_found = 1&lt;/P&gt;&lt;P&gt;          others                 = 2.&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        message i368(00) with 'Unable to get Fiscal year'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      l_current_year = sy-datum(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;      call function 'FIRST_AND_LAST_DAY_IN_YEAR_GET'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          i_gjahr        = l_current_year&lt;/P&gt;&lt;P&gt;          i_periv        = l_variant&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          e_first_day    = p_fiscal-low&lt;/P&gt;&lt;P&gt;          e_last_day     = p_fiscal-high&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;          input_false    = 1&lt;/P&gt;&lt;P&gt;          t009_notfound  = 2&lt;/P&gt;&lt;P&gt;          t009b_notfound = 3&lt;/P&gt;&lt;P&gt;          others         = 4.&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        message i368(00) with 'Unable to get the first and last day'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if sy-datum &amp;lt; p_fiscal-low.&lt;/P&gt;&lt;P&gt;        p_fiscal-low = p_fiscal-low - 365.&lt;/P&gt;&lt;P&gt;        p_fiscal-high = p_fiscal-high - 365.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      append p_fiscal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      v_start_month = p_fiscal-low+4(2).&lt;/P&gt;&lt;P&gt;      v_end_month   = p_fiscal-high+4(2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      if v_start_month &amp;gt;= 01 and v_start_month &amp;lt;= 03.&lt;/P&gt;&lt;P&gt;        move 01 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 02 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 03 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 04 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 05 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 06 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 07 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 08 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 09 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 10 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;        move 11 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;        move 12 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      elseif v_start_month &amp;gt;= 04 and v_start_month &amp;lt;= 06.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        move 04 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 05 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 06 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 07 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 08 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 09 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 10 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 11 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 12 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 01 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;        move 02 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;        move 03 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      elseif v_start_month &amp;gt;= 07 and v_start_month &amp;lt;= 09.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        move 07 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 08 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 09 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 10 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 11 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 12 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 01 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 02 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 03 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 04 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;        move 05 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;        move 06 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        move 10 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 11 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 12 to fiscal_quarter_1-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_1.&lt;/P&gt;&lt;P&gt;        move 01 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 02 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 03 to fiscal_quarter_2-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_2.&lt;/P&gt;&lt;P&gt;        move 04 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 05 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 06 to fiscal_quarter_3-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_3.&lt;/P&gt;&lt;P&gt;        move 07 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;        move 08 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;        move 09 to fiscal_quarter_4-month.&lt;/P&gt;&lt;P&gt;        append fiscal_quarter_4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF NOT p_fiscal IS INITIAL.&lt;/P&gt;&lt;P&gt;        perform get_fiscal_year.&lt;/P&gt;&lt;P&gt;      ENDIF.                                                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF NOT p_fiscal IS INITIAL.                           &lt;/P&gt;&lt;P&gt;        v_start_year = p_fiscal-low+2(2).&lt;/P&gt;&lt;P&gt;        v_end_year = p_fiscal-high+2(2).&lt;/P&gt;&lt;P&gt;        v_start_year = r_gfiscal-low+2(2).&lt;/P&gt;&lt;P&gt;        v_end_year = r_gfiscal-high+2(2).&lt;/P&gt;&lt;P&gt;        v_start_month = r_gfiscal-low+4(2).&lt;/P&gt;&lt;P&gt;        v_end_month = r_gfiscal-high+4(2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        move 'Jan' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Feb' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Mar' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Apr' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'May' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Jun' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Jul' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Aug' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Sep' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Oct' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Nov' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;        move 'Dec' to i_months-month.&lt;/P&gt;&lt;P&gt;        append i_months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if v_end_month &amp;lt; v_start_month.&lt;/P&gt;&lt;P&gt;          v_find_month = 13 - v_start_month.&lt;/P&gt;&lt;P&gt;          do v_find_month times.&lt;/P&gt;&lt;P&gt;            read table i_months index v_start_month.&lt;/P&gt;&lt;P&gt;            move v_start_month to fiscal_months-month.&lt;/P&gt;&lt;P&gt;            move i_months-month to fiscal_months-literal.&lt;/P&gt;&lt;P&gt;            move v_start_year to fiscal_months-year.&lt;/P&gt;&lt;P&gt;            append fiscal_months.&lt;/P&gt;&lt;P&gt;            add 1 to: v_number_of_months, v_start_month.&lt;/P&gt;&lt;P&gt;          enddo.&lt;/P&gt;&lt;P&gt;          do v_end_month times.&lt;/P&gt;&lt;P&gt;            read table i_months index sy-index.&lt;/P&gt;&lt;P&gt;            move sy-index to fiscal_months-month.&lt;/P&gt;&lt;P&gt;            move i_months-month to fiscal_months-literal.&lt;/P&gt;&lt;P&gt;            move v_end_year to fiscal_months-year.&lt;/P&gt;&lt;P&gt;            append fiscal_months.&lt;/P&gt;&lt;P&gt;            add 1 to v_number_of_months.&lt;/P&gt;&lt;P&gt;          enddo.&lt;/P&gt;&lt;P&gt;        else.&lt;/P&gt;&lt;P&gt;          v_find_month = v_end_month - v_start_month + 1.&lt;/P&gt;&lt;P&gt;          do v_find_month times.&lt;/P&gt;&lt;P&gt;            read table i_months index v_start_month.&lt;/P&gt;&lt;P&gt;            move v_start_month to fiscal_months-month.&lt;/P&gt;&lt;P&gt;            move i_months-month to fiscal_months-literal.&lt;/P&gt;&lt;P&gt;            move v_start_year to fiscal_months-year.&lt;/P&gt;&lt;P&gt;            append fiscal_months.&lt;/P&gt;&lt;P&gt;            add 1 to: v_number_of_months, v_start_month.&lt;/P&gt;&lt;P&gt;          enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      ENDIF.                                                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&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;&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;&lt;/P&gt;&lt;P&gt;form get_fiscal_year.&lt;/P&gt;&lt;P&gt;      data : l_lst_day like sy-datum,&lt;/P&gt;&lt;P&gt;             l_frst_day like sy-datum,&lt;/P&gt;&lt;P&gt;             l_fisc_vnt like t009-periv, "fiscal year variant&lt;/P&gt;&lt;P&gt;             l_fisc_prd like t009b-poper,&lt;/P&gt;&lt;P&gt;             l_fisc_yr like t009b-bdatj,&lt;/P&gt;&lt;P&gt;             l_lines like sy-index.&lt;/P&gt;&lt;P&gt;      data : i_periods like table of periods with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      perform get_fiscal_year_variant using p_bukrs&lt;/P&gt;&lt;P&gt;                                   changing l_fisc_vnt.&lt;/P&gt;&lt;P&gt;      perform get_period_on_date using p_fiscal-low&lt;/P&gt;&lt;P&gt;                                       l_fisc_vnt&lt;/P&gt;&lt;P&gt;                              changing l_fisc_prd&lt;/P&gt;&lt;P&gt;                                       l_fisc_yr.&lt;/P&gt;&lt;P&gt;      call function 'G_PERIODS_OF_YEAR_GET'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          variant             = l_fisc_vnt&lt;/P&gt;&lt;P&gt;          year                = l_fisc_yr&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          last_normal_period  = l_fisc_prd&lt;/P&gt;&lt;P&gt;        TABLES&lt;/P&gt;&lt;P&gt;          i_periods           = i_periods&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;          variant_not_defined = 1&lt;/P&gt;&lt;P&gt;          year_not_defined    = 2&lt;/P&gt;&lt;P&gt;          others              = 3.&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        message i368(00) with 'Unable to Convert Periods'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;      describe table i_periods lines l_lines.&lt;/P&gt;&lt;P&gt;      read table i_periods index 1.&lt;/P&gt;&lt;P&gt;      move i_periods-datab to r_gfiscal-low.&lt;/P&gt;&lt;P&gt;      read table i_periods index l_lines.&lt;/P&gt;&lt;P&gt;      move : i_periods-datbi to r_gfiscal-high,&lt;/P&gt;&lt;P&gt;             'I' to r_gfiscal-sign,&lt;/P&gt;&lt;P&gt;             'BT' to r_gfiscal-option.&lt;/P&gt;&lt;P&gt;      append r_gfiscal.&lt;/P&gt;&lt;P&gt;    endform.                    " get_fiscal_year&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form get_fiscal_year_variant using    p_p_ccode like t001-bukrs&lt;/P&gt;&lt;P&gt;                                 changing p_g_fisc_vnt like t009-periv.&lt;/P&gt;&lt;P&gt;      call function 'CCODE_GET_FISCAL_YEAR_VARIANT'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          company_code           = p_p_ccode&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          fiscal_year_variant    = p_g_fisc_vnt&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;          company_code_not_found = 1&lt;/P&gt;&lt;P&gt;          others                 = 2.&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        message i368(00) with 'Unable to retrieve fiscal year variant'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endform.                    " get_fiscal_year_variant&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;form get_period_on_date using    p_p_dcfp like sy-datum&lt;/P&gt;&lt;P&gt;                                     p_g_fisc_vnt like t009-periv&lt;/P&gt;&lt;P&gt;                         changing    p_g_fisc_prd like t009b-poper&lt;/P&gt;&lt;P&gt;                                     p_g_fisc_yr like t009b-bdatj.&lt;/P&gt;&lt;P&gt;      call function 'DATE_TO_PERIOD_CONVERT'&lt;/P&gt;&lt;P&gt;        exporting&lt;/P&gt;&lt;P&gt;          i_date               = p_p_dcfp&lt;/P&gt;&lt;P&gt;          i_periv              = p_g_fisc_vnt&lt;/P&gt;&lt;P&gt;       importing&lt;/P&gt;&lt;P&gt;         e_buper              =  p_g_fisc_prd&lt;/P&gt;&lt;P&gt;         e_gjahr              =  p_g_fisc_yr&lt;/P&gt;&lt;P&gt;       exceptions&lt;/P&gt;&lt;P&gt;         input_false          = 1&lt;/P&gt;&lt;P&gt;         t009_notfound        = 2&lt;/P&gt;&lt;P&gt;         t009b_notfound       = 3&lt;/P&gt;&lt;P&gt;         others               = 4&lt;/P&gt;&lt;P&gt;                .&lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        message i368(00) with 'Unable to get period on date'.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    endform.                    " get_period_on_date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 09:49:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-logic-for-the-code/m-p/2190436#M466935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T09:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Simple logic for the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-logic-for-the-code/m-p/2190437#M466936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;using MACRO's concept you can reduce the no. of lines in the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 09:56:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-logic-for-the-code/m-p/2190437#M466936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T09:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Simple logic for the code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-logic-for-the-code/m-p/2190438#M466937</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;Try to use FMs :  (type &lt;STRONG&gt;quarter&lt;/STRONG&gt; in fm name field and press f4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FMs like follows will be dispalyed :&lt;/P&gt;&lt;P&gt;                                           &lt;/P&gt;&lt;P&gt;BKK_GET_QUARTER_DATE&lt;/P&gt;&lt;P&gt;HR99S00_TIME             Generic time related functions                            &lt;/P&gt;&lt;P&gt;HR_99S_GET_DATES_QUARTER   Get begin and end date of a qrtr                       &lt;/P&gt;&lt;P&gt;HR_99S_GET_QUARTER             Get quarter                                                                                &lt;/P&gt;&lt;P&gt;HRPAYBE_DMFA                   Function pool for DMFA                                    &lt;/P&gt;&lt;P&gt;HR_BE_DAQ_CONDT_QUARTER        Condition for declaring the Local Unit ID for DMFA        &lt;/P&gt;&lt;P&gt;HR_BE_DAQ_QUARTER              Get occupation line relevant data for DMFA                                                                                &lt;/P&gt;&lt;P&gt;HRPAYBE_DMFA_WORKFLOW          Workflow DMFA                                             &lt;/P&gt;&lt;P&gt;HR_BE_DMFA_GET_QUARTER         Retrieve quarter declared                                                                                &lt;/P&gt;&lt;P&gt;KRGE                                                                                &lt;/P&gt;&lt;P&gt;KR_GET_HEADQUARTER_BPLACE                                                                                &lt;/P&gt;&lt;P&gt;SLIM_DATE_TOOLS                                                                          &lt;/P&gt;&lt;P&gt;SLIM_GET_QUARTERLY_PERIODS                                                                                &lt;/P&gt;&lt;P&gt;STS2                           Time stream: Generate for periods                         &lt;/P&gt;&lt;P&gt;TSTR_PERIODS_QUARTERS          Generate Time Stream for Quarters&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 10:05:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-logic-for-the-code/m-p/2190438#M466937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T10:05:07Z</dc:date>
    </item>
  </channel>
</rss>

