06-18-2008 12:14 PM
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
06-18-2008 12:16 PM
06-18-2008 12:22 PM
06-18-2008 12:24 PM
because I think it's unpolite to flag something as "urgent", thus making your question seem more important than other peoples questions.
Cheers
Thomas
06-18-2008 12:30 PM
Ok - wasnt my intention............................
Am testing out sols - Thanks
06-18-2008 12:32 PM
06-18-2008 12:17 PM
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
06-18-2008 12:21 PM
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.
06-18-2008 12:28 PM
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.
06-18-2008 12:34 PM
Range is like a select option.
You have to loop at range nad populate the range-low field to the corrsponding internal table field.