Ansicht
Dokumentation

ABAPCALL_METHOD_OLE2 - CALL METHOD OLE2

ABAPCALL_METHOD_OLE2 - CALL METHOD OLE2

Fill RESBD Structure from EBP Component Structure   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

CALL METHOD, OLE

Short Reference



CALL METHOD OF ole meth $[= rc$]
               $[EXPORTING p1 = f1 p2 = f2 ...$]
               $[NO FLUSH$] $[QUEUE-ONLY$].


Additions

1.... EXPORTING p1 = f1 p2 = f2 ...

2.... NO FLUSH

3.... QUEUE-ONLY

Effect

This statement calls the method meth of the automation object ole. The automation object must have been created using the special statement CREATE OBJECT for automation objects. The name of the method must be specified in a character-like data object meth.

The return value of the external method meth can be stored in a data object rc. This data object expects, depending on the called method, a character-like data type of length 8 or a data type of type ole2_object from the type pool OLE2 to be able to copy the addressed object.

Addition 1

... EXPORTING p1 = f1 p2 = f2 ...

Effect

The addition EXPORTING can be used to assign actual parameters f1 f2 ... to the input parameters p1 p2 ... of the automation method. The data type of the data objects f1 f2 ... depends on the requirements of the automation method.

Addition 2

... NO FLUSH

Addition 3

... QUEUE-ONLY

Effect

The additions NO FLUSH and QUEUE-ONLY are described in the statement CREATE OBJECT.

System Fields

sy-subrc Meaning
0 Method meth executed successfully.
1 Error in communication with SAP GUI.
2 Error when calling the method meth.
3 Error when setting an attribute.
4 Error when reading an attribute.

Example

Depending on the selection on the selection screen, this source code can be used to open the Excel file Table.xls in directory C:\temp, start the application Word, and then close both applications again. The automation methods used are listed in the following table.






rdisp/max_wprun_time - Maximum work process run time   General Material Data  
This documentation is copyright by SAP AG.

Length: 5396 Date: 20240426 Time: 211900     sap01-206 ( 62 ms )
Application Method Parameter Function
Excel Open File name and path Open
Excel Quit - Exit
Word AppShow - Start
Word AppClose - Exit