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 for Date Calculation

Former Member
0 Kudos

Hi All,

Is there any function module which gives me the last twelve month details from the current date.

Suppose we enter the date as 15 Oct 2008 .. the result should be as below

Oct 2008

Sep 2008

Aug 2008

July 2008

June 2008

May 2008

April 2008

March 2008

Feb 2008

Jan 2008

Dec 2007

Nov 2007

Regards

Lalit

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

I dont think so we have these type of FM but u can do it programicatly its very easy.

Just take the entered date and decrease it my 12 then u will get one number then u can check it which month and year it is.

4 REPLIES 4

GauthamV
Active Contributor
0 Kudos

hi,

use these function module.

MONTH_PLUS_DETERMINE

RP_CALC_DATE_IN_INTERVAL.

Former Member
0 Kudos

Hello,

I dont think so we have these type of FM but u can do it programicatly its very easy.

Just take the entered date and decrease it my 12 then u will get one number then u can check it which month and year it is.

Former Member
0 Kudos

Hi,

Use FM OIL_GET_PREV_MONTH as follows;

Data : lv_date_tmp  type d.

lv_date_tmp = '20081015'.
do 12 times.
CALL FUNCTION 'OIL_GET_PREV_MONTH'
  EXPORTING
    i_date        = lv_date_tmp
 IMPORTING
   E_DATE        = lv_date_tmp.
WRITE : / lv_date_tmp.
ENDDO.

Instead of WRITE create an internal table and append the date(lv_date_tmp) in it.

Revert back if u have doubts.

Regards

Karthik D

Former Member
0 Kudos

How to find the Instalation date of SAP ?

Thanks.

V