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

Reg Function module for getting date

Former Member
0 Likes
427

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

Pawan_Kesari
Active Contributor
0 Likes
401

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

Pawan_Kesari
Active Contributor
0 Likes
402

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 .

Read only

Former Member
0 Likes
401

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.

Read only

Former Member
0 Likes
401

thanq