Google Search - Blog...........

ABAP - Fetch First Day For Any Next Week - 'WEEK_GET_FIRST_DAY'

report zdates.

parameters:p_week type SCAL-WEEK.

initialization .

p_week = '200804'.


data:date type sy-datum .

start-of-selection .

CALL FUNCTION 'WEEK_GET_FIRST_DAY'
EXPORTING
week = p_week
IMPORTING
DATE = DATE
EXCEPTIONS
WEEK_INVALID = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

write:/ 'the first date for the given week is :' , date .

No comments:

Post a Comment