Shared Top Border

Enterprise Resource
Planning Portal

 

Advertise | Founder BLOG

ERPGenie.COM ABAP Tips and Tricks Database

THE ultimate
ERP website

 

Forums | Vote for us |

Google    Other Search Options

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

Google Ads

Shared Bottom Border

Contact Us | Polls | Add URL | Contribute | Privacy | Terms | Feedback

Discussion Forum | BLOG | Consultants: Post your resume | Companies: Advertise on ERPGenie.COM | Post Job
Financials Consultant | Consultant Review | Gallia Consulting | Supply Chain Project | SAP Financials Forum
GenieHoldings.COM, Inc. | Genie Press | WorkflowGenie | ESAGenie | ERPTopSites | ABAP Tips and Tricks | SAP Solutions Database

EDIGenie | Searching Survivor