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: 

Reg Function module for getting date

Former Member
0 Kudos

Hi,

My requirement is, If I entered some date I need to get past three months number of days.

Eg: if I entered 26thDec,2007

I need to get number of days form October 1st to 26th Dec.

Regards,

sarath.

1 ACCEPTED SOLUTION

Pawan_Kesari
Active Contributor
0 Kudos

try this code


REPORT ztest .


DATA : lv_date TYPE syst-datum ,
       lv_tmp  TYPE i          .

PARAMETERS : p_date TYPE syst-datum OBLIGATORY .


CALL FUNCTION 'ADD_TIME_TO_DATE'
  EXPORTING
    i_idate = p_date
    i_time  = '3'
    i_iprkz = '2' "Month
  IMPORTING
    o_idate = lv_date.

lv_tmp = lv_date - p_date .
WRITE : 'Diff in days ' , lv_tmp .

3 REPLIES 3

Pawan_Kesari
Active Contributor
0 Kudos

try this code


REPORT ztest .


DATA : lv_date TYPE syst-datum ,
       lv_tmp  TYPE i          .

PARAMETERS : p_date TYPE syst-datum OBLIGATORY .


CALL FUNCTION 'ADD_TIME_TO_DATE'
  EXPORTING
    i_idate = p_date
    i_time  = '3'
    i_iprkz = '2' "Month
  IMPORTING
    o_idate = lv_date.

lv_tmp = lv_date - p_date .
WRITE : 'Diff in days ' , lv_tmp .

Former Member
0 Kudos

HR_SGPBS_YRS_MTHS_DAYS

FIMA_DAYS_BETWEEN_TWO_DATES

FIMA_DAYS_BETWEEN_TWO_DATES_2

FIMA_LEAP_DAYS_BETWEEN_2_DATES

you can use any of the FM above.

Thanks,

Sree.

Former Member
0 Kudos

thanq