Skip to Content
author's profile photo Former Member
Former Member

Error while passing attribute from 1 class to another class

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

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 14, 2004 at 06:54 AM

    Hi,

    did you try the online documentation?

    http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm

    Also this might give you some ideas

    http://help.sap.com/saphelp_nw04/helpdata/en/48/ad3779b33a11d194f00000e8353423/frameset.htm

    The Basic question for me is: what is A?

    You should create a breakpoint in your method (http-Debugging should be active; see the settings); close all browsers and start your web application again. Then you should be able to debug also in web environment and see the problem for yourself.

    Heike

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Heike,

      thanks for your help. I couldn't able to deal the issue just with the print class. i was able to get the values into header with both print class and modify class as we can't touch the table contents from only the print class. Still, little bit of tweaking in needed for my task. anyhow, thanks so much

      hari