Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to acces object of attribute of an Object

ronaldo_aparecido
Contributor
0 Kudos

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 ACCEPTED SOLUTION

matt
Active Contributor

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.

2 REPLIES 2

matt
Active Contributor

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.

bertrand_delvallee
Active Participant

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