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: 

Calendar fucntion: Returns week for a date (Require to calculation from Sunday to Saturday)

0 Kudos

Hi Team,

Is there any FM similar to date_get_week to get day of the week but based on the calculation using Sunday to Saturday a Week.

Currently, DATE_GET_WEEK calculates based on a week considering it has Monday to Sunday. But my requirement the calculation should consider from Sunday to Saturday has a week.

Please advise.

Note:It is a BW System.

Regards

Sunil Kumar.

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos

You could try an implementation of enhancement spot CALENDAR_DEFINITION, in method GET_FIRST_DAY_OF_WEEK you can set the first day of the week. This will reflect in DATE_GET_WEEK.

Speak to your system administrator, as this might have effects elsewhere.

Also look at SAP note 1063178 for some background.

Thomas

3 REPLIES 3

ThomasZloch
Active Contributor
0 Kudos

You could try an implementation of enhancement spot CALENDAR_DEFINITION, in method GET_FIRST_DAY_OF_WEEK you can set the first day of the week. This will reflect in DATE_GET_WEEK.

Speak to your system administrator, as this might have effects elsewhere.

Also look at SAP note 1063178 for some background.

Thomas

0 Kudos

Hi Thomas,

Thanks for answering but I cannot change the enhancement spot because it will get effected the other calculations.

Regards,

Sunil Kumar.

0 Kudos

How about adding 1 to the returned week number if the day is a Sunday?

Better double-check that this gives the correct result in all cases

Thomas