CASE OKCODE.
WHEN 'EXIT'. PERFORM LEAVE.
WHEN 'BACK'. PERFORM LEAVE.
*
* Excel Example
*
WHEN 'EXST'.
* start Excel
IF H_APPL-HEADER = SPACE OR H_APPL-HANDLE = -1.
CREATE OBJECT H_APPL 'EXCEL.APPLICATION'.
IF SY-SUBRC NE 0. MESSAGE I002 WITH SY-MSGLI. ENDIF.
SET PROPERTY OF H_APPL 'VISIBLE' = 1.
ENDIF.
WHEN 'EXRE'.
* release Excel
CALL METHOD OF H_APPL 'QUIT'.
FREE OBJECT H_APPL.
H_APPL-HANDLE = -1.
*
* Word Example
*
DATA: H_WORD TYPE OLE2_OBJECT.
WHEN 'STAR'.
* start Word
IF H_WORD-HEADER = SPACE OR H_WORD-HANDLE EQ -1.
CREATE OBJECT H_WORD 'WORD.BASIC'.
IF SY-SUBRC NE 0.
MESSAGE I002 WITH SY-MSGLI.
ELSE.
CALL METHOD OF H_WORD 'AppShow'.
ENDIF.
ENDIF.
WHEN 'ENDE'.
* release Word
CALL METHOD OF H_WORD 'APPCLOSE'.
FREE OBJECT H_WORD.
H_WORD-HANDLE = -1.
ENDCASE.
CLEAR OKCODE.
ENDMODULE.
*---------------------------------------------------------------------*
* FORM LEAVE *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM LEAVE.
SET SCREEN 0.
LEAVE SCREEN.
ENDFORM.
*Text elements
*----------------------------------------------------------
* 001 Entry in SAP-DATA field incorrect
* 002 Calculator can now be used
* 003 Open file
*Messages
*----------------------------------------------------------
*
* Message class: SY
*002 &
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.