SAP Database - The Unofficial SAP Knowledge Base

Hi Guest!
You can contribute to SAP Database on any topic. SAP Database might be the right place for your Ideas/Opinions to reach a larger audience.

SAP Forums

New to SAP Database? Register Now
Already a member? Login
Social Bookmarks:

ABAP Programs:Using Field Symbols for components of a structure

Print This Post Email This Post Written by admin on Jan 28th, 2008 | Filed under: ABAP Programs

REPORT ZSOURCE2403.
* Table work area for later use
TABLES CUSTOMERS.
* Defining a Field Symbol
FIELD-SYMBOLS <OUTPUT>.
* Displaying all fields of all table entries
SELECT * FROM CUSTOMERS.

NEW-LINE.
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE CUSTOMERS TO < OUTPUT>.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
WRITE < OUTPUT>.
ENDDO.
ENDSELECT.

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

  1. ABAP Programs: Simple examples of field conversion REPORT ZSOURCE0702. * Conv
  2. ABAP Programs: Internal flow of control (if, case, do, while) REPORT ZSOURCE0902. * Decl
  3. ABAP Programs: Working with Field symbols REPORT CHAP2401. * Definin
  4. ABAP Programs :Using Field Symbols for variable parts of fields REPORT ZSOURCE2402. DATA:
  5. ABAP Program : Working with Temporary Programs Ever had a need to create



Leave a Reply