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: 

order of local class definitions

heiko_witteborg
Explorer
0 Kudos

Hi,

I have a newbie question...

If I define 2 local classes in a report, the order of the class definitions seems to matter...?

E.g. everything is fine if I define class product before class item:

CLASS product DEFINITION.
  PUBLIC SECTION.
    ...
ENDCLASS.

CLASS item DEFINITION.
  PUBLIC SECTION.
    DATA quantity TYPE i.
    DATA orderedproduct TYPE REF TO product.        "referencing product!
ENDCLASS.

However, the other way round there is a syntax error (The type "PRODUCT" is unknown.) in the declaration line of orderedproduct. In this simple example it's easy to choose the right order but e.g. if product had an attribute of type item that's a problem... Some hints would be very helpful.

Thanks a lot,

Heiko

1 ACCEPTED SOLUTION

h_senden2
Active Contributor
0 Kudos

Then you have to use first :

CLASS class DEFINITION DEFERRED.

the real definition will take place later, but you can use the class for other definitions.\

regards,

Hans

2 REPLIES 2

h_senden2
Active Contributor
0 Kudos

Then you have to use first :

CLASS class DEFINITION DEFERRED.

the real definition will take place later, but you can use the class for other definitions.\

regards,

Hans

0 Kudos

Perfect, thanks!