07-24-2008 9:49 AM
Hi Experts,
I had created one Dynamic Internal table and one static internal table.I want to move data from dynamic internal table to static internel table.
So please help me for solving this issue.
07-24-2008 9:52 AM
If the two tables have exactly the same structure.
lt_static = <lt_dynamic>
If they don't.
LOOP AT <lt_dynamic> ASSIGNING <ls_dynamic>.
MOVE-CORRESPONDING <ls_dynamic> TO ls_static.
INSERT ls_static INTO TABLE lt_static.
ENDLOOP.
You can access individual fields, if move-corresponding isn't sufficient, by using ASSIGN COMPONENT fieldname/number OF STRUCTURE <ls_dynamic> TO <l_field>.
10-25-2022 11:07 AM
Exactly what I was looking for today. Thank you so much for this post, Matt.
10-25-2022 12:08 PM
bharath.padmanabhan Nowadays you can use MOVE-CORRESPONDING <lt_dynamic> TO lt_static of course.
07-24-2008 9:53 AM
hi,
take a look at this code
LOOP AT <itab> ASSIGNING <wa>.
ASSIGN COMPONENT 'AUFNR' OF STRUCTURE <wa> TO <fs_field>.
MOVE <fs_field> TO wa1-aufnr.
APPEND wa1 TO itab1.
CLEAR wa1.
ENDLOOP.
regards,
Peter
07-24-2008 9:57 AM
\[removed by moderator as it was just a copy and paste answer of someone else's work without giving a source\]
Edited by: Jan Stallkamp on Jul 24, 2008 12:43 PM
07-24-2008 10:08 AM
thanks for ur replies,
but i have a full data in dynamic table <dyn_table> and i want to send that data to a static table beco'z i have to export this table from function module.
help pls
07-24-2008 10:13 AM
So which part of mine or Peter Ruiz's answer did you not understand?
What is the structure of the tablet the function module expects?
matt
07-24-2008 10:42 AM
hi, it's give me a error that is_staic & it_static is unknown ,pls tell me how to define him like struture < dyn_table>.
regards,