When I first started learning ABAP, I was always not very clear about the definition of like/like table of/like line!
Write down your understanding for future reference. If this is not the case, please correct me!
Data:Begin OfItabOccurs 0,
Col1Type I,
Col2Type I,
End OfItab.
* & * internal table, structure
data : itab1a like itab. "define a structure
data : itab1b like itab occurs 0 . "defines an internal table without a header
data : itab1c like itab occurs 0 with header line . "defines an internal table with a header
* & Internal table structure
data : itab2b like table of itab. "defines an internal table without a header
***** data: itab2b like table of itab occurs 0.
data : itab2c like table of itab with header line . "defines a header
***** & ** can only be used with internal tables, cannot follow the structure
data : itab4a like line of itab. "define a structure
data : itab4b like line of itab occurs 0 . "defines an internal table without a header
data : itab4c like line of itab occurs 0 with header line . "defines a header
Do 7 Times.
Itab-col1 = sy-Index.
Itab-col2 = sy-Index**2.
AppendItab.
Enddo.
MoveItabToItab1a.
MoveItab []ToItab1b [].
MoveItabToItab1c.
MoveItab []ToItab2b [].
MoveItabToItab2c.
MoveItabToItab4a.
MoveItab []ToItab4b [].
MoveItabToItab4c.
*&***
SupplementLikeRangeOf usage:
Definitions: Data: itab like range of MARA-MATNR.
(The above sentence defines a table, the structure is ranges Table structure, low with high value type is the type of MARA-MATNR.