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: 

test working day

Former Member
0 Kudos

Hello,

I work on BW, I have to do a routine in abap code in my dataflow. Generally in BW the abap code is easy. But now I have a problem. I want to check if my date is a working day or not, according a calendary. I don't find function module neither in BW, nor in R3.

Anybody can help me?

Thanks in advance.

Dimitri

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Rather than copying DATE_CHECK_WORKINGDAY (which is not remote enabled)and associated function group to your BI system, why not call fm DATE_CONVERT_TO_FACTORYDATE which is remote enabled from BI. This fm is directly called by DATE_CHECK_WORKINGDAY.You may have to add a bit of extra code, but It it looks to be an easier chore.

Rob

6 REPLIES 6

ferry_lianto
Active Contributor
0 Kudos

Hi,

Did you have FM DATE_CHECK_WORKINGDAY in your systems?

Regards,

Ferry Lianto

Former Member
0 Kudos

Hello,

Thanks for your response.

I have not this FM in BW, it exists in my R/3. Maybe, I can copy it in my BW.

Could you explain me how can i use this FM.

Thanks.

Dimitri

0 Kudos

Hi Dimitri,

report ztest.

data : date like sy-datum.

date = '20070715'.

CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
  EXPORTING
    DATE                             = date
    FACTORY_CALENDAR_ID              = '01'
    MESSAGE_TYPE                     = 'I'
* EXCEPTIONS
*   DATE_AFTER_RANGE                 = 1
*   DATE_BEFORE_RANGE                = 2
*   DATE_INVALID                     = 3
*   DATE_NO_WORKINGDAY               = 4
*   FACTORY_CALENDAR_NOT_FOUND       = 5
*   MESSAGE_TYPE_INVALID             = 6
*   OTHERS                           = 7
          .
IF SY-SUBRC = 0.
ENDIF.

Regards

Aneesh.

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please check this sample code.


CALL FUNCTION 'DATE_CHECK_WORKINGDAY'
  EXPORTING
    DATE = SY-DATUM
    FACTORY_CALENDAR_ID = '01'
    MESSAGE_TYPE = 'E'
  EXCEPTIONS
    DATE_AFTER_RANGE = 1
    DATE_BEFORE_RANGE = 2
    DATE_INVALID = 3
    DATE_NO_WORKINGDAY = 4
    FACTORY_CALENDAR_NOT_FOUND = 5
    MESSAGE_TYPE_INVALID = 6
    OTHERS = 7.

IF SY-SUBRC = 0.
  WRITE 'working day'.
ELSE.
  WRITE 'not workingday'.
ENDIF.

Also please check this FM TM_DATE_CHECK_WORKINGDAY whether is available or not in SAP BW.

Regards,

Ferry Lianto

Former Member
0 Kudos

Rather than copying DATE_CHECK_WORKINGDAY (which is not remote enabled)and associated function group to your BI system, why not call fm DATE_CONVERT_TO_FACTORYDATE which is remote enabled from BI. This fm is directly called by DATE_CHECK_WORKINGDAY.You may have to add a bit of extra code, but It it looks to be an easier chore.

Rob

Former Member
0 Kudos

Thanks a lot!!