SAP Database - The Unofficial SAP Knowledge Base

Free Business and Tech Magazines and eBooks

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: Working with Field symbols REPORT CHAP2401. * Defining a Field Symbol FIELD-SYMBOLS < FS>. * Variable for later use DATA FIELD VALUE 'X'. * Assigning a field to a Field Symbol ASSIGN FIELD TO...
  2. ABAP Programs :Using Field Symbols for variable parts of fields REPORT ZSOURCE2402. DATA: EXTERNAL_RECORD(4000), POSITION TYPE I, LENGTH TYPE N. FIELD-SYMBOLS < ENTRY>. EXTERNAL_RECORD = '0005Smith0007Edwards0005Young'. DO. LENGTH = EXTERNAL_RECORD+POSITION(4). IF LENGTH = 0. EXIT. ENDIF. ADD 4 TO POSITION....
  3. ABAP Programs: Using Symbols and Icons REPORT ZSOURCE0806. * Declaring symbols and iconsINCLUDE: , . * Displaying symbols and iconsWRITE: / SYM_PHONE AS SYMBOL, ‘telephone’, / SYM_FAX AS SYMBOL, ‘fax machine’, / SYM_LEFT_HAND AS SYMBOL, ‘hand...
  4. ABAP Programs: Simple examples of field conversion REPORT ZSOURCE0702. * Converting to numbers during computationsDATA: NUMBER_1(4) VALUE ‘1771′, NUMBER_2(3), RESULT TYPE I. NUMBER_2 = ‘005′.RESULT = NUMBER_1 + NUMBER_2.WRITE / RESULT. NUMBER_2 = ‘ 5′.RESULT = NUMBER_1...
  5. ABAP Symbols How To get these ABAP symbols in the program. Here is a sample program to generate ABAP symbols. ...



This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a Reply

  • Subscribe to RSS

  • Free Ebooks