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

Factory Calender Determination

Former Member
0 Likes
1,297

Can someone tell me how can we determine if a particular day is a working day or not, based on the Factory Calender?

Please help.Its urgent.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,235

use the FM

DATE_CONVERT_TO_FACTORYDATE

if the returned date = to the sent date, it is a working day


DATA: senddt TYPE d VALUE '20080601',  "<== this is Sunday
      recvdt TYPE d.

CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
     EXPORTING
          correct_option      = '+'
          date                = senddt
          factory_calendar_id = 'US'
     IMPORTING
          date                = recvdt.
*   FACTORYDATE                        =
*   WORKINGDAY_INDICATOR               =
* EXCEPTIONS
*   CALENDAR_BUFFER_NOT_LOADABLE       = 1
*   CORRECT_OPTION_INVALID             = 2
*   DATE_AFTER_RANGE                   = 3
*   DATE_BEFORE_RANGE                  = 4
*   DATE_INVALID                       = 5
*   FACTORY_CALENDAR_NOT_FOUND         = 6
*   OTHERS                             = 7
.
IF senddt NE recvdt.
  WRITE:/ senddt, 'is not a working day'.
ELSE.
  WRITE:/ senddt, 'is a working day'.
ENDIF.

7 REPLIES 7
Read only

Former Member
0 Likes
1,235

http://www.sap-basis-abap.com/sapab016.htm

Check the above link.

Thanks.

Read only

Former Member
0 Likes
1,235

hi Shashi,

Use function module: DATE_CHECK_WORKINGDAY

pass date and factory calender ID.

thnx,

ags.

Read only

Former Member
0 Likes
1,235

Hi

Use function module GET_DATE_FROM_CALID

regards

Read only

0 Likes
1,235

I have to determine the Factory Calender for a Shipping Point in a Delivery.

How can we do that?

Please help.

Read only

0 Likes
1,235

Hi,

Based on Delivery number you can get factory calender from table LIKP.

KNFAK - Customer factory calendar

Pick this and use the function module to get working day or determine working day or convert to working day. You can search all these function modules in SE37 by doing F4 on search term - star working star day star.

I think you should explore ABAP first before putting question on SDN for every doubt you have. You should alsywas check all the fields in the tables you are using. Most of the time you will get all the required fields in the same or corresponding tables.

thnx,

ags.

Read only

0 Likes
1,235

I have already tried that field and saw that its blank.

Thats the reason I was trying to ask questions.

Read only

Former Member
0 Likes
1,236

use the FM

DATE_CONVERT_TO_FACTORYDATE

if the returned date = to the sent date, it is a working day


DATA: senddt TYPE d VALUE '20080601',  "<== this is Sunday
      recvdt TYPE d.

CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
     EXPORTING
          correct_option      = '+'
          date                = senddt
          factory_calendar_id = 'US'
     IMPORTING
          date                = recvdt.
*   FACTORYDATE                        =
*   WORKINGDAY_INDICATOR               =
* EXCEPTIONS
*   CALENDAR_BUFFER_NOT_LOADABLE       = 1
*   CORRECT_OPTION_INVALID             = 2
*   DATE_AFTER_RANGE                   = 3
*   DATE_BEFORE_RANGE                  = 4
*   DATE_INVALID                       = 5
*   FACTORY_CALENDAR_NOT_FOUND         = 6
*   OTHERS                             = 7
.
IF senddt NE recvdt.
  WRITE:/ senddt, 'is not a working day'.
ELSE.
  WRITE:/ senddt, 'is a working day'.
ENDIF.