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

Question regarding populating Internal table values


I have 2 internal tables as mentioned below

Table I

F1 F2


AEDAT 01/01/2005

F1 & F2 are fields of Table I

Table II


Is it possible to populate the values of Table I to

Table II based the field names which is one of the values in Table I ?. These 2 tables doesn't have the same fields.

After copying the values in Table II should be

Table II


XXXX 01/01/2005

Thanks in advance,


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Feb 16, 2005 at 10:40 PM

    Hi Jay

    As far as I understood, you can achieve this using field symbols. Look at the following sample code. There I assume your internal tables <i>table_1</i> and <i>table_2</i> having their header lines.


    LOOP AT table_1 .
      ASSIGN COMPONENT (table_1-f1) 
             OF STRUCTURE table_2 
             TO <f> .
      IF sy-subrc = 0 .
        <f> = table_1-f2 .
      ENDIF .
    APPEND table_2 .
    UNASSIGN <f> .

    Hope this much helps...

    Kind 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.