Search code examples
abaprtti

Assign Component of Class


We all know the ASSIGN COMPONENT name OF STRUCTURE TO <dest> command. I would like to use this command to access public attributes of classes. But according to the documentation (and unfortunately also my debugger), this does not work for classes.

Is there any possiblity to do that? Using classes, it always returns sy-subrc = 4.


Solution

  • Assuming that your reference variable is LR_FOO and the attribute name is BAR, you can use ASSIGN ('LR_FOO->BAR') TO <dest>.