DATA LAST_DATE TYPE SY-DATUM. CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
day_in = sy-datum
IMPORTING
last_day_of_month = last_date
EXCEPTIONS
day_in_no_date =
OTHERS = .
效果:
2022-12-29 10:34:43
DATA LAST_DATE TYPE SY-DATUM. CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
day_in = sy-datum
IMPORTING
last_day_of_month = last_date
EXCEPTIONS
day_in_no_date =
OTHERS = .
效果: