Skip to Content
author's profile photo Former Member
Former Member

what are filed simbols and filed groups

what are filed simbols and filed groups?

Regards,

pandu.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 12:29 PM

    Hi

    Field Symbols

    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.

    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.

    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.

    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.

    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.

    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.

    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.

    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.

    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.

    check the below links u will get the answers for your questions

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

    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm

    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html

    Syntax Diagram

    FIELD-SYMBOLS

    Basic form

    FIELD-SYMBOLS <fs>.

    Extras:

    1. ... TYPE type

    2. ... TYPE REF TO cif

    3. ... TYPE REF TO DATA

    4. ... TYPE LINE OF type

    5. ... LIKE s

    6. ... LIKE LINE OF s

    7. ... TYPE tabkind

    8. ... STRUCTURE s DEFAULT wa

    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.

    Effect

    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.

    You can only use one of the additions.

    Example

    Output aircraft type from the table SFLIGHT using a field symbol:

    FIELD-SYMBOLS <PT> TYPE ANY.

    DATA SFLIGHT_WA TYPE SFLIGHT.

    ...

    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.

    WRITE <PT>.

    Addition 1

    ... TYPE type

    Addition 2

    ... TYPE REF TO cif

    Addition 3

    ... TYPE REF TO DATA

    Addition 4

    ... TYPE LINE OF type

    Addition 5

    ... LIKE s

    Addition 6

    ... LIKE LINE OF s

    Addition 7

    ... TYPE tabkind

    Effect

    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.

    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.

    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.

    Effect

    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.

    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.

    Example

    Address components of the flight bookings table SBOOK using a field symbol:

    DATA SBOOK_WA LIKE SBOOK.

    FIELD-SYMBOLS <SB> STRUCTURE SBOOK

    DEFAULT SBOOK_WA.

    ...

    WRITE: <SB>-BOOKID, <SB>-FLDATE.

    Field Groups

    Field groups use a mechanism called extract to store and process data. You define a header and then line structure and the fields that you would like those to have and process them fairly similarly to a table; unless you are dealing with millions of records.

    Since internal tables have fixed line structures, they are not suited to handle data sets with varying structures.

    An extract is a sequential dataset in the memory area of the program. You can only address the entries in the dataset within a special loop. The index or key access permitted with internal tables is not allowed. You may only create one extract in any ABAP program. The size of an extract dataset is, in principle, unlimited. Extracts larger than 500KB are stored in operating system files. The practical size of an extract is up to 2GB, as long as there is enough space in the file-system.

    Reward points if this explains well

    Kiran

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 17, 2008 at 12:29 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2008 at 12:36 PM

    A field group combines several existing fields together under one name

    like

    FIELD-GROUPS: fg.

    then you can use one insert statement to insert values in fields of field-group.

    INSERT f1 f2 ... INTO fg.

    Field symbols

    If u have experience with 'C', then understand this to be similar to a pointer.

    It is used to reference another variable dynamically. So this field symbol will simply point to some other variable. and this pointer can be changed at runtime.

    FIELD-SYMBOLS <FS>.

    DATA FIELD VALUE 'X'.

    ASSIGN FIELD TO <FS>.

    WRITE <FS>.

    Field symbols: are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.

    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.

    Field Groups:

    A field group is a user-defined grouping of characteristics and basic key figures from the EC-EIS or EC-BP field catalog.

    Use

    The field catalog contains the fields that are used in the aspects. As the number of fields grows, the field catalog becomes very large and unclear. To simplify maintenance of the aspects, you can group fields in a field group. You can group the fields as you wish, for example, by subject area or responsibility area. A field may be included in several field groups.

    When maintaining the data structure of an aspect, you can select the field group that contains the relevant characteristics and basic key figures. This way you limit the number of fields offered.

    Field Groups / Extracts

    http://help.sap.com/saphelp_46c/helpdata/EN/9f/db9ede35c111d1829f0000e829fbfe/frameset.htm

    Field Symbols

    http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb387a358411d1829f0000e829fbfe/frameset.htm

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.