Application Development and Automation 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: 
Read only

How to read type ref object?

ronaldo_aparecido
Contributor
0 Likes
3,955

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
Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,426

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
Read only

Former Member
0 Likes
2,426

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.

Read only

0 Likes
2,426

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

Read only

0 Likes
2,426
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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,427

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

Read only

0 Likes
2,426

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

Read only

0 Likes
2,426

Thanks Mr Raymond