Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
ABAP
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Internal tables in ABAP== Internal tables are an important feature of the ABAP language. An internal table is defined similarly to a vector of ''struct''s in C++ or a vector of objects in Java. The main difference with these languages is that ABAP provides a collection of statements to easily access and manipulate the contents of internal tables. Note that ABAP does not support arrays; the only way to define a multi-element data object is to use an internal table.<ref>{{cite web |last= |first= |date= |title=Internal Tables |url=https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/fc/eb35de358411d1829f0000e829fbfe/content.htm?no_cache=true |website= |location= |publisher=SAP |access-date=}}</ref> Internal tables are a way to store variable data sets of a fixed structure in the working memory of ABAP, and provides the functionality of dynamic arrays. The data is stored on a row-by-row basis, where each row has the same structure. Internal tables are preferably used to store and format the content of database tables from within a program. Furthermore, internal tables in connection with structures are an important means of defining complex data structures in an ABAP program. The following example defines an internal table with two fields with the format of database table VBRK. <syntaxhighlight lang="abap"> * First define structured type TYPES: BEGIN OF t_vbrk, VBELN TYPE VBRK-VBELN, ZUONR TYPE VBRK-ZUONR, END OF t_vbrk. * Now define internal table of our defined type t_vbrk DATA : gt_vbrk TYPE STANDARD TABLE OF t_vbrk, gt_vbrk_2 TYPE STANDARD TABLE OF t_vbrk. "easy to define more tables * If needed, define structure (line of internal table) * Definition with type or with reference to internal table: DATA : gs_vbrk TYPE t_vbrk, gs_vbrk_2 LIKE LINE OF gt_vbrk_2. * You can also define table type if needed TYPES tt_vbrk TYPE STANDARD TABLE OF t_vbrk. </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)