09-15-2008 3:07 PM
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
09-15-2008 3:14 PM
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
09-15-2008 3:14 PM
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
09-15-2008 3:16 PM
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
09-15-2008 3:21 PM
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