‎2009 Dec 14 10:57 AM
Hi experts,
i have to select all orders from VBAK which are more than 3 working days old than current date.
Working days interval: monday - friday.
What options i have? How can i solve this problem?
Thanks in advance.
‎2009 Dec 14 11:09 AM
Hi ,
You can use follwoing option.
1. Call FM- DATE_CONVERT_TO_FACTORYDATE (Using Correct_option = '-', date: Current date, Factory calendar ID = Refer to table == TFACD (ex: A3).
Get the return date and use it twice for next 2 working days.
Now u will have 2 working days.. u can directly fire select query with the above dates
Hope this Helps,
Nag
‎2009 Dec 14 11:07 AM
Use function module 'DATE_CHECK_WORKINGDAY' to check whether day is working day or not in organization working calender
‎2009 Dec 14 11:09 AM
Hi ,
You can use follwoing option.
1. Call FM- DATE_CONVERT_TO_FACTORYDATE (Using Correct_option = '-', date: Current date, Factory calendar ID = Refer to table == TFACD (ex: A3).
Get the return date and use it twice for next 2 working days.
Now u will have 2 working days.. u can directly fire select query with the above dates
Hope this Helps,
Nag
‎2009 Dec 14 2:17 PM
‎2009 Dec 14 11:15 AM
1. Calculate the last working date you want you cand do this using System date and Function module to check wheter the date is working or not .
CALL FUNCTION 'DAY_ATTRIBUTES_GET'
EXPORTING
FACTORY_CALENDAR L_CALENDAR
HOLIDAY_CALENDAR L_CALENDAR
DATE_FROM L_DATE
DATE_TO L_DATE
LANGUAGE L_LANGU
IMPORTING
YEAR_OF_VALID_FROM
YEAR_OF_VALID_TO
RETURNCODE
TABLES
DAY_ATTRIBUTES
T_DAY_ATTRIBUTES
EXCEPTIONS
FACTORY_CALENDAR_NOT_FOUND 1
HOLIDAY_CALENDAR_NOT_FOUND 2
DATE_HAS_INVALID_FORMAT 3
DATE_INCONSISTENCY 4
OTHERS 5
.
2 Once you calculate the date make a simple query for same .