ERP Database - The Unofficial ERP Knowledge Base

Facebook Twitter del.icio.us Digg it
ERP Database contains a huge collection of articles related to ERP System and Software. Many of the articles are specifically related to SAP. All these ERP/SAP articles are freely available to everyone.

If you would like to submit an article or share any document related to ERP or any specific ERP software. Please mail it to support@erpdb.info. Please make sure that the documents are not copyrighted.
Social Bookmarks:

ABAP Programs: Records and internal tables

Print This Post Email This Post Written by admin on Nov 5th, 2007 | Filed under: ABAP Programs

REPORT ZSOURCE0407.

* Records (or structures) consist of a fixed number of components
DATA: BEGIN OF CUSTOMER,
ID(8) TYPE N,
NAME(25),
TELEPHONE(12),
END OF CUSTOMER.

* Working with the different components and the structure itself
DATA VENDOR LIKE CUSTOMER.
CUSTOMER-ID = ’87654321′.
CUSTOMER-NAME = ‘Edison’.
CUSTOMER-TELEPHONE = ’111-111-1111′.
MOVE CUSTOMER TO VENDOR.
WRITE / VENDOR-NAME.

* Defining an internal table each entry having the structure of
* the record customer
DATA ALL_CUSTOMERS LIKE CUSTOMER OCCURS 100.

* Using a reference to a non-elementary type.
TYPES: BEGIN OF PERSONAL_DATA,
NAME(25),
CITY(25),
STREET(30),
END OF PERSONAL_DATA.
DATA PEOPLE TYPE PERSONAL_DATA OCCURS 300.

* Internal table with a header line, which is used as a default record
* to hold the record currently being added to the table
DATA NEW_CUSTOMERS LIKE CUSTOMER OCCURS 100
WITH HEADER LINE.

———————
ABAPer, mail: abap.community@gmail.com http://www.erpdb.info

Share

If you like this post, you may as well like these too:

  1. ABAP Programs: Using internal tables as snapshots of database tables REPORT ZSOURCE1103.* Work area for a database tableTABLES CUSTOMERS.* Internal tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Filling the internal table with all entries of the database tableSELECT...
  2. ABAP Programs: Internal tables with header lines REPORT ZSOURCE1202.* Work area for a database tableTABLES CUSTOMERS.* Defining an internal table with header lineDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Reading all entries of the database...
  3. ABAP Programs: Using Internal Tables for Selection Criteria REPORT ZSOURCE1112.* Work areasTABLES: CUSTOMERS, BOOKINGS.* Internal tablesDATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE, ALL_BOOKINGS LIKE BOOKINGS OCCURS 500 WITH HEADER LINE.* Reading entries from both database tableSELECT...
  4. Source Code: Working with database tables and internal tables REPORT ZSOURCE0103. * Declaration of a work area for a Dictionary tableTABLES CUSTOMERS. * Internal table used as snapshot of the database tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER...
  5. ABAP Tips on Data Dictionary and Internal tables Data Dictionary Maintenance Views Lock Objects Internal Tables Free text search in a field in a internal table Types of Internal Tables Working with Internal Tables...
  6. What are Internal Tables? Internal Tables are standard data type objects which exist only during the Runtime of an ABAP program. They are used to perform table calculations on subsets of database tables and...
  7. ABAP Programs: A simple internal table REPORT ZSOURCE1201.* Work area for a database tableTABLES CUSTOMERS.* Defining an internal tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100.* Reading all entries of the database table into the internal tableSELECT *...
  8. ABAP Programs: Working with tables from the Dictionary REPORT ZSOURCE0501. * Declaration of a work area for a Dictionary tableTABLES CUSTOMERS.* Reading all entries of the database table and displaying each entrySELECT * FROM CUSTOMERS. WRITE: / CUSTOMERS-NAME.ENDSELECT.———————ABAPer,...
  9. ABAP Programs: Internal flow of control (if, case, do, while) REPORT ZSOURCE0902. * Declarations for later useTABLES CUSTOMERS.DATA: COLOR(10) VALUE ‘yellow’, N(4) TYPE N VALUE ’123′, P TYPE P, C4(4) VALUE ’124′, C5(5) VALUE ’00124′, SQUARE_NUMBER TYPE I, X TYPE...
  10. ABAP Programs: Upload Excel to Internal table Here is a simple program which will upload the excel file to the internal table using the function module ‘TEXT_CONVERT_XLS_TO_SAP’. REPORT Z_EXCEL_2_ITAB. ************************************** * http://www.erpdb.info * ************************************** TYPE-POOLS: truxs. PARAMETERS:...
  11. ABAP Programs: Filling an internal table from a database table REPORT ZSOURCE1203.* Work area for a database tableTABLES CUSTOMERS.* Defining an internal table with header lineDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Filling the internal table (previous content...
  12. Important ABAP Tables Table Name = Table DescriptionADCP = Person/Address assignment (central address administration)ADIRACCESS = Table to store keys for TADIR objectsADR2 = Telephone numbers (central address admin.)ADRP = Persons (central address administration)APQD...
  13. ABAP: How to create a dynamic internal table and work area FIELD-SYMBOLS:<fs_table> TYPE STANDARD TABLE, <fs_table_wa> TYPE ANY. DATA: table_ref TYPE REF TO data, wa_ref TYPE REF TO data. DATA: l_structure TYPE dd02l-tabname value 'VBAP'.   CREATE DATA table_ref TYPE STANDARD...
  14. SAP FI FAQs – Overview of Master Records 1.    There are three primary types of data in the system.  What are they?  Describe each. Master Data is constant over a long period of time.  Transaction Data is created...
  15. SAP FI FAQs – G/L Account Master Records 1.    Discuss the concept of account groups and how they are used with respect to general ledger master data. The account group contains a number interval specified by a lower...



Leave a Reply