GET PROPERTY

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.

     

Addition:

NO FLUSH

     

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.

If you are working in debugging mode, then you should not forget that the return parameter values can only be displayed before the first non-OLE ABAP statement has been executed. A command that refers to an object not yet generated by any OLE statement terminates the automatic bundling.

The return parameter SY-SUBRC displays whether all bundled statements have been executed successfully. It can have the following values:

  • SY-SUBRC = 0:

All commands were successfully executed.

  • SY-SUBRC = 1:

When communicating with the presentation server, a system error occurred. The 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.

GET PROPERTY is part of a group of keywords that you can use to process external objects in ABAP. At present, only the object model OLE2 is supported. All objects to be processed must therefore be of type OLE2_OBJECT. This type and other necessary data are defined in the INCLUDE module OLE2INCL.

The NO FLUSH addition continues with the bundling process even when the next statement 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.

As a programmer, when using NO FLUSH you must ensure that you do not rely on the content of the return parameters that have not yet been 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.

See also:

SET PROPERTY, CREATE OBJECT, CALL METHOD and FREE OBJECT.