REPORT ZEXAMPLE.

DATA: V_PGM(100) VALUE 'C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\WINWORD.EXE',

V_FNAME LIKE RLGRAP-FILENAME VALUE 'C:\DOCUMENT.DOC'.

CALL FUNCTION 'WS_EXECUTE'

EXPORTING

COMMANDLINE = V_FNAME

PROGRAM = V_PGM

EXCEPTIONS

FRONTEND_ERROR = 1

NO_BATCH = 2

PROG_NOT_FOUND = 3

ILLEGAL_OPTION = 4

GUI_REFUSE_EXECUTE = 5

OTHERS = 6.

IF SY-SUBRC NE 0.

WRITE:/ V_FNAME, 'NOT OPENED WITH', V_PGM.

ELSE.

WRITE:/ 'EXTERNAL APPLICATION CALLED SUCCESSFULLY'.

ENDIF.