REPORT ZEXAMPLE.

DATA: BEGIN OF MONTH_NAMES OCCURS 0.

INCLUDE STRUCTURE T247.

DATA: END OF MONTH_NAMES.

DATA: V_LASTDAY LIKE SY-DATUM,

V_NEXTMONTH LIKE SY-DATUM,

V_DAYTXT(15).

CALL FUNCTION 'MONTH_NAMES_GET'

EXPORTING

LANGUAGE = SY-LANGU

TABLES

MONTH_NAMES = MONTH_NAMES

EXCEPTIONS

MONTH_NAMES_NOT_FOUND = 1

OTHERS = 2.

CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'

EXPORTING

DAY_IN = SY-DATUM

IMPORTING

LAST_DAY_OF_MONTH = V_LASTDAY.

CALL FUNCTION 'RH_GET_DATE_DAYNAME'

EXPORTING

LANGU = SY-LANGU

DATE = V_LASTDAY

IMPORTING

DAYTXT = V_DAYTXT.

READ TABLE MONTH_NAMES WITH KEY MNR = SY-DATUM+4(2).

WRITE:/'THE LAST DAY OF', MONTH_NAMES-LTX, 'IS THE', V_LASTDAY, 'WHICH IS A', V_DAYTXT.

CALL FUNCTION 'MONTH_PLUS_DETERMINE'

EXPORTING

MONTHS = '1'

OLDDATE = SY-DATUM

IMPORTING

NEWDATE = V_NEXTMONTH.

READ TABLE MONTH_NAMES WITH KEY MNR = V_NEXTMONTH+4(2).

WRITE:/'NEXT MONTH IS', MONTH_NAMES-LTX.

CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'

EXPORTING

MONTHS = '1'

OLDDATE = V_NEXTMONTH

IMPORTING

NEWDATE = V_NEXTMONTH.

READ TABLE MONTH_NAMES WITH KEY MNR = V_NEXTMONTH+4(2).

WRITE:/'THE MONTH AFTER THAT IS', MONTH_NAMES-LTX.