Skip to Content

internal table manipulation

Hi

i like to know that, an internal table is having five fields like

data: begin of itab1 occurs 100,

field1 type c,

field2 type c,

field3 type c,

field4 type c,

field5 type c,

end of itab1.

for every loop paas of an internal table itab2 the data should

be assigned to the next field of itab1.

after 5 iterations the data should get appended to itab1.

how to do this. can anybody help me.

points will be rewarded.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 29, 2008 at 09:50 AM

    data v_var type i.

    move 0 to v_var.

    loop at itab2.

    add1 to v_var.

    case v_var.

    when 1.

    itab1-fld1 = data1.

    when 2.

    itab1-fld2 = data2.

    .

    .

    when 6.

    append itab1.

    clear v_var.

    endcase.

    Regards,

    Amit

    Reward all helpful replies.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 09:53 AM

    data: l_tabix like sy-tabixx.

    loop at itab2.

    l_tabix = sy-tabix.

    if l_tabix = 1.

    itab1-field1 = itab2-field1.

    elseif l_tabix = 2.

    itab1-field2 = itab2-field2.

    elseif l_tabix = 3.

    itab1-field3 = itab2-field3.

    elseif l_tabix = 4.

    itab1-field4 = itab2-field4.

    elseif l_tabix = 5.

    itab1-field5 = itab2-field5.

    append itab1.

    endif.

    clear itab1.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 09:49 AM

    Can u explain ur requirement more clearly with an example

    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.