2006 Jun 09 2:14 PM
Hi ,
How to modify previous lines in table maintenance...
Needed info urgently..
Scenario as follows:
matnr pltyp datab datbi
m1 01 01.01.2001 31.12.9999
m1 02 02.03.2002 31.12.9999
m1 03 06.01.2003 31.12.9999
m2 20 01.01.2001 31.12.9999
m2 21 01.01.2004 31.12.9999
m2 22 01.01.2007 31.12.9999
m3 31 01.01.2002 31.12.9999
m3 32 09.01.2006 31.12.9999
in the above scenario.
datbi is only diplay mode , user cannot change the value for datbi.
datbi will be changed acording to the datab values for the corresponding matnr .
my required output is as follows
matnr pltyp datab datbi
m1 01 01.01.2001 01.03.2002
m1 02 02.03.2002 05.01.2003
m1 03 06.01.2003 31.12.9999
m2 20 01.01.2001 31.12.2003
m2 21 01.01.2004 31.12.2006
m2 22 01.01.2007 31.12.9999
m3 31 01.01.2002 08.01.2006
m3 32 09.01.2006 31.12.9999
regards,
Pradipta
2006 Jun 09 2:22 PM
Hi If it is a custome table do like this.
selct *
from ztab
into table it_ztab.
loop at it_ztab.
lv_tabix = sy-tabix.
lv_tabix_next = sy-tabix + 1.
read table it_ztab index lv_tabix_next.
if sy-subrc = 0.
it_ztab-datbi = it_ztab-datab - 1.
modify it_ztab index lv_tabix.
endif.
endloop.
modify ztab from table it_ztab.
Regards,
Ravi
2006 Jun 09 2:25 PM
Hi Ravi..
you forgot to use COMMIT after loop statement and also use table locks as well.
regards,
ram
2006 Jun 09 2:38 PM
Hi,
Small correction
<b>it_ztab-datbi = it_ztab-datab.</b>
modify it_ztab index lv_tabix.
endif.
endloop.
modify ztab from table it_ztab.
Regards,
Amole