Application Development 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: 

How to modify itab using where condition ?

former_member329859
Participant
0 Kudos

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

Former Member

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

Former Member
0 Kudos

Loop at itab.

if <codition>

modify itab idex sy-tabix.

endif.

endloop.

Regards,

Aparna Gaikwad

kesavadas_thekkillath
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member

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.

Former Member
0 Kudos

Try it like this:

MODIFY itab FROM wa 
       TRANSPORTING field1 WHERE field1 = wa_field1.

With luck,

Pritam.

Former Member
0 Kudos

Hi Gaurav,

Loop at itab.

If sy-tabix = 1.

skip.

endif.

{other steps.}

Endloop.

Hope this helps.

Thanks.

Best Regards,

Arun Sankar.

0 Kudos

Hi Gaurav,

loop at itab.

If sy-tabix > 1.

<modify your itab>

endif.

endloop.

Regards,

Mindaugas