Skip to end of metadata
Go to start of metadata

Author: Marcelo Ramos
Submitted: 07/11/2007

Related Links:

Class Definition

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
*----------------------------------------------------------------------*
*       CLASS main DEFINITION
*----------------------------------------------------------------------*
CLASS main DEFINITION.

  PUBLIC SECTION.

    METHODS get_value
            RETURNING value(r_data) TYPE REF TO data.

ENDCLASS.                    "main DEFINITION

Class Implementation

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
*----------------------------------------------------------------------*
*       CLASS main IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS main IMPLEMENTATION.

  METHOD get_value.

    FIELD-SYMBOLS <variable> TYPE ANY.

    DATA v_variable TYPE char2.
*   Here we're creating a new reference to Data v_variable
    CREATE DATA r_data LIKE v_variable.

*   Moving the reference to a field-symbols
    ASSIGN r_data->* TO <variable>.

*   Manipulating the content of the reference through field-symbols <variable>
    MOVE 'AB' TO <variable>.

  ENDMETHOD.                    "get_value

ENDCLASS.                    "main IMPLEMENTATION

Creation Object

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
DATA o_main TYPE REF TO main.

Defining Data

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
DATA v_variable TYPE char2.
DATA v_value TYPE REF TO data.

FIELD-SYMBOLS <variable> TYPE ANY.

Instance Creation

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
START-OF-SELECTION.

  CREATE OBJECT o_main.

Calling Methods

Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
* The method returns the reference of a data into v_value
  v_value = o_main->get_value( ).

* You can't access directly the Content of reference so, you must use
* dereferencing operator ->* to move values to a field-symbols
  ASSIGN v_value->* TO <variable>.* After make the dereferencing you can move the value of field-symbols to any Compatible Data
  MOVE <variable> TO v_variable.

* Now you can work with a Data that contains the value returned from method
  WRITE v_variable.

The atribute value is printed

"AB"