2011 Feb 11 3:49 AM
Hi Experts,
I have a Z class with 2 Instance Method. I want to create a global table and assign value in one method and retrieve the value in the 2nd method. I declared a data type of type standard table in the public section and I able to assign values in one method but the value is not available in the 2nd method.
Since both are Instance method I am unable to add any new parameter to the methods. Any suggestion on how to make the table value available in both the methods?
you set the "attributes of an class attribute" - make it a Static Attribute and Private - as you want to access that attribute only from methods, it doesn't have to be public
2011 Feb 11 4:29 AM
2011 Feb 15 4:04 PM
you set the "attributes of an class attribute" - make it a Static Attribute and Private - as you want to access that attribute only from methods, it doesn't have to be public
2011 Mar 12 6:17 AM
2011 Mar 14 8:37 PM
Halo Srinivas,
I think you are missing something here. You have two options
1 Either you make this internal table as an attribute . So this attribute can be accessed by all the methods in the class . You fill up the attribute in first method and access the same in the second method
2 You fill up this internal table in the first method . This first method should have a returning parameter of that table type .This retruning table should be passes as the importing parameter of the second method.
lt_table = me->first_method( ).
me->second_method( it_table = lt_table ).
In the second case you have all the data available locally inside the methods
Regards
Arshad
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |