2007 Mar 07 1:26 PM
Hello All,
I have a reqmnt. I am having a table created by user and I need to update few values in it. The scenario is there is table ZTAB and there is field F1 , i need to insert values of F1 in field F2, where FI is not initial. Please check out my logic.
itab like table of ZTab,
wa like line of itab,
Select * from ZTAB into itab.
loop at itab into wa where F1 IS NOT INITIAL.
wa-f2 = WA-f1.
**Here is doubt, shud i use modify or append***
append WA or modify wa to itab.???
endloop.
Modify ZTAB from itab.
thanks and regards,
Gaurav
2007 Mar 07 1:30 PM
Hi,
Please try this.
...
modify itab from wa.
endloop.
modify ztab from table itab.
Regards,
Ferry Lianto
Thanks All for you replies,
i have given points to ALL of you guys, but please if you have not received points do let me know, sometimes its an error in point allocation system
2007 Mar 07 1:28 PM
2007 Mar 07 1:28 PM
Hello Gavrav,
DO like this:
itab like table of ZTab,
wa like line of itab,
Select * from ZTAB into itab.
loop at itab into wa where not F1 IS INITIAL. " Check here
wa-f2 = WA-f1.
***Here is doubt, shud i use modify or append****
modify itab from wa. " Check here
endloop.
Modify ZTAB from itab.
If useful reward.
Vasanth
Message was edited by:
Vasanth M
2007 Mar 07 1:31 PM
one more thing
, do i need to use
append wa . after wa-f2 = WA-f1.
thanks,
Gaurav
2007 Mar 07 1:32 PM
2007 Mar 07 1:30 PM
Hi,
Please try this.
...
modify itab from wa.
endloop.
modify ztab from table itab.
Regards,
Ferry Lianto
2007 Mar 07 1:31 PM
as you want just to modify the existing record with value F , just use modify
<b>modify itab from wa.</b>
2007 Mar 07 1:32 PM
Hi ,
You need to use only modify, no need to append wa.
inside the loop use
<b>modify itab from wa.</b>
itab like table of ZTab,
wa like line of itab,
Select * from ZTAB into itab.
loop at itab into wa where F1 IS NOT INITIAL.
wa-f2 = WA-f1.
<b>modify itab from wa.</b>
endloop.
Modify ZTAB from itab.
Hope it helps
regards,
saumya
2007 Mar 07 1:57 PM
Thanks All for you replies,
i have given points to ALL of you guys, but please if you have not received points do let me know, sometimes its an error in point allocation system
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |