Message code messageg.5
==> There shocould only be definitions in the top include (or
Nested events des within it). This means that all kinds
Implementation (class... implementation, not meaningful. Is
Not meaningful.
Assuming that the error is caused by a function group then it means that the top include of this function group shoshould contain data type definitions only. if the top include contains local class definitions and implementations then move the implementations in... FXX regiondes.
For an example have a look at function group mereq:
-Top include-> contains include lmereqdxx-> contains local classDefinitions
-Main Report-> contains include lmere0000xx-> contains further provided des with local classImplementations
It seems you have defined a Class & implemented as well in the top include of your program.
Remove the implementation part of your class from top inlcude & add it to the main program.
Top include shoshould only have definition/data declarations.
The message which sap provides is misleading. But, when you click on display/change on the message, it points towards the segment which is not supposed to be in top include.
In my scenario, it was a selection screen event which was in the top include.
Digest: http://scn.sap.com/thread/679242