ABAP Study Notes 4-pointer

Source: Internet
Author: User

Some information about the ABAP pointer.

1. What is the ABAP pointer:
In ABAP, field symbol is equivalent to the pointer of C language. If you define and assign the corresponding structure or variable to it, it actually points to the address of this structure or variable. If you modify the value of field symbol, the value of the corresponding structure or variable is also changed.
2. How to define pointers:
Basic Format: field-symbols.
Additional information:
1... type: Define a data type, and then define a pointer
2... type ref to: pointer pointing to class or interface
3... type ref to: pointer pointing to Data Structure
4... type line of: Row item of the table in the pointer
5... like: the pointer is of the database table type.
6... like line of: Row item of the database table Type
7... type
3. How to allocate pointers:
(1). Assign F to.: allocate a pointer, which includes the following types:
1 ...... casting...: mainly for Unicode system operations
1A... casting
1B... casting type
1C... casting... decimals Dec
1D... casting like F1
2... type: directly specify the type
3... decimals dec: specifies the number of decimal places
4... Range: specified range
(2) assign a field in the structure to the pointer.
Assign component idx of structure struc.
Assign component name of structure struc.
(3) Assign the class method to the pointer
Assign DREF-> *.
(4) from F, the content after the length of F is assigned to the pointer.
Assign F increment n.
(5) assign a local variable to the pointer.
Assign local copy
3A. Assign local copy of F.
3B. Assign local copy of initial F.
3c. Assign local copy of initial line of itab.
4c. Assign local copy of main table field (f).
(6). Assign dynamicj: dynamically allocates pointers.
4A. Assign (f).
4b. Assign oref-> (f).
4c. Assign (F1) => (F2).
4d. Assign table field (f).
4e. Assign local copy of main table field (f).
4f. Assign local copy of... (f).
4. How to cancel allocation:
Unassign.

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.