Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

modify internal table

Former Member
0 Likes
625

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.

5 REPLIES 5
Read only

Former Member
0 Likes
603

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'.

Read only

Former Member
0 Likes
603

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

Read only

Former Member
0 Likes
603

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

Read only

Former Member
0 Likes
603

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.

Read only

Former Member
0 Likes
603

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.