Show TOC

DATA CodeLocate this document in the navigation structure

Use

The DATA section allows you to declare data used in other sections of code. In query reports, this section appears before all other event key words, so that the declared data is known to, and available in, all other sections of code.

You use the DATA section mainly to declare variables (e.g. number variables, counters, additional field strings, field symbols) which are required for performing calculations in other sections of code or specifying values for key fields of a linked additional table.

You are strongly recommended to declare all such variables in the DATA section rather than "hiding" them in any other sections. Otherwise, resolving syntax check errors becomes an unnecessarily complicated procedure. The DATA section is transparent to the end-user.

To create or maintain DATA code from the InfoSet maintenance screen, choose the symbol Code. With the aid of F4 help, you can then choose the code type. An editor is called where you see an existing DATA section or you can create a new one.

You can choose Check to check your code for syntax errors.

When declaring data, you can use LIKE to refer to any objects defined in the ABAP Dictionary. You cannot refer to additional fields.

If you want to delete DATA code, you can do this from within the editor for DATA definition.