Warning: include_once(http://erpgenie.com/_borders/topabap.htm) [function.include-once]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/templates/rhuk_solarflare_ii/index.php on line 52

Warning: include_once() [function.include]: Failed opening 'http://erpgenie.com/_borders/topabap.htm' for inclusion (include_path='.:') in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/templates/rhuk_solarflare_ii/index.php on line 52

Login

Login to view more content!!!





Lost Password?
No account yet? Register

Registered Access

Poll

What area of ABAP are you interested in?
 
Home arrow Tips and Tricks arrow General arrow Working with Field Symbols
Working with Field Symbols PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Anon.   
Friday, 23 February 2007
FIELD-SYMBOLS <FS>.
* Variable for later use
DATA FIELD VALUE 'X'.
* Assigning a field to a Field Symbol
ASSIGN FIELD TO <FS>.
* Using a Field Symbol which has an assigned field
WRITE <FS>.

--------------------------------------------

Using Field Symbols for variable parts of fields 

-------------------------------------------- 

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.
  ASSIGN EXTERNAL_RECORD+POSITION(LENGTH) TO <ENTRY>.
  WRITE <ENTRY>.
  ADD LENGTH TO POSITION.
  IF POSITION >= 4000.
    EXIT.
  ENDIF.
ENDDO.

--------------------------------------------

Using Field Symbols for components of a structure

--------------------------------------------

* 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.


Related Items:

 
< Prev   Next >

Google Search

Statistics

Contribution Activity
Utilities: 38
Tips and Tricks: 333
Sample Code: 164
Total Contributions: 550

Member Activity
Members: 6244 since 2/1/2007!
New: 0 since yesterday!
Visitors: 1080658
We have 7 guests online

Newest Members

Welcome our newest members:

Google Ads


Warning: include(http://erpgenie.com/_borders/bottom.htm) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/includes/footer.php on line 22

Warning: include() [function.include]: Failed opening 'http://erpgenie.com/_borders/bottom.htm' for inclusion (include_path='.:') in /var/www/vhosts/erpgenie.com/httpdocs/abaptips/includes/footer.php on line 22