‎2008 Apr 03 10:40 AM
vbeln posnr qty errorlog date
0001 10 2000 21.04.2008
0001 10 200 22.04.2008
0001 10 100 e 23.04.2008
0002 10 1000 22.04.2008
0002 20 2000 15.04.2008
depending on the error at e in third item remain above in same vbeln need to make errorlog as e
vbeln posnr qty errorlog date
0001 10 2000 e 21.04.2008
0001 10 200 e 22.04.2008
0001 10 100 e 23.04.2008
0002 10 1000 22.04.2008
0002 20 2000 15.04.2008
query not working properly need to sort vbeln in ascending order and date by descending so that date
vbeln posnr qty errorlog date
0001 10 100 e 23.04.2008
0001 10 200 22.04.2008
0001 10 2000 21.04.2008
0002 10 1000 22.04.2008
0002 20 2000 15.04.2008
based up on the e message i have to populate the other 2, and 3 record with e as below
vbeln posnr qty errorlog date
0001 10 100 e 23.04.2008
0001 10 200 e 22.04.2008
0001 10 2000 e 21.04.2008
0002 10 1000 22.04.2008
0002 20 2000 15.04.2008
read table modify table based on error log
sort it_data descending by zedatu_apd ascending vbeln.
break-point.
loop at it_data where errlog = 'E'.
MODIFY it_data where vbeln = it_data-vbeln TRANSPORTING errlog = 'E'.
endloop.
‎2008 Apr 03 10:50 AM
Change the Modify statement in the loop as below:
MODIFY it_data where vbeln = it_data-vbeln and posnr = it_data-posnr TRANSPORTING errlog = 'E'.
‎2008 Apr 03 10:51 AM
Hi Anil,
First of all understand the below logic.
data v_tabix type sy-tabix.
read table itab with key errorlog = 'e'.
if sy-subrc = 0.
v_tabix = sy-tabix - 1.
endif.
if not v_tabix is initial.
loop at itab from 1 to v_tabix.
itab-errorlog = 'e'.
modify itab.
endloop.
endif.
And try to close the threads immediately once you got the solution.
Edited by: Velangini Showry Maria Kumar Bandanadham on Apr 3, 2008 11:57 AM
‎2008 Apr 03 10:57 AM
Hi,
just loop at ur table and check if errorlog = 'e' then save that vbeln into a temporary table.
then while reading that new table containing vbeln with errorlog = 'e' match ur original table where-ever the both vbeln matches modify ur internal table transportin errorlog = 'e'.
reward if helpful
‎2008 Apr 03 10:59 AM
Hi,
You are using modify in loop...endloop.
You use modify itab index sy-tabix.
If modify is out of the loop...endloop and to mdify a group of records use where condition and transporting. If in the where condition all the keys are primary, then again only single record is modified.
Reward.
‎2008 Apr 03 11:07 AM
Hi,
Use the below logic.
data v_date type sy-datum.
read table itab with key errorlog = 'e'.
if sy-subrc = 0.
v_date = itab-date.
endif.
loop at itab where date lt v_date.
itab-errorlog = 'e'.
modify itab.
endloop.