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: 

Week Number determination for Saudi Companies

former_member182546
Contributor
0 Kudos

Dear All,

        I am held up with an requirement of bringing the week number in one custom field in screen . For this I have used the function module DATE_GET_WEEK with sydatum as it's input parameter.

But I bring the week number based on the concept that the week starts with Sunday .

But for the saudi based companies the week starts with Saturday.

Any special function module is available for this case

Kindly guide me on this How can bring the week number .

With Regards,

Sudhir S

4 REPLIES 4

ThomasZloch
Active Contributor
0 Kudos

Have a look at SAP note 1063178 on how to use enhancement spot CALENDAR_DEFINITION for adjusting what is considered first day of the week (here in Germany, it is the Monday, for example).

This will be factored in by DATE_GET_WEEK and related function modules.

Thomas

0 Kudos

Hi Sudhir,

Can you try like this :

CALL FUNCTION 'date_compute_day'
EXPORTING
date = v_date
IMPORTING
day  = c_day.

where v_date is the current date or sy-datum & c_day will give the week number.

Then you can use week number by using numbers like 1 = monday,2 = Tuesday,3 = Wednesday ,4,5,6 = saturday,7 = Sunday.

CASE  c_day .
WHEN 1 OR 2 OR 3 OR 6 OR 7.

Please check and confirm.

regards


sandeep

0 Kudos

Hi Sandeep Sharma ,

     Could you briefly explain the CASE statement what you are exactly trying to say .

With Regards,

Sudhir S

0 Kudos

Hi Sudhir,

In case statement, i was basically checking the time clocked during the working days and ifsubstitution is there, then checking it during weekends.

CASE  c_day .
WHEN 1 OR 2 OR 3 OR 6 OR 7.

SELECT SINGLE pamod
varia
sollz
sobeg
soend
FROM t550a
INTO wa_break_schedule
WHERE tprog = wa_daily_workrule-tpr04
AND   varia = ' '.


And then calculate start of break time or end time,clock-in time and clock-out time.

WHEN 4 or 5.

SELECT SINGLE pamod
varia
sollz
sobeg
soend
FROM t550a
INTO wa_break_schedule
WHERE tprog = wa_daily_workrule-tpr04
AND   varia = ' '.


And then calculate start of break time or end time,clock-in time and clock-out time.

ENDCASE.

regards

sandeep