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 do I export data object reference?

Former Member
0 Likes
485

Hello,

I have a reference variable declared as below -

DATA: go_myobject TYPE REF TO cl_gos_manager.

This should be made available in another program. Export statement gives an error stating go_myobject cannot be or contain a reference.

Please suggest.

Thanks,

Sita.

2 REPLIES 2
Read only

Nimesh_S_Patel
Explorer
0 Likes
414

Hi Sita,

Let's assume your program name in ZTEST and you written below code.

DATA: go_myobject.TYPE REF TO cl_gos_manager.

CREATE OBJECT go_myobject.

.

.

And have access methods of go_myobject.

If you want to access reference of go_myobject of program ZTEST from other program and your program ZTEST would available in Stack which I assumed your case. You can access reference by get variable (ZTEST)go_myobject from other programs.

Hope this helps.

Regards

Nimesh Patel.

Read only

SureshRa
Active Participant
0 Likes
414

Hi Sita,

I think you want to access the object instance when the current program has finished, from some other program at later stage.

The state of of any object instance is represented by the values of its attributes.

For this purpose, you need to export the object's attributes to the shared memory or database. Later in some other program, import those attributes, create an instance of that class and set these imported attribute values.

Regards

Suresh