Hi Martin,
I've to derived cal week from finished date and need to write code in field level routine (update rule).. Please see if below is correct. Syntax is correct but it is giving error when loading data into dso.
Please correct if something is wrong here.
data: lv_week type SCAL-WEEK.
IF COMM_STRUCTURE-FINISHDATE NE '00000000'.
CALL FUNCTION 'DATE_GET_WEEK'
EXPORTING
DATE = COMM_STRUCTURE-FINISHDATE
IMPORTING
WEEK = lv_week
EXCEPTIONS
DATE_INVALID = 1
OTHERS = 2
.
IF sy-subrc = 0.
RESULT = lv_week.
* Implement suitable error handling here
ENDIF.
ENDIF.