|Sample code, images||Restrictions, R/3 Release, Sapgui version, GuiXT version|
|14 Determine the week for a given date For a given date you want to determine the week 1…53 and the year corresponding to this week. The date is specified in one of the external date formats (like dd.mm.yyyy or mm/dd/yyyy).
For example, 01.01.2003 is in week 1 of the year 2003. This sounds self-evident, but (surprisingly):
01.01.2005 is in week 53 of the year 2004
The rule is: a week is considered to be in the year that contains 4 days or more of the week. A week always starts with Monday.
Solution You can either use a function call or direct date calculations.
| Function call
Last update: March 25, 2003
2003 Q1 9 and upwards