SAP OO OBS FIELD GROUPS 1

Get Example source ABAP code based on a different SAP table
  


ABAP Code Snippet
ARTICLE

No Definition of Field Groups in Methods
The statement FIELD-GROUPS is not allowed in methods.

Error message in methods if the following syntax is used:

METHOD ...
...
FIELD-GROUPS fg.
...
ENDMETHOD.
Reason:

An extract dataset currently exists only as a global object of the main program. Therefore the field groups can only be defined globally in the main program. However, the definition of the field group structure, which is generated at runtime by the statement INSERT ... INTO fg, can also be executed in methods.