2010 Jan 18 9:00 AM
Hello,
I am trying ABAP OO newly. How to pass a value to the export parameter for a method (public instance) called in a report? This *export parameter has a reference type of structure.
Thanks in advance,
Ranjini
2010 Jan 18 9:07 AM
Hi,
"class definition
class lcl... definition.
public section.
method m1 imporitng par type ref to data. "now you can pass any reference to the method, but this way you have to maintain this reference dynamically inside the method (you can't be sure what that reference is really "pointing" at)
endclass.
"in program
data: r_lcl type ref to lcl...
create object r_lcl.
call method r_lcl
exporting
par = "pass any reference variable here
Regards
Marcin
Hello,
I am trying ABAP OO newly. How to pass a value to the export parameter for a method (public instance) called in a report? This *export parameter has a reference type of structure.
Thanks in advance,
Ranjini
2010 Jan 18 9:07 AM
Hi,
"class definition
class lcl... definition.
public section.
method m1 imporitng par type ref to data. "now you can pass any reference to the method, but this way you have to maintain this reference dynamically inside the method (you can't be sure what that reference is really "pointing" at)
endclass.
"in program
data: r_lcl type ref to lcl...
create object r_lcl.
call method r_lcl
exporting
par = "pass any reference variable here
Regards
Marcin
2010 Jan 18 2:23 PM
Dont forget what you see as import parameter in SE80 are export parameters in your report.
A good tipp is to use the "Patterns" button in SE80, there you can choose your class and method name and get the syntax for calling that method.
Edited by: Richard Brünning on Jan 18, 2010 3:23 PM
2010 Jan 20 9:19 PM
...
if the method exists, then choose the class in the object tree in se80, drag and drop the method into the editor window with your report. This is much easier than the pattern method.
The object tree works independently from what is open in the object maintenance window. So you can choose report in the tree first, edit your report. Then choose class, the class of the chosen method, expand the tree and drag the method.
One of the few not perfect but extremely useful drag&drop functions in SAP.
Regards,
Clemens