SET PROPERTY

Basic form 14

SET PROPERTY OF obj p = f.

Addition:


... NO FLUSH


Effect

Sets the property p of the object obj according to the contents of the field f.

The object obj must be of type OLE2_OBJECT.

Normally, all consecutive OLE statements are buffered by the ABAP processor and sent to the presentation server in bundled form. This means that it is 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 statement external to OLE.
Even a command which refers to an object not yet generated by any OLE statement terminates the bundling.

The return code value of SY-SUBRC indicates whether all the bundled commands have been successfully executed.

The Return Code is set as follows:

SY-SUBRC = 0:
All commands were successfully executed.
SY-SUBRC = 1:
When communicating with the presentation
server, a system error occurred. The system
field SY-MSGLI contains a short
description of the error.
SY-SUBRC = 2:
A method call resulted in an error.
SY-SUBRC = 3:
Setting a property resulted in an error.
SY-SUBRC = 4:
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.
SET PROPERTY belongs to a group of key words that allows you to process external objects with ABAP/4. 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 program OLE2INCL.

Addition

... NO FLUSH

The addition NO FLUSH continues the collection process, even if the next command is not an OLE statement. This means that you can set a series of properties in a loop and download them to the presentation server in a single transport operation.
If you do not use NO FLUSH, you must ensure that you do not rely on the contents of return parameters 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 a download of the buffer.

Example

Set the attribute 'Visible' of an EXCEL worksheet.

INCLUDE OLE2INCL.
DATA EXCEL TYPE OLE2_OBJECT.
CREATE OBJECT EXCEL 'Excel.Application'.
SET PROPERTY OF EXCEL 'Visible' = 1.

Related

GET PROPERTY
CALL METHOD
CREATE OBJECT
FREE OBJECT