CALL METHOD

CALL METHOD - Call a method of an external object

Additions:

1. ... = f
2. ... EXPORTING p1 = f1 ... pn = fn
3. ... NO FLUSH

Effect

Calls the method m of the object obj. m can be a literal or a variable.
CALL METHOD

Effect

Stores the return code of the method in the variable f. The return code can also be of type OLE2_OBJECT. This addition must always come before other additions.

Effect

EXPORTING passes values of fields to the parameters of the method. p1, p2, ... are either key word parameters or position parameters.

If assignment of parameters is by sequence, p1, p2, ... must begin with "#", followed by the position number of the parameter. At present, only position parameters are supported.

The export parameters always come at the end of the statement.

INCLUDE OLE2INCL. 
DATA EXCEL	TYPE OLE2_OBJECT. 
DATA WORKBOOK TYPE OLE2_OBJECT. 
 
CREATE OBJECT   EXCEL	'Excel.Application'. 
CALL METHOD  OF EXCEL	'Workbooks' = WORKBOOK. 
CALL METHOD  OF WORKBOOK 'Open'	EXPORTING #1 = 'C:\EX1.XLS'.

Related

SET PROPERTY
GET PROPERTY
CREATE OBJECT
FREE OBJECT