Skip to Content
0
Former Member
Mar 16, 2007 at 10:11 AM

ABAP Object - beginner problems

62 Views

Hi all,

i got a little problem with understanding the logic of ABAP Objects. For example the object material. The material has a number, text, size and so on. That's no problem i can define a class with the attributes number, text size and so on and I can create an object. But how do I interact with more than one object. I want to read 100 materials from the database and after that i want to list them in an alv grid. Do I have to create hundred objects?

REPORT Test.

CLASS material DEFINITION.

PUBLIC SECTION.

DATA:

number TYPE i,

text(20) TYPE c,

size TYPE c.

ENDCLASS.

CLASS material IMPLEMENTATION.

ENDCLASS.

DATA:

obj_material TYPE REF TO material.

START-OF-SELECTION.

????????

CREATE OBJCET obj_material.

SELECT * FROM mara INTO obj_material??????

Don't know how to....

Thanks

Matthias Tripp