Skip to Content
-2

How to acces object of attribute of an Object

Hi Guys.

I have a method parameter IP_OBJECT.

I need to access a atribute MPT_DLV and inside it a internal table.

I tryed by field symbol but did not work..Do you know a way to access this data and move to a internal table or variable?

thanks

1.png (25.3 kB)
2.png (27.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 10, 2017 at 05:47 PM

    If the attribute is protected or private, then it is not designed to be accessed. Search for a getter method.

    If you explain what the business requirement is, you might get answers that meet that. At the moment you've simply stated your preferred solution - which is not necessarily the best way of doing things.

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 11, 2017 at 12:59 PM

    Hello,

    We know nothing about your context but a best practice is to create a specific class with /SCA/CL_SVDELIVERY as superclass and create a method "get_mpt_dlv" returning mpt_dlv.

    Then you declare a new data (lets say LO_OBJECT_EXTENDED) refering to your new class. You can use cast operator ?= to copy IP_OBJECT to LO_OBJECT_EXTENDED and call LO_OBJECT_EXTENDED->get_mpt_dlv().

    Best regards

    Bertrand

    Add comment
    10|10000 characters needed characters exceeded