‎2011 Aug 02 7:28 PM
Hello Folks,
I created a dynamic internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = i_fieldcat
IMPORTING
ep_table = i_dyntab
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
ASSIGN i_dyntab->* TO <f_dyntable>. and created a work area
CREATE DATA wg_f_split LIKE LINE OF <f_dyntable>.
ASSIGN wg_f_split->* TO <f_wg_dyntable>.My requirement is that , i have to loop a normal internal table and append those records to the filed symbol internal table.
READ TABLE i_normal_itab INTO wg_split INDEX wl_rows-index.
IF sy-subrc EQ 0.
ASSIGN wg_split to <f_wg_dyntable>.
APPEND <f_wg_dyntable> to <f_dyntable>.
endif.here i am geeting dump as "MOVE src TO dst" ... i can get the data in the work area FSymbol but cannot append it in Internal table Field Symbol.. Please help..
<Added code tags>
Edited by: Suhas Saha on Aug 3, 2011 10:52 AM
‎2011 Aug 02 8:24 PM
Hi Charan-SAP,
ASSIGN wg_split to <f_wg_dyntable>.
because of this statement, you changed the field symbol so it does not refer to the line of the dynamical internal table.
Instead, I think you want to do something like:
MOVE-CORRESPONDING wg_split to <f_wg_dyntable>.
BR
Sandra
‎2011 Aug 02 8:24 PM
Hi Charan-SAP,
ASSIGN wg_split to <f_wg_dyntable>.
because of this statement, you changed the field symbol so it does not refer to the line of the dynamical internal table.
Instead, I think you want to do something like:
MOVE-CORRESPONDING wg_split to <f_wg_dyntable>.
BR
Sandra
‎2011 Aug 02 8:40 PM
Hello Sandra,
Thanks for the reply..
First i tried appending the normal work area to the fieldsymbol internal table.
append wg_split to <f_dyntable>
This is hiting dump the same dump and so i created a fieldsymbol work area. ( <f_wg_dyntable>.)and tried to append the field symbol internal table with this work area. which is again giving the dump
APPEND <f_wg_dyntable> to <f_dyntable>. ( Again a Dump)
Edited by: Charan-SAP on Aug 2, 2011 9:40 PM
Edited by: Charan-SAP on Aug 2, 2011 9:42 PM
‎2011 Aug 02 8:47 PM
Try this way:
ASSIGN i_dyntab->* TO <f_dyntable>. and created a work area
field-symbols: <fs_dyntable> type line of <f_dyntable>.
READ TABLE i_normal_itab INTO wg_split INDEX wl_rows-index.
IF sy-subrc EQ 0.
<fs_dyntable> = wg_split.
APPEND <fs_dyntable> to <f_dyntable>.
endif.
‎2011 Aug 02 8:50 PM
APPEND <f_wg_dyntable> to <f_dyntable>.
If it dumps, it means that you changed the assignment of <f_wg_dyntable> right before, you shouldn't.
But could you explain what you want to achieve, what fields are in wg_split , are they the same as in <f_wg_dyntable> or do they have fields with same name? (then MOVE-CORRESPONDING should work)
Sandra
‎2011 Aug 03 7:04 AM
Hello Charan,
The following code snippet works for me:
LOOP AT gt_data INTO gs_data. "LOOP on static table
* Append the line to the dynamic table
APPEND INITIAL LINE TO <gt_dyn> ASSIGNING <gs_dyn>.
IF sy-subrc = 0.
MOVE-CORRESPONDING gs_data TO <gs_dyn>.
ENDIF.
ENDLOOP.
‎2011 Aug 03 7:17 AM