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

working days

Former Member
0 Likes
663

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
602

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

4 REPLIES 4
Read only

Former Member
0 Likes
602

Use function module 'DATE_CHECK_WORKINGDAY' to check whether day is working day or not in organization working calender

Read only

Former Member
0 Likes
603

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

Read only

0 Likes
602

Thank you. Problem solved.

Read only

anup_deshmukh4
Active Contributor
0 Likes
602

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 .