11-28-2007 5:51 PM
11-29-2007 3:24 AM
Hi,
A field symbol is a pointer that you can assign dynamically to a field.
Memory is allocated to a field symbol during runtime only.
Assign statement is used to assign a field to it.
For example:
DATA: F1(3) VALUE 'XYZ'.
FIELD-SYMBOLS <f>.
ASSIGN F1 to <f>.
Regards,
Ferry Lianto
11-28-2007 7:25 PM
Field symbols provide greater flexibility when you address data objects:
* If you want to process sections of fields, you can specify the offset and length of the field dynamically.
* You can assign one field symbol to another, which allows you to address parts of fields.
* Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
* You can also force a field symbol to take different technical attributes from those of the field assigned to it.
Here U see <a href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm">full information</a>. But FIELD-SYMBOLS is just instrument. You must decide using it or not.
11-28-2007 7:36 PM
Hi,
Other very important point is that field symbol is much faster than using workarea, especially with READ and LOOP statement. Simply because the data moved from header line to workaera cost much more than pointing directly to it with field symbol.
Field symbol should also be use in cases where you determined dynamically (not know in advance) the type of your local variable.
Hopping this answer your question.
Sincerely,
Alain Gauthier
11-28-2007 7:39 PM
Hi,
Check this link.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm
Regards,
Maha
11-28-2007 8:00 PM
FIELD-SYMBOLS <fs>.
Declares a symbolic field with the name <fs>. At runtime, you can assign a concrete field to it using the ASSIGN statement. Any operations that you then perform using the field symbol directly affect the field that is assigned to it.
Advantage:
-
The main advantage is while processing the records inan internal table and appending to another internal table.
Just assign the values directly to fieldsymbol and no need to used append.
It increases the performance of the program.
Regards,
Satish
11-29-2007 3:24 AM
Hi,
A field symbol is a pointer that you can assign dynamically to a field.
Memory is allocated to a field symbol during runtime only.
Assign statement is used to assign a field to it.
For example:
DATA: F1(3) VALUE 'XYZ'.
FIELD-SYMBOLS <f>.
ASSIGN F1 to <f>.
Regards,
Ferry Lianto
11-29-2007 4:35 AM
HI
Field Symbols can be used if you want to populate work area having some serial
fields for eg : g_r_week1 to g_r_week10 .
LOOP AT ITAB.
CONCATENATE 'G_R_FILE-BWEEK' sy-tabix INTO l_f_week.
ASSIGN (l_f_week) TO <fsname>.
IF sy-subrc = 0.
CONDENSE:g_r_data_option1-weekno.
<fsname> = g_r_data_option1-weekno+4(2).
ENDIF.
ENDLOOP.
Hope this helps .
Praveen