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

How to modify itab using where condition ?

Former Member
0 Likes
5,348

hello experts ,

whenever i modifies itab within a loop it always starts from first row,

i want to modify itab from next row ,

please tell me any syntax as shown in new gui,

MODIFY ITAB WHERE .....

what should i write after where??

thanks

gaurav

1 ACCEPTED SOLUTION
Read only

Former Member
2,990

Hi,

You can use following syntax:

loop at itab.

if condition

modify itab index sy-tabix.

endif.

endloop.

Try this syntax, hope it will help you.

7 REPLIES 7
Read only

Former Member
0 Likes
2,990

Loop at itab.

if <codition>

modify itab idex sy-tabix.

endif.

endloop.

Regards,

Aparna Gaikwad

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,990

modify itab from wa transporting matnr where matnr = 'A'.

Read only

Former Member
0 Likes
2,990

hi,

you can use any field name with conditions, i.e

MODIFY ITAB WHERE FIELDNAME EQ 'ANY CONDITION

where fieldname is the field in itab

Yogesh N

Read only

Former Member
2,991

Hi,

You can use following syntax:

loop at itab.

if condition

modify itab index sy-tabix.

endif.

endloop.

Try this syntax, hope it will help you.

Read only

Former Member
0 Likes
2,990

Try it like this:

MODIFY itab FROM wa 
       TRANSPORTING field1 WHERE field1 = wa_field1.

With luck,

Pritam.

Read only

Former Member
0 Likes
2,990

Hi Gaurav,

Loop at itab.

If sy-tabix = 1.

skip.

endif.

{other steps.}

Endloop.

Hope this helps.

Thanks.

Best Regards,

Arun Sankar.

Read only

0 Likes
2,990

Hi Gaurav,

loop at itab.

If sy-tabix > 1.

<modify your itab>

endif.

endloop.

Regards,

Mindaugas