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

FM name..???

Former Member
0 Likes
1,284

Hi,

is there any FM which calculates no. of days between today and last 6 months..???? or any other IDEA...???

Thanks in advance....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,152

Hi,

Just check this function module to calculate no of days between two dates..

DAYS_BETWEEN_TWO_DATES

Thanks,

9 REPLIES 9
Read only

Former Member
0 Likes
1,153

Hi,

Just check this function module to calculate no of days between two dates..

DAYS_BETWEEN_TWO_DATES

Thanks,

Read only

Former Member
0 Likes
1,152

Hi!

DATA: gv_today LIKE sy-datum,

gv_6_months_pre LIKE sy-datum,

gv_difference TYPE i.

MOVE sy-datom TO gv_today.

MOVE '20080201' TO gv_6_months_pre.

gv_difference = gv_today - gv_6_months_pre.

gv_difference will contain the desired number.

Regards

Tamá

Read only

Former Member
0 Likes
1,152

Hi,

Use FM 'DAYS_BETWEEN_TWO_DATES'

Regards,

Sujit

Read only

Former Member
0 Likes
1,152

Hi,

try this FM HR_SGPBS_YRS_MTHS_DAYS

LAGF_DAYS_BETWEEN_2_DATES_GET

Read only

Pawan_Kesari
Active Contributor
0 Likes
1,152

if both the dates are stored in DATUM type varible then you can simply subtract them to get days.

DATA : v_today type syst-datum ,

v_smnth type syst-datum ,

v_no type i .

v_no = v_today - v_smnth .

Read only

Former Member
0 Likes
1,152

Hi Sandeep,

Try the foloowing function modules:

DAYS_BETWEEN_TWO_DATES

ISB_DAYS_BETWEEN_TWO_DATES

HR_HK_DIFF_BT_2_DATES

Hope this helps you

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
1,152

Hi Sandeep.

I would like to suggest,

FIMA_DAYS_AND_MONTHS_AND_YEARS.

Export parameters - From date & End date.

Importing - Days, Months, Years.

Writing only-------> write:/ W_DAYS.

Will surely give you the days.

I also would like to suggest you a reference, as it is the same case as yours,

[SDN - Reference for Calculating number of days between two dates - function module|;

Hope that's usefull.

Good Luck & Regards.

Harsh Dave

Read only

former_member125931
Active Participant
0 Likes
1,152

Use : HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.

FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in year months and days.

Read only

Former Member
0 Likes
1,152

Thanks

Regards,

Baidyanath