04-30-2012 9:14 AM
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
04-30-2012 9:36 AM
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
04-30-2012 9:53 AM
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
04-30-2012 10:43 AM
Hi Sandeep Sharma ,
Could you briefly explain the CASE statement what you are exactly trying to say .
With Regards,
Sudhir S
04-30-2012 2:35 PM
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