2009 Aug 04 12:12 PM
Hi!
I think it will be easy for you, but it's still unclear for me.
I've created a class in SE24 called ZCL_HK with a method called TEST, please read the following code.
DATA: hk TYPE REF TO ZCL_HK.
CREATE OBJECT hk.
CALL METHOD hk->test.
CALL METHOD hk->test.
CALL METHOD hk->test.
CREATE OBJECT hk.
CALL METHOD hk->test.
CALL METHOD hk->test.
CREATE OBJECT hk.
CALL METHOD hk->test.
Each create object statement creates a new instance of the class.
My question is, now, how can I access the 3 different instances and their methods and attributes? I mean now I wanted to access both the 1st and the second instances attributes, not only the third...
Thank you
Tamás
Edited by: Tamás Nyisztor on Aug 4, 2009 1:13 PM
2009 Aug 04 12:24 PM
hi,
you need to create 3 object ref variable with different name like hk1, hk2, .... of the same class... then use the create object statement to create 3 different instances ..... then you can access all their methods and respective attributes.
hope this will surely help you!!!
thanks & regards,
Punit Raval.
hi,
you need to create 3 object ref variable with different name like hk1, hk2, .... of the same class... then use the create object statement to create 3 different instances ..... then you can access all their methods and respective attributes.
hope this will surely help you!!!
thanks & regards,
Punit Raval.
2009 Aug 04 12:24 PM
hi,
you need to create 3 object ref variable with different name like hk1, hk2, .... of the same class... then use the create object statement to create 3 different instances ..... then you can access all their methods and respective attributes.
hope this will surely help you!!!
thanks & regards,
Punit Raval.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |