‎2008 Feb 29 7:13 AM
Hello,
i m getting the following dump when i try 2 run the given block of code.
the relevant abap/4 statement does not include the addition '..index..' although the statement is not in inside a loop...endloop.
itab_schedule is my table control internal table.
loop at itab_Schedule.
modify itab_schedule_sort from itab_schedule transporting ebelp etenr
menge eindt .
endloop.
sort itab_schedule_sort by ebelp.
loop at itab_schedule_sort.
at new ebelp.
sum.
temp_quant = itab_schedule_sort-menge.
loop at itab_lineitems into wa_itab_lineitems.
if itab_Schedule_sort-ebelp eq wa_itab_lineitems-v_Itemno.
temp_quant_line = wa_itab_lineitems-v_quantity.
if temp_quant_line ne temp_quant.
message i012(zgroup16_message).
else.
save_Schedule = 1.
endif.
endif.
endloop.
endat.
endloop.
‎2008 Feb 29 7:19 AM
Hi,
Try this.
Add 'index sy-tabix ' in ur modify statement and check.
Always use explicit workarea. Will enhance ur performance.
Reward if helpful.
Regards,
Ramya
‎2008 Feb 29 7:43 AM
Hi Pranjal,
I agree with Ramya: if the internal table you want to modify is not being LOOPed, then you should always use an INDEX addition.
Please have a look at the ABAP/4 doc:
Variant 1
MODIFY itab \[FROM wa\] \[INDEX idx\] \[TRANSPORTING f1 ... fn\].
Effect
Changes a single entry in the internal table itab, specifying the key explicitly or implicitly. You can only use this variant with index table (standard or sorted tables).
If you specify "FROM wa", the new values are taken from the work area wa. If you do not specify FROM, the header line of itab is used as the work area.
You can use "INDEX idx" to specify the table index of the line you want to change. This may be omitted within a LOOP at an internal table. In this case, the current table line is changed.
I hope this helps. Best regards,
Alvaro