on 01-05-2019 5:04 AM
Hi Experts,
I am trying to access a table from the dynamic object for which I am not able to read it. Below is the syntax I fave tried.
ASSIGN <FS_DATA>->('MT_DATA') TO FIELD-SYMBOL(<FS_IT>).
ASSIGN ('<FS_DATA>->MT_DATA') TO FIELD-SYMBOL(<FS_IT>).
Note that it will always remain impossible to overtake the visibility rules (for instance it wouldn't work if the attribute is private and you try to assign it from outside the class).
PS: the title of your question is incorrect because it's more about accessing an object attribute dynamically.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
eshwarbogaraju That "didn't work" because of the visibility rules, as I have explained. Don't you see your attribute is protected? (so you can access it only from a subclass or a friend class).
So, that's another question.
To access a protected or private attribute, you have the possibility to enhance the standard (enhancement framework) to add a custom public method which returns this attribute, then you may call your public method from any place (because it's public).
Thanks Sandra Rossi,
Information you have provided was useful. Anyways I have used standard class and method through which I can get those values through casting.
Hi Eshwar,
Check and try the below line
ASSIGN COMPONENT 'MT_DATA' OF STRUCTURE <FS_DATA> TO FIELD-SYMBOL(<FS_IT>).
Regards
Rajkumar Narasimman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.