문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top