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: 

Function module

Former Member
0 Kudos

Hi all,

Do we have any function module which Convert Period & Year to the first date of that period & year?

For Eg. 02 2008 gets converted to 01.02.2008

Thanks and regards

Swati

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Use function module FIRST_DAY_IN_PERIOD_GET if you have the society.

CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
       EXPORTING
            i_gjahr = w_gjahr " Year
            i_periv = t001-periv " Fiscal year variant
            i_poper = w_poper " Period/Month
       IMPORTING
            e_date  = w_date
       EXCEPTIONS
            OTHERS  = 1.

Else, for pure calendar, concatenate year, period and '01' in a DATS field.

w_date+0(4) = w_year.
w_date+4(2) = w_period.
w_date+6(2) = '01'.

Regards

6 REPLIES 6

raymond_giuseppi
Active Contributor
0 Kudos

Use function module FIRST_DAY_IN_PERIOD_GET if you have the society.

CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
       EXPORTING
            i_gjahr = w_gjahr " Year
            i_periv = t001-periv " Fiscal year variant
            i_poper = w_poper " Period/Month
       IMPORTING
            e_date  = w_date
       EXCEPTIONS
            OTHERS  = 1.

Else, for pure calendar, concatenate year, period and '01' in a DATS field.

w_date+0(4) = w_year.
w_date+4(2) = w_period.
w_date+6(2) = '01'.

Regards

JozsefSzikszai
Active Contributor
0 Kudos

hi Swati,

you can try FM FIRST_DAY_IN_PERIOD_GET

hope this helps

ec

Former Member
0 Kudos

Hi,

Check this FM PERIOD_DAY_DETERMINE

Check this Code, Given in another thread


report zrich_0001 .

data: start_date type sy-datum,
end_date type sy-datum.

parameters: p_spbup type spbup.

start-of-selection.

start_date = p_spbup.
start_date+6(2) = '01'.

call function 'LAST_DAY_OF_MONTHS'
exporting
day_in = start_date
importing
last_day_of_month = end_date.

write:/ start_date, end_date.

Regards,

Satish

Edited by: Satish Panakala on Feb 1, 2008 10:24 AM

Former Member
0 Kudos

Please check FM - FIRST_DAY_IN_PERIOD_GET, Pass period + year + fiscal year variant (T009B table)

Regards

Nilesh Shete

Former Member
0 Kudos

Hi,

FIRST_AND_LAST_DAY_IN_YEAR_GET

Import parameters Value

I_GJAHR 2007

I_PERIV 24

Export parameters Value

E_FIRST_DAY 01.01.2007

E_LAST_DAY 31.12.2007

Former Member
0 Kudos

Hi,

You can use the below FM :


FIRST_DAY_IN_PERIOD_GET

Thanks,

Sriram Ponna.