The ABAP key word GET PROPERTY copies the property p of the object obj to the field f. The object obj must be of type OLE2_OBJECT.
Basic form: |
GET PROPERTY OF obj p = f. |
Normally, all consecutive OLE statements are buffered by the ABAP processor and sent to the presentation server in bundled form. But it is still possible for a statement to refer to the results of preceding statements.
In debugging, however, you should remember that the values of the return parameters cannot be displayed until directly before execution of the first ABAP non-OLE statement. A command that refers to an object not yet generated by any OLE statement terminates the automatic bundling.
The return code value of SY-SUBRC indicates whether all the bundled commands have been successfully executed. The return code value can be as follows:
All commands were successfully executed.
When communicating with the presentation server, a system error occurred. The field SY-MSGLI contains a short description of the error.
A method call resulted in an error.
Setting a property resulted in an error.
Reading a property resulted in an error.
In the last 3 cases, a dialog box containing an error note is displayed on the presentation server.
GET PROPERTY belongs to a group of key words that allows you to process external objects with ABAP. At present, only the object model OLE2 is supported, i.e. all objects must be of type OLE2_OBJECT. This type and other necessary data are defined in the INCLUDE module OLE2INCL.
The addition NO FLUSH continues the collection process, even if the next command is not an OLE statement. This means, for example, that a series of properties can be set in a loop and downloaded to the presentation server in a single transport operation.
If NO FLUSH is used, programmers must ensure that they do not rely on the contenst of return parameters that are not yet filled. Also, all objects must be initialized in a bundle, i.e. they must be generated by an OLE call that has already been executed.
Every FREE statement always causes an exchange of the buffer.

Read the property 'Visible' of an EXCEL worksheet:
INCLUDE OLE2INCL.
DATA: EXCEL TYPE OLE2_OBJECT.
VISIBLE TYPE I.
CREATE OBJECT EXCEL 'Excel.Application'.
GET PROPERTY OF EXCEL 'Visible' = VISIBLE.
Related topics are:
SET PROPERTY, CREATE OBJECT, CALL METHOD and FREE OBJECT.