Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
program is .
*declaration.
data: begin of inernaltable occurs 0,
x type c,
y type i,
end of itab.
*initializing headerline
internaltable-x = 'd'.
internaltable-y = 34.
*storing value into internal table
appene internaltable .
appene internaltable .
appene internaltable .
*reading internal table
loop at itab .
write: / internaltable-x, internaltable-y. "writes to output list
endloop.
No comments:
Post a Comment