Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ABAP OO: how to pass a internal table with objects as a method parameter

Hello all,

I have a class "ZCL_VEHICLE", this class contains the attribute WHEELS.

This attribute contains objects of the class ZCL_WHEEL.

(definition: data WHEELS TYPE TABLE OF REF TO zcl_wheel.).

I now need a method that gives this table back (as return or export parameter). How can I define a parameter for this method that will contain this table?

Thanks for the help.

Best regards,

Wim

Tags:
Former Member replied

hi, you can define a table type, assume named as ZWHEELTB.

From se11, you can create a table type,

in the LineType tab, you choose 'Reference type' and choose the class ZCL_WHEEL as the line type.

Then in the method, you just need to define an o/p, type ZWHEELTB.

My suggestion is base on WAS 6.4.

Hope it will be helpful

Thanks

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question