‎2006 Jul 14 10:45 AM
Hi all,
When i try to use modify statement for an internal table.... the sy-subrc after the Modify statement is 4 and hence the internal table is not modified... can you help me how 2 solve this error?
The code is as given below:
<b>loop at g_t_p0014 where lgart eq p_lgart and begda eq p_begda.
if sy-subrc EQ 0.
g_f_chck = 'X'.
Endif.
itab-check = g_f_chck.
MODIFY itab transporting check where check = g_f_chck.
ENDLOOP.
The contents of itab are: pernr and check.</b>
Message was edited by: Abhijith H
‎2006 Jul 14 10:50 AM
Hello,
Use
MODIFY itab index 1.
Reward if useful.
Regards,
Vasanth
‎2006 Jul 14 10:47 AM
hello,
Please use the index addition with modify statement in order to modify the internal table properly.
May be The flag 'X' is not found in the internal table..
That may also cause your sy-subrc eq 4.
Reward if it helps.
Regards,
krishnakumar
Message was edited by: Krishnakumar
‎2006 Jul 14 10:50 AM
Hello,
Use
MODIFY itab index 1.
Reward if useful.
Regards,
Vasanth
‎2006 Jul 14 10:53 AM
Hi abhijit ,
use modify stmnt withoit where clause.
Regards,
Sumit.
‎2006 Jul 14 10:54 AM
Abhijith
loop at g_t_p0014 where lgart eq p_lgart and begda eq p_begda.
if sy-subrc EQ 0.
g_f_chck = 'X'.
Endif.
itab-check = g_f_chck.
<b>MODIFY itab Transporting check where check = space.</b>
ENDLOOP.
Thanks
Jack
<b>Allot points if my post helps!!!</b>
Message was edited by: Jack
‎2006 Jul 14 10:56 AM
What are you trying to do here?
Can you tell us what is your requierement?
Regards,
ravi
‎2006 Jul 14 11:30 AM
hi abhijit,
you please check ur code carefully. I guess ur requirement is to mark the field itab-check = 'X' in the table itab for all the pernr available in the table g_t_p0014. In ur code u havent related both the tables using pernr.
i think following is the code u required.just paste the following code and try ...
data : g_index like sy-tabix.
loop at g_t_p0014 where lgart eq p_lgart and
begda eq p_begda.
clear : g_index .
itab-check = 'X'.
read table itab with key pernr = g_t_p0014-pernr.
g_index = sy-tabix.
if sy-subrc = 0.
MODIFY itab index sy-tabix.
endif.
ENDLOOP.
‎2006 Jul 14 11:43 AM
<deletded>
for which pernr u want to modify the check
Message was edited by: Chandrasekhar Jagarlamudi
‎2006 Jul 14 11:43 AM
Hi Abhijith,
As your syntax is fine, why don't you try a index as
MODIFY itab [FROM wa] [INDEX idx].
Here your internal table is g_t_p0014 and check you define your index value please and can send me your program here please try like this:
Modify itab index sy-tabix transporting check where check = g_f_chck.
Ankur Grag.
Message was edited by: Ankur Garg
‎2006 Jul 14 12:04 PM
Thanks all of u ... the problem is solved..
<b>Modify itab index 1</b>.... this statement works.
‎2006 Jul 14 12:15 PM
if u modify with index 1, always the first row of itab table only will be updated..