Skip to Content
0
Former Member
Jun 13, 2004 at 11:32 PM

Error while passing attribute from 1 class to another class

14 Views

Hi,

I am not much into ABAP. Appreciate if u could help me with this. I am trying to pass an attribute from one class to another class. I am getting an error when accesing a class attribute from a method of another class.

I appreciate if anyone can atleast direct me to some good documentation on ABAP OO classes and methods.

Calling from

============

Super Class -


> SC1 = CL_RSR_WWW_HELP_WINDOW

CLASS -


> C1 (public) = Z_PRINT_HELP_SERVICE

METHOD----


> M1 (Instance Method, Private)

Class Attribute------> A1 (Instance Attribute, Private type STRING)

Method M1 needs Attribute A1 value.

Calling to

==========

Super Class -


> SC2 = CL_RSR_WWW_MODIFY_TABLE

CLASS -


> C2 (public) = Z_CL_RSR_WWW_MODIFY_TABLE

Class Attribute------> A2 (Instance Attribute, Public type STRING)

A2 has a value which has to be passsed to A1 of method M1 in Class C1.

here is the code for method M1.

method M1 .

DATA: A TYPE REF TO C2.

A1 = A->A2.

endmethod.

As I'm accessing these classes from Web, I am not sure what the error is except that browser says "page can't be displayed" without the values that are passed from A2 into A1.

there is no problem in the browser if i hard code the value in method 1 as follows.

method M1 .

A1 = 'value'.

endmethod.

hope it is clear.

thanks and appreciate any kinda help