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

What are field symbols and field groups.? Have you used "component idx of s

What are field symbols and field groups.? Have you used "component idx of structure"

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 04:53 AM

    Field Symbols and field groups

    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

    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.

    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

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 04:57 AM

    ASSIGN COMPONENT idx OF STRUCTURE struc TO <fs>.

    ASSIGN COMPONENT name OF STRUCTURE struc TO <fs>.

    refer the below link

    Create Internal table with fields coming as query result of multiple tables

    example :

    DATA: BEGIN OF SPTAB OCCURS 0,

    line(1000), " or type string

    END OF SPTAB.

    DATA: IDX LIKE SY-INDEX.

    field-symbols <FS1>.

    split tb_sip AT ';' INTO table sptab.

    LOOP AT SPTAB.

    IDX = IDX + 1.

    ASSIGN COMPONENT IDX OF STRUCTURE tb_detsip TO <FS1>.

    If sy-subrc = 0.

    <FS1> = SPTAB-line.

    Endif.

    Endloop.

    append tb_detsip.

    clear idx.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 11, 2007 at 05:03 AM

    HI,

    field-symbol is just like pointer and field-group is just like structure(group of data types)

    DATA: BEGIN OF LINE OCCURS 0,

    COL1 TYPE I VALUE '11',

    COL2 TYPE I VALUE '22',

    COL3 TYPE I VALUE '33',

    END OF LINE.

    DATA COMP(5) VALUE 'COL2'.

    FIELD-SYMBOLS: <F1>, <F2>, <F3>.

    ASSIGN LINE TO <F1>.

    ASSIGN COMP TO <F2>.

    DO 3 TIMES.

    ASSIGN COMPONENT SY-INDEX OF STRUCTURE <F1> TO <F3>.

    WRITE <F3>.

    ENDDO.

    ASSIGN COMPONENT <F2> OF STRUCTURE <F1> TO <F3>.

    WRITE / <F3>.

    <b>reward if helpful</b>

    rgds,

    bharat.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi, Bharat Kalagara.

      The whole question is this: What are field symbols and field groups? Have you used "component idx of structure" clause <b>with field groups?</b>

      I think the second question is wrong, it should be 'with field symbols', am I right?

      Regards,

      feng.

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.