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 - Transporting?

Former Member
0 Likes
1,236

Hi Experts,

One simple doubt,

I made a loop itab into wa,

manipulated the first field of (either changed or added a new value, if its initial) wa.

MODIFY itab.

So,

1) Can I take it for granted that, the changes will take place/apply, surely, for the very first (which is fetched to wa from itab), record of the <u><b>itab</b></u>, bcoz I used MODIFY?

I mean, SAP automatically, knows that, it has to make the changes to the corresponding equal record of the <u><b>itab</b></u>, which is fetched/resided in wa, SAP do not disturrb other records!

Is my assumption is correct?

ThaNQ.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
944

Hi Sridhar,

modify itab. is equivalent to 
modify itab index sy-tabix.

If you use modify itab without any index, it may result run time erros in some situations...

for example

loop at itab.
read table  itab2 with key <>...


modify itab.
endloop.

this may go for a toss becuase the the sy-tabix now is not of the current record of itab.

It is the current record or itab2.

In such cases you have to do this.

loop at itab.
lv_tabix = sy-tabix.
read table  itab2 with key <>...


modify itab index lv_tabix.
endloop.

7 REPLIES 7
Read only

Former Member
0 Likes
944

use

MODIFY ITAB FROM WA.

WA will recognize the key fields from internal table and updates the same record in internal table, this is the besy way to modify internal table

Message was edited by:

Chandrasekhar Jagarlamudi

Read only

Former Member
0 Likes
944

Hi

Refer the link..

http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb35eb358411d1829f0000e829fbfe/content.htm

Hope this will solve your problem.

Award points if it helps.

-Gaurang

Read only

Former Member
0 Likes
944

Hi Sridhar,

U r question i right, when u use Modify itab from wa, the SAP automatically understands that u want to update that records , but it also maintains the integrity of records.

I think u r question is solved .

Plz rewards points if question is solved.

Regards

Message was edited by:

Pritha Agrawal

Read only

Former Member
Read only

Former Member
0 Likes
944

hi sridhar,

well, sap knows that the updation(change) has to be done to the current row.

still, as the loop keeps running, it will update the other rows also.

so, to change one particular row, u can use the MODIFY statement within some condition(s) to determine the required(s) where u want to make the changes

loop....

if <condition>

modify.....

endif.

endloop.

thanks,

vijay.

Read only

0 Likes
944

Yes U can

Read only

Former Member
0 Likes
945

Hi Sridhar,

modify itab. is equivalent to 
modify itab index sy-tabix.

If you use modify itab without any index, it may result run time erros in some situations...

for example

loop at itab.
read table  itab2 with key <>...


modify itab.
endloop.

this may go for a toss becuase the the sy-tabix now is not of the current record of itab.

It is the current record or itab2.

In such cases you have to do this.

loop at itab.
lv_tabix = sy-tabix.
read table  itab2 with key <>...


modify itab index lv_tabix.
endloop.