Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Help on Field symbols.

Former Member
0 Kudos

Hi,

Please give me the example of Field symbols

how Field symbols are assigned and how they are processed with in a loop.

with small code explain using (using two tables mara,marc) tables.

Thanks in advance

Regards,

rakesh

Moderator message - Welcome to SCN.

Moderator message - Unfortunately, this is not the place to ask basic questions. Please ask a specific question - post locked

Edited by: Rob Burbank on May 5, 2009 4:39 PM

4 REPLIES 4

Former Member
0 Kudos

HI,

You can use Field Symbols for working with internal tables. It is a good practice to use field symbols.

These are the links about general theory behind field symbols, data references and for using field symbols for internal table operations::

[http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm]

[http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm]

Hope this will solve your problem.

Thanks & Regards,

Pavan.

Former Member
0 Kudos

Hi,

Field symbols are nothing but dynamic memory allocations. so we need to assign field symbols. If we are using field symbols which are not assigned then program will go to dump. we should be very careful while using field symbols. Please go through the following code which will help you in understanding about field symbols

if <fs> is assigned.

unassign <fs>.

endif.

loop at it_marc assigning <fs>.

check <fs> is assigned.

move <fs> to wa_marc.

append wa_marc to it_marc.

clear wa_marc.

endloop.

Former Member

Former Member
0 Kudos

Hi,

Field symbols are something like pointers which point to the contents of the field/internal table.

Syntax to declare:

FIELD-SYMBOLS <FS> type STRUCTURE .

Assigning field symbol to some field:

ASSIGN var1 TO <fs>.

Changes to field symbol will affect the contents of the field/internal table directly.

For further info:

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb387a358411d1829f0000e829fbfe/content.htm

You can find the examples on field symbols in TCODE: ABAPDOCU.

under the ABAP Programming Lanuage->Basic Statements.

Thanks & Regards,

Krishna Chaitanya G

Edited by: Krishna Chaitanya G on May 5, 2009 10:27 PM

Edited by: Krishna Chaitanya G on May 5, 2009 10:28 PM

Edited by: Krishna Chaitanya G on May 5, 2009 10:29 PM