Skip to Content
-2

How to acces object of attribute of an Object

Jul 10, 2017 at 02:34 PM

87

avatar image

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Matthew Billingham
Jul 10, 2017 at 05:47 PM
6

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.

Share
10 |10000 characters needed characters left characters exceeded
Bertrand DELVALLEE Jul 11, 2017 at 12:59 PM
1

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

Share
10 |10000 characters needed characters left characters exceeded