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: 

Assigning data from field symbols

Former Member
0 Kudos

Hi All,

How can I get data from field symbols standard table.

Eq. i have declared as follows

Field-symbols : <fs_table> type standard table.

and i have filled some data to this table <fs_table>

Now looping the data and need to take back to one structure which is of same type as <fs_table>

if i try to assign values as follows i get an error message.

tablename-field1 = <fs_table>-field1. where field1 are same

1 ACCEPTED SOLUTION

peter_ruiz2
Active Contributor
0 Kudos

Hi Praveen,

You need to create another field symbol and code like this.


FIELD-SYMBOLS: <field> TYPE ANY.

ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <fs_table> TO <field>.

now, pass the value like this.

tablename-field1 = <field>.

regards,

Peter

4 REPLIES 4

Former Member
0 Kudos

How can you assign

itab1-field = <fs>-f1

you need to assign it like

wa-f1 = <fs>-f1

where wa and fs are of same type

also later on append wa to itab.

Regards

Bhanu

0 Kudos


data: itab type table of table_name.
fieldsymbols: <wa> type line of itab.

loop at itab assigning <wa>
  itab-field1 = <wa>-field1.
endloop.

peter_ruiz2
Active Contributor
0 Kudos

Hi Praveen,

You need to create another field symbol and code like this.


FIELD-SYMBOLS: <field> TYPE ANY.

ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <fs_table> TO <field>.

now, pass the value like this.

tablename-field1 = <field>.

regards,

Peter

Former Member
0 Kudos

This message was moderated.