Application Development and Automation 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: 
Read only

need Function Module Name

Former Member
0 Likes
959

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
Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
919

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
Read only

Former Member
0 Likes
919

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

Read only

0 Likes
919

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

Read only

Former Member
0 Likes
919

Hi,

Check this link

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

Regards,

Surinder

Read only

0 Likes
919

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

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
920

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

Read only

0 Likes
919

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

Read only

0 Likes
919

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

Read only

Former Member
0 Likes
919

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