Skip to Content
0
Former Member
Jan 06, 2005 at 11:14 AM

ABAP OO, Creating object dynamically

1057 Views

Hi everybody,

IÂ’m currently working on some Abap OO examples. Everything is working ok except for the following: Creating objects dynamically.

This is what IÂ’d like to do:

Lets say we obtain a bunch of sales orders using a simple select statement and place them in an internal table. For each entry in our internal table, IÂ’d like to generate a new sales order object. This salesorder object is a simple class with a constructor with an Id and some other attributes.

When this is done, IÂ’d like to append every object to a new object, say basket, so that this basket contains something like an internal table within each record a reference to the salesorder. Is this easy to do? IÂ’m using the example that is described in the sap guide (create object pointer type (class_name) but it looks to me that you still have to declare the reference variables before you can create the object.

Hmm, I think Java is better suited for a job like this.

Hope you can help,

Cheers and Best wishes

Laurens Steffers

The Netherlands.