‎2007 Jul 12 6:01 PM
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
‎2007 Jul 12 8:37 PM
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
‎2007 Jul 12 6:05 PM
Hi,
Did you have FM DATE_CHECK_WORKINGDAY in your systems?
Regards,
Ferry Lianto
‎2007 Jul 12 7:56 PM
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
‎2007 Jul 12 8:27 PM
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.
‎2007 Jul 12 8:29 PM
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
‎2007 Jul 12 8:37 PM
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
‎2007 Jul 13 8:18 AM