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

Can I transfer Object reference between two Reports???

Former Member
0 Likes
701

Hi,

have anyone an idea, how I can transfer a reference of a Object(class) from "Report_1" to "Report_2" ??

In my report_1 i create a Object of a Class and use their Methods to add some data.

In Report_2, i want show the added list with a simple get-Method, but for this i need a reference of this Object which i have in Report_1 created.

Can anyone help me???

With kind regards

ETN

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
631

HI,

Create a subroutien with parameters <reference type > in report 2 with whatever the necessary code and call

that subroutien in report 1.

perform <sub-name> in program <report> using <your reference> .

Regards and Best wishes.

4 REPLIES 4
Read only

Former Member
0 Likes
631

1) Accessing an instance attribute attr: oref->attr

2) Calling an instance method meth: [CALL METHOD] oref->meth

3) Accessing a static attribute attr: class=>attr

4) Calling a static method meth: [CALL METHOD] class=>meth

Read only

0 Likes
631

Thanks for your idea,

but I have a complex Class and their Methods are sadly instances and not static.

For example:

REPORT1:_

DATA: oref TYPE REF TO class_example.

CREATE OBJECT oref.

CALL METHOD oref->add

EXPORTING key = 5524

value = 'HELLO SAP'.

SUBMIT report_2 AND RETURN.

REPORT2:_

DATA result TYPE c LENGTH 50.

CALL METHOD oref->get

EXPORTING

key = num_key

IMPORTING

value = result.

MESSAGE result TYPE 'I'.

MY QUESTION IS: How can i give the Reference of the current Object, which i have created in Report_1 ?

Because I must call the get-method in Report_2.

Read only

Former Member
0 Likes
632

HI,

Create a subroutien with parameters <reference type > in report 2 with whatever the necessary code and call

that subroutien in report 1.

perform <sub-name> in program <report> using <your reference> .

Regards and Best wishes.

Read only

Former Member
0 Likes
631

Thanks, but i have found a solution with ABAP Memory!!!