代码部分
DATA LAST-DATE TYPE D.
call function 'LAST_DAY_OF_MONTHS'
exporting
day_in = sy-datum
IMPORTING
LAST_DAY_OF_MONTH = last-date
EXCEPTIONS
DAY_IN_NO_DATE = 1
OTHERS = 2
.
if sy-subrc <> 0.
* Implement suitable error handling here
endif.
write:LAST-DATE.
运行结果
