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: 

FM: Diff between two dates based on factory calender

Former Member
0 Kudos
1,111

Hi,

Could anybody assist me, My requirement is to determine delay of delivery date is equal to (goods receipt posting date u2013 planned delivery date) based on the Factory calender as well as Pulic holidays i.e it should not consider both.Is there any function module to find out the date diffrence. The difference should be '+' or '-' OR 'ZERO'. I have used function module 'DAYS_BETWEEN_TWO_DATES' but it is not useful.

Thanks in advance.

Regards.

I.Reddy Prasad.

7 REPLIES 7

Former Member
0 Kudos
274

Hi,

Check these FM's:

HR_HK_DIFF_BT_2_DATES

HR_99S_INTERVAL_BETWEEN_DATES

Regards,

Narasimha

0 Kudos
274

Hi Narasimha,

Thanks for your response. I need to find difference between two dates based on the factory calender.please do the needful.

Thanks and Regards.

I.Reddy Prasad.

Former Member
0 Kudos
274

Hi,

Check these FM's:

HR_HK_DIFF_BT_2_DATES

HR_99S_INTERVAL_BETWEEN_DATES

FIMA_DAYS_AND_MONTHS_AND_YEARS

Regards,

Narasimha

Edited by: narasimha marella on Jun 13, 2008 7:20 AM

Former Member
0 Kudos
274

hi there....

i tried with a simple logic.. lets c if this helps...

declare a variable var of type p.

den do

var = date1 - date2.

this will calculater the difference in days and put it in the variable var.

do reward if helpful.

GauthamV
Active Contributor
0 Kudos
274

hi,

check these func. modules.

CATS_CHECK_FACTORY_DATE

DATE_CONVERT_TO_FACTORYDATE Calendar function: Returns factory calendar date for a date

FACTORYDATE_CONVERT_TO_DATE Calendar function: Returns date for a factory calendar date

LAST_FACTORYDATE_GET Calendar function: Return last factory date for a factory calendar

reward points if hlpful.

Former Member
0 Kudos
274

Hi,

CALL FUNCTION 'FI_PSO_DAYS_MONTHS_YEARS_GET'

EXPORTING

i_date_from = gv_budat

i_date_to = gv_eindt

IMPORTING

e_days = gv_diff

e_months = lv_diff_months

e_years = lv_diff_year.

regards

Susheel

Former Member
0 Kudos
274

Hi,

Use below logic to solve your problem.

Find the difference between the dates.

g_no_days = date1 - date2.

c_date = date1.

DO g_no_days TIMES.

CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'

Input: Correct option : '+'

Date : c_date

Factory calendat : 'XX'

Output :

Date : c1_date.

If c_date = c1_date.

count = count + 1.

endif.

c_date = c_date + 1. (increase date by 1 day)

ENDDO.

If holidays or weekend occurs, the c1_date will not be same as C_date.

Hope this help you.