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: 

need Function Module Name

Former Member
0 Kudos

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

EXPORTING

i_date_old = SY-DATUM

IMPORTING

E_DATE_NEW = T.

Using this function module name i calculated the previous month last date i want previous month first date

so for that which function module can i use...

Thanks,

Thiru.,

1 ACCEPTED SOLUTION

Mohamed_Mukhtar
Active Contributor
0 Kudos

hi

Check these FMs

OIUREP_MONTH_FIRST_LAST "Determine 1st and last day of a month
OIL_MONTH_GET_FIRST_LAST      " Determine 1st and last day of a month

Edited by: Always Learner on Oct 7, 2008 10:24 AM

8 REPLIES 8

Former Member
0 Kudos

Hi,

After calling the function module

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

EXPORTING

i_date_old = SY-DATUM

IMPORTING

E_DATE_NEW = T.

Change the day in the month using

t+6(2) = '01'.

Regards,

Darren

0 Kudos

Here I need both starting date and end date for comparing the values

Former Member
0 Kudos

Hi,

Check this link

[http://www.sap-img.com/abap/determine-last-day-of-the-previous-month.htm]

Regards,

Surinder

0 Kudos

Sorry, i 'm not getting can u explain in better way

Mohamed_Mukhtar
Active Contributor
0 Kudos

hi

Check these FMs

OIUREP_MONTH_FIRST_LAST "Determine 1st and last day of a month
OIL_MONTH_GET_FIRST_LAST      " Determine 1st and last day of a month

Edited by: Always Learner on Oct 7, 2008 10:24 AM

0 Kudos

I want previous month first date and last date when i enter current month date..

For ex.,

input = 07.10.2008

output must be

01.09.2008 and 31.09.2008

0 Kudos

Hi,

Just copy paste the below code and check

parameters : date1 like sy-datum.

data: date2 like sy-datum.

CALL FUNCTION 'OIL_LAST_DAY_OF_PREVIOUS_MONTH'

EXPORTING

I_DATE_OLD = date1

IMPORTING

E_DATE_NEW = date1.

date2 = date1.

date2+6(2) = '01'.

write:/ 'First date is :', date2.

write:/ 'Last date is :',date1.

Regards,

Surinder

Former Member
0 Kudos

Hi,

You have previous month. And It is sure that for any of the months first date is '01'.

So u can use '01' for the first date of the month.

Regards,

RH