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

moving contents of itab at position....

Hi All,

Does anyone know how to move the contents of a range to an internal table (where the itab has the same structure) at a specifed index postion.??

URGENT ....PLEASE HELP

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jun 18, 2008 at 11:16 AM

    I'll be happy to tell you once you removed the "urgent" part.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 18, 2008 at 11:17 AM

    Hello David

    This is quite simple:

    DATA: ls_rng    LIKE LINE OF r_range.  " same structure at lt_itab
    
    ld_idx = 10.
    LOOP AT r_range INTO ls_rng.
       INSERT ls_rng INTO TABLE lt_itab INDEX ld_idx.
    ENDLOOP.

    Regards

    Uwe

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Uwe, what about

      APPEND LINES OF itab1 [FROM idx1] [TO idx2] TO itab2.

      Edit: Just saw the difference, your code is inserting into the target at a given position (probably what the OP wants), whereas this statement is taking the source data from a given position.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 11:28 AM

    use this ..

    report .

    types: begin of ty_itab ,

    name(10) type c,

    end of ty_itab .

    data: itab type table of ty_itab with header line ,

    itab1 type table of ty_itab with header line,

    wa_itab type ty_itab,

    wa_itab1 type ty_itab .

    wa_itab-name = 'venkat1'.

    append wa_itab to itab .

    wa_itab-name = 'venkat2'.

    append wa_itab to itab .

    wa_itab-name = 'venkat3'.

    append wa_itab to itab .

    wa_itab-name = 'venkat4'.

    append wa_itab to itab .

    wa_itab-name = 'venkat5'.

    append wa_itab to itab .

    append lines of itab from 1 to 3 to itab1.

    loop at itab1 into wa_itab1.

    write:/ wa_itab1-name .

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 11:34 AM

    Range is like a select option.

    You have to loop at range nad populate the range-low field to the corrsponding internal table field.

    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.