Skip to Content

Assigining a field of field symbol to variable.

Dear friends,

in my field symbol <FS_DYN_TABLE_TEMP> i have a field named US_VAL which i want to assign to a variable.

but when i give <FS_DYN_TABLE_TEMP> -US_VAL it throws a syntax error sayin:-

"The data object "<FS_DYN_TABLE_TEMP>" has no structure and therefore no component called "US_VAL". called "US_VAL"."

How do i assign this to a variable.?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 05:35 AM

    Hi Rahul,

    is <FS_DYN_TABLE_TEMP> this a dynamic internal table which you are using?.

    if yes,

    First you have to create a work area for your dynamic internal table and then with that dynamic internal table you should access the data in that dynamic table to put into another variable.

    creating work area for your dynamic internal <FS_DYN_TABLE_TEMP>.

    field-symbols: <dynline> type any.

    data: wa_dyntable type ref to data.

    create data wa_dyntable like line of <dyntable>.

    assign wa_dyntable->* to <dynline>.

    here, <dyntable> is the dynamic internal table.

    (but <dyline> will act like a header line.)

    say suppose this dynamic internal table <dyline> has 3 components,

    F1 F2 F3.

    then you can take the data into some field-symbol by,

    field-symbols : <fs1>.

    assign component 'F1' of structure <dynline> to <fs1>.

    here, <fs1> will have the same characteristics of F1 field of <dyntable> [as <dyline> has the header line F1 F2 F3].

    <fs1> = wa_data-matnr.[pushing the required value into <fs1>.]

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 04, 2007 at 05:52 AM

    Hi Rahul,

    Look below for example how to assignn value to field symbol.Hope this would help you.

    Reward if useful.

    Thnkx.

    DATA: NUM TYPE I VALUE 12.

    FIELD-SYMBOLS: <F1>,

    <F2> TYPE I,

    <F3> LIKE NUM.

    ASSIGN: NUM TO <F1>,

    NUM TO <F2>,

    NUM TO <F3>.

    WRITE: / ‘Line 1:’, NUM, <F1>, <F2>, <F3>.

    <F1> = 32.

    WRITE: / ‘Line 2:’, NUM, <F1>, <F2>, <F3>.

    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.