Ich möchte ein ganz einfaches Programm schreiben, um aus einem ABAP Programm ein Word Dokument öffnen zu lassen. Es soll weder irgendetwas reingefüllt werden, sonst noch abgespeichert werden oder sonst etwas. Wir haben SAP ERP 6.0 im Einsatz.
nutze die Klasse cl_gui_frontend_services und dort die Methode EXECUTE und dem Parameter DOCUMENT gibst du einfach den Filenamen mit - also sagen wir mal C:\Temp\Test.doc - thats it !
Benutz im Editor ganz einfach die Codevorlagen und wähl dort ABAP-Objects aus.
Damit kannst du dir das Grundgerüst des Methoden-Aufrufes einfügen lassen.
lg ADT
Theory is when you know something, but it doesn't work.
Practice is when something works, but you don't know why.
Programmers combine theory and practice: Nothing works and they don't know why.
in der Hoffnung das du weisst wie das grundgerüst deines Programmes ausschauen soll wird - ist dann folgendes Aufruf einzubauen
...
cl_gui_frontend_services=>execute(
EXPORTING
document = 'C:\Temp\Testdocument.doc' -> das ist das Dokument was du öffnen willst
* application = application
* parameter = parameter
* default_directory = default_directory
* maximized = maximized
* minimized = minimized
* synchronous = synchronous
* operation = 'OPEN'
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
others = 10
).
IF sy-subrc <> 0.
-------> und wenn was schief geht solltest du hier reagieren
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
....