11-27-2007 5:47 AM
hi pls help me .
i am looping internal table presently i am now at 5th line so sy-tabix = 5
based on one field in line 5 i need to modify some other field in line 4
i mean sy-tabix = 4.
so how we can dynamically do this pls help me any one regarding this pls
is it my statement correct
lt_ekbe [sy-tabix-1]-menge = lt_ekbe [sy-tabix]-menge.
like this
11-27-2007 5:52 AM
Hi,
Declare Lv_index like sy-tabix.
store lv_index = sy-tabix - 1.
at the time of modifying table use index as lv_index
modify itab from wa index lv_index transporting field.
Regards,
Prashant
11-27-2007 5:50 AM
11-27-2007 5:52 AM
Hi,
Declare Lv_index like sy-tabix.
store lv_index = sy-tabix - 1.
at the time of modifying table use index as lv_index
modify itab from wa index lv_index transporting field.
Regards,
Prashant
11-27-2007 5:52 AM
Hi,
See if in the 5th record ur condition satisfied means u wnt to modify 4th record right
Inside the loop u can use read stmt with the condition of sy-tabix = 4,when the previous condition satisfied....
It will retrieve the 4th record and u can modify tht..
Try this
Reward if useful
11-27-2007 5:53 AM
loop at itab.
l_tabix = sy-tabix.
read itab (based on your condition)
if sy-subrc eq 0.
pass your value
modify itab index l_index.
endif.
endloop.
11-27-2007 5:58 AM
hi
try following code,
loop at itab into wa.
if sy-tabix = 5.
wa_tabix = sy-tabix - 1.
wa-menge = 10.
modify itab from wa index wa_tabix.
endif.
endloop.
L.Velu
11-27-2007 6:08 AM
take data in the work area into some temp. work area ( wa_temp) before going on to the next record.
loop at itab into wa_tab.
if not sy-tabix Eq 1.
if (check condition).
wa_temp-menge = wa_tab-menge.
modify i_tab from wa_temp.
endif.
endif.
wa_temp = wa_tab.
endloop.
reward if helpful.