Like/like table of/like line of small Solution

Source: Internet
Author: User

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 of itab occurs 0,
Col1 type I,
Col2 type I,
End of itab.

* & * Internal table and Structure
Data: itab1a like itab. "defines 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

* & Supports the 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

* ** & ** Only internal tables and structures can be followed.
Data: itab4a like line of itab. "defines 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.
Append itab.
Enddo.

Move itab to itab1a.
Move itab [] to itab1b [].
Move itab to itab1c.

Move itab [] to itab2b [].
Move itab to itab2c.

Move itab to itab4a.
Move itab [] to itab4b [].
Move itab to itab4c.

*&***

Supplement the usage of like range:

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.