Frage

I have a question about ABAP:

What is the difference between the two statements:

tables mara.

and

data: test type mara.

is it now quite the same?t

War es hilfreich?

Lösung

tables mara. 

declares an internal table with header, structure of line of the internal table is defined as transparent table mara.

it is proposed not to use a internal table with header, because this is confusing.

data: test type mara.

declares an work area with structure defined as transparent table mara, in another words the structure has same field as the table mara.

Andere Tipps

The tables statement declares a work area for a data dictionary table/structure and is generally used for logical databases. The data statement is used to create a variable of any type DDIC, local or temporary.

So the tables statement doesn't really let you define any variable you would like and generally should only be used for logical databases since like header lines on internal tables it makes your code somewhat obscure (there is a reason header lines and tables statements are no longer supported in OO Abap).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top