Skip to Content
author's profile photo Former Member
Former Member

move dynamic internal table to static internal table

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jul 24, 2008 at 08: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>.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 24, 2008 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 24, 2008 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 24, 2008 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 24, 2008 at 09: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,

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.