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

Field symbols are not asssigned

Hi all,

I have to us field symbols instead of work area, i am getting an error as field symbols are not assigned,

This is how i declared filed symbols.

DATA:TS_BKPF TYPE TABLE OF y_bkpf ,

FIELD-SYMBOLS: <fs_y_bkpf> TYPE ANY TABLE.

.FIELD-SYMBOLS: <fs> TYPE y_bkpf.

.

.

.

.

LOOP AT ts_bkpf ASSIGNING <fs>.

e_struct1-bukrs = <fs>-bukrs.

when i debug, fs has no value assigned to it.

Please Help.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 11, 2015 at 11:03 AM

    Hello,

    1. IF ts_bkpf IS NOT INITIAL.
    2. LOOP AT ts_bkpf ASSIGNING <fs>.
    3. e_struct1-bukrs = <fs>-bukrs.
    4. ENDLOOP.
    5. ELSE.
    6. WRITE: 'The table TS_BKPF is empty'.
    7. ENDIF.
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 12, 2015 at 02:14 AM

    Anisha


    That question has already received several positive response, I believe that can already be closed.

    You should make a check on ts_bkpf internal table if it is empty, does not enter the loop.

    The declaration of the field symbol is either declared as:

    field-symbols <fs> type y_bkpf.

    or

    field-symbols <fs> like line of ts_bkpf.

    In both situations will be handled as a line.


    BR,


    Raphael Pacheco.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 11, 2015 at 10:54 AM


    Hi Anisha,

    This error could be due type mismatch of structures y_bkpf and ts_bkpf. Declare <fs> as TYPE ANY and try again.

    Thanks,

    Leena

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 11, 2015 at 11:15 AM

    Hi Anisha,

    If you are working in ABAP 7.40, you could use the new pattern:-

    LOOP AT t_bkpg ASSIGNING FIELD-SYMBOLS(<fs>).

    ENDLOOP.

    Could you please list the structure type y_bkpf fields?

    Check if the <fs> is assigned.

    IF <FS> IS ASSIGNED.

    e_struct1-bukrs = <fs>-bukrs.

    ENDIF.

    Thanks,

    Sharath

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 11, 2015 at 11:21 AM

    Declare as below and try,

    Field-Symbols:<fs> like line of ts_bkpf.

    loop at ts_bkpf assigning <fs>.

    e_struct1-bukrs = <fs>-bukrs.

    endloop.

    Also check if the table ts_bkpf is not initial.

    Hope this helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 12, 2015 at 08:55 AM

    Hi Anisha,

    if ts_bkpf is initial.: then it will go in short dump.

    after loop statement.

    if its initial then assing some dummy value, later u can unassign that.

    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.