Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

G_POSTING_DATE_OF_PERIOD_GET utility

Former Member
0 Kudos

Does anyone know the function of G_POSTING_DATE_OF_PERIOD_GET

Also can someone tell me if there is a function that captures the year and it returns me the first and last day of the fiscal year

TIA

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use : FIRST_AND_LAST_DAY_IN_YEAR_GET

to retrive first and last day of the year

4 REPLIES 4

Former Member
0 Kudos

Hi,

Use : FIRST_AND_LAST_DAY_IN_YEAR_GET

to retrive first and last day of the year

0 Kudos

Here is a sample for your second question. Again, you need your fiscal year variant code.



report zrich_0001 .


parameters: p_period type t009b-poper,
            p_year type t009b-bdatj.

data: from_date type sy-datum,
      to_date type sy-datum.

call function 'FIRST_AND_LAST_DAY_IN_YEAR_GET'
     exporting
          i_gjahr        = p_year
          i_periv        = 'YT'
     importing
          e_first_day    = from_date
          e_last_day     = to_date
     exceptions
          input_false    = 1
          t009_notfound  = 2
          t009b_notfound = 3
          others         = 4.

write:/ from_date, to_date.

Regards,

Rich HEilman

0 Kudos

Please make sure to award points for helpful answers and mark your posts as solved when you question has been answered completely. Thanks.

Regards,

Rich Heilman

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Here is a sample. YT is my companys fiscal year variant. You need to find yours. Check out Table T009B, maybe you are using a custom one as well.

report zrich_0001 .


parameters: p_period type t009b-poper,
            p_year type t009b-bdatj.

data: from_date type sy-datum,
      to_date type sy-datum.


call function 'G_POSTING_DATE_OF_PERIOD_GET'
  exporting
    period                    = p_period
    variant                   = 'YT'       " Fiscal Year Variant T009B
    year                      = p_year
 importing
   from_date                 = from_date
*   LAST_NORMAL_PERIOD        =
   to_date                   = to_date
*   FROM_DATE_ORIG            =
 exceptions
   period_not_defined        = 1
   variant_not_defined       = 2
   others                    = 3.
.
write:/ from_date, to_date.

REgards,

Rich HEilman