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: 

how to move data in the field symbol to table

Former Member
0 Kudos

field symbol <it_mara> is having few records

and there is a work area <wa_mara>

now i have a table it_abc and work area wa_abc, with different structure ,but has some comman fields in it_mara.

how can i transfer the records in <it_mara> to the corresponding fields of table it_abc ?

table it_abc is not field symbol.its declared as table

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi, try like this:

Option 1.

FIELD-SYMBOLS: <AUX_FIELD> TYPE ANY.
ASSIGN COMPONENT 'YOUR_FIELD' OF STRUCTURE <wa_mara> TO <AUX_FIELD>.
wa_abc-YOUR_FIELD = <AUX_FIELD>.

Option 2.

DATA: ls_field type string.
FIELD-SYMBOLS: <AUX_FIELD> TYPE ANY.

MOVE '<wa_mara>-YOUR_FIELD' TO ls_field.
ASSIGN (ls_field) TO <AUX_FIELD>.
wa_abc-YOUR_FIELD = <AUX_FIELD>.

In case the Table <it_mara> has a define structure you can simple do:

wa_abc-YOUR_FIELD = <wa_mara>-YOUR_FIELD.

Bye, Andrew83.

Edited by: Andrew83 on Sep 15, 2008 4:18 PM

3 REPLIES 3

Former Member
0 Kudos

Hi, try like this:

Option 1.

FIELD-SYMBOLS: <AUX_FIELD> TYPE ANY.
ASSIGN COMPONENT 'YOUR_FIELD' OF STRUCTURE <wa_mara> TO <AUX_FIELD>.
wa_abc-YOUR_FIELD = <AUX_FIELD>.

Option 2.

DATA: ls_field type string.
FIELD-SYMBOLS: <AUX_FIELD> TYPE ANY.

MOVE '<wa_mara>-YOUR_FIELD' TO ls_field.
ASSIGN (ls_field) TO <AUX_FIELD>.
wa_abc-YOUR_FIELD = <AUX_FIELD>.

In case the Table <it_mara> has a define structure you can simple do:

wa_abc-YOUR_FIELD = <wa_mara>-YOUR_FIELD.

Bye, Andrew83.

Edited by: Andrew83 on Sep 15, 2008 4:18 PM

Former Member
0 Kudos

write ur code like

loop at <it_tab> assigning <fs_tab>.

wa_abc-field1 = <fs_tab>-field1.

wa_abc-field2 = <fs_tab>-field2.

append wa_abc into it_abc.

endloop.

Thanks & Regards,

Vivek Gaur

0 Kudos

Try this

FIELD-SYMBOLS: <fs_field> TYPE ANY.

ASSIGN COMPONENT work area field OF STRUCTURE work area TO <fs_field>.

workarea-field = <fs_field>.

Thanks & Regards,

Vivek Gaur