Get Example source ABAP code based on a different SAP table
• CALL METHOD OF - OLE ABAP Statement
CALL METHOD>, OLE Short Reference >
ABAP_SYNTAX CALL METHOD OF ole meth $[= rc$] $[EXPORTING p1 = f1 p2 = f2 ...$] $[NO FLUSH$] $[QUEUE-ONLY$].>
ABAP Addition 1 ... EXPORTING p1 = f1 p2 = f2 ...> 2 ... NO FLUSH> 3 ... QUEUE-ONLY>
What does it do? 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. • EXPORTING CALL METHOD OF - OLE
ABAP Addition
What does it do? 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. • NO FLUSH CALL METHOD OF - OLE • QUEUE-ONLY CALL METHOD OF - OLE
ABAP Addition
ABAP Addition
What does it do? The additions NO FLUSH> and QUEUE-ONLY> are described in the statement CREATE OBJECT>>. System Fields> sy-subrc>Meaning> 0Method meth> executed successfully. 1Error in communication with SAP GUI. 2Error when calling the method meth>. 3Error when setting an attribute. 4Error when reading an attribute.
Example ABAP Coding
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. Application>Method>Parameter>Function> ExcelOpen>File name and pathOpen ExcelQuit>-Exit WordAppShow>-Start WordAppClose>-Exit ABEXA 00069 ABAP_EXAMPLE_END