Tuesday, June 4, 2013
EPORT ZTEST_PROGRAM.

DATA: BEGDA LIKE SY-DATUM,
      ENDDA LIKE SY-DATUM.

" Get first day of current month
BEGDA      = SY-DATUM.
BEGDA+6(2) = '01'.

" Get last day of current month
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
  EXPORTING
    DAY_IN            = BEGDA
  IMPORTING
    LAST_DAY_OF_MONTH = ENDDA.
IF SY-SUBRC NE 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

WRITE:/ 'Start date:',BEGDA,
      / 'End date:',  ENDDA.

1 comment:

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.