Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to read type ref object?

ronaldo_aparecido
Contributor
0 Kudos

Hi Guys.

I have a object:

Inside it has :

and inside has a strutucre that i need .

how can i get this structure with this data?

I try assign but didnt work.

FIELD-SYMBOLS:<trq_id> type any.

ASSIGN COMPONENT 'TRQ_ID' of STRUCTURE IS_DATA to <trq_id>.

if <trq_id> is assigned.

  endif.

Thanks

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Try to derefence the IS_DATA (REF TO DATA?) with an ASSIGN ->*


* Dereference

ASSIGN is_data->* TO <structure>.

* Assign components

ASSIGN COMPONENT 'TRQ_ID' of STRUCTURE <structure> to <trq_id>.

Regards,

Raymond

6 REPLIES 6

Former Member
0 Kudos

Hi Ronaldo,

first part I want to check with you:

From where do you want to access the structure? if it is oustside of the class, check if you can "see" the structure is_data.

0 Kudos

Hi,

IS_DATA is an object, so if the structure is public, you can simply access by

local_structure = IS_DATA->structure.

if the structure is private you have to write a method to get it outside the object.

(if the structure is static public, you access it by IS_DATA=>strucutre)

regards

Stefan Seeburger

0 Kudos
IS_DATA is an object,

on the first screenshot it shows that is_data is a structure...

is_data is a reference on data, not a reference on an instance of a class (object),

and guessing from the Type of the structure it is dynamically created

raymond_giuseppi
Active Contributor
0 Kudos

Try to derefence the IS_DATA (REF TO DATA?) with an ASSIGN ->*


* Dereference

ASSIGN is_data->* TO <structure>.

* Assign components

ASSIGN COMPONENT 'TRQ_ID' of STRUCTURE <structure> to <trq_id>.

Regards,

Raymond

0 Kudos

you were faster, this should work,

let me explain what went wrong:

as is_data is a reference and no structure itself it has no component with the name trq_id

is_data->* is no reference anymore, it represents the value that reference is pointing on

0 Kudos

Thanks Mr Raymond