cancel
Showing results for 
Search instead for 
Did you mean: 

lokking for FM

Former Member
0 Kudos

i'm looking for NF that make:

1.FM that know how to find the number of week in the year(52 weeks).

2.FM that know the dates of the first day and last day in the week.

3.FM that know how to calc days work in week (holiday is day off )

thanks.

Accepted Solutions (1)

Accepted Solutions (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

1)DATE_GET_WEEK

2)WEEK_GET_FIRST_DAY

To get the last day of the week.....




report zrich_0001 .


data: date type sy-datum,
      week type  SCAL-WEEK value '200624'.


* Get and write first day of week.
call function 'WEEK_GET_FIRST_DAY'
     exporting
          week = week
     importing
          date = date.
write:/ date.


* Say current week is 24 and you need to find the
* last day of the week.   Add 1 to the current week.
* Then find the first day of that week and subtract 1.

week = week + 1.
call function 'WEEK_GET_FIRST_DAY'
     exporting
          week = week
     importing
          date = date.
date = date - 1.
write:/ date.

3)WEEK_GET_NR_OF_WORKDAYS

REgards,

Rich Heilman

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Lil,

a) No.of Weeks FM : TSTR_PERIODS_AMERICAN_WEEKS

b) First and last day of week :

Get first day of the week based on date : BWSO_DATE_GET_FIRST_WEEKDAY

Get week day :BKK_GET_DAY_OF_WEEK

c)No.of Working Daye :WEEK_GET_NR_OF_WORKDAYS

Regards,

Lanka