Friday, November 30, 2012

Peculiar calendar week and its handling in BW

In one of earlier post I mentioned Time characteristics as Rule Type in Transformations. We can see how useful they are here. Especially in case of derivation of week (0CALWEEK) based on calendar day (0CALDAY). To decide into which week particular day falls might be tricky. Basically the main problem here is to decide about first/last week of year. It depends on calendar implementation which may differ from country to country. By default BW logic is govern by ISO (International Organization for Standardization). Its definition 8601 of first week (in short) is following:

- First day of the week is always Monday
- First week in year is week that includes January 4th

You can override this definition by implementing BadI CALENDAR_DEFINITION (for SAP Basis 62 & 64) and by Enhancement Spot (Basis 7). For details refer to SAP Notes below. To be honest this is not easy topic. :-)

1063178 - Calendar definition differs from ISO 8601
810900 - Counting weeks and working days
1520596 - 0CALWEEK does not support 53 fiscal weeks

No comments: