2009 Aug 24 5:28 AM
hi,
i have some problem in saving wa_zco_hoff2-zhof = zstprs. into my ztable.
I want to modify zhof to zstprs value and changed the value in the internal table which is, it_zco_hoff2.
At this point, i am not sure how to save this changes into my ztable which is, zcho_hoff2.
below its my code.
LOOP AT it_zco_hoff2 INTO wa_zco_hoff2.
IF wa_zco_hoff2-zvalidfrom EQ zvfro AND wa_zco_hoff2-zvalidto EQ zvto. "update
wa_zco_hoff2-zhof = zstprs.
MODIFY it_zco_hoff2 FROM wa_zco_hoff2 TRANSPORTING zhof.
update zco_hoff2 from it_zco_hoff2.
commit work and wait.
thank you.
regards,
SW
2009 Aug 24 5:35 AM
Hi,
Try using the the UPDATE Query to save the value in your Z table in the following manner.
UPDATE zco_hoff2 SET zhof = zstprs WHERE <unique condition to identify records you wish to update>
Regards,
Himanshu
hi,
i have some problem in saving wa_zco_hoff2-zhof = zstprs. into my ztable.
I want to modify zhof to zstprs value and changed the value in the internal table which is, it_zco_hoff2.
At this point, i am not sure how to save this changes into my ztable which is, zcho_hoff2.
below its my code.
LOOP AT it_zco_hoff2 INTO wa_zco_hoff2.
IF wa_zco_hoff2-zvalidfrom EQ zvfro AND wa_zco_hoff2-zvalidto EQ zvto. "update
wa_zco_hoff2-zhof = zstprs.
MODIFY it_zco_hoff2 FROM wa_zco_hoff2 TRANSPORTING zhof.
update zco_hoff2 from it_zco_hoff2.
commit work and wait.
thank you.
regards,
SW
2009 Aug 24 5:35 AM
Hi,
Try using the the UPDATE Query to save the value in your Z table in the following manner.
UPDATE zco_hoff2 SET zhof = zstprs WHERE <unique condition to identify records you wish to update>
Regards,
Himanshu
2009 Aug 24 5:39 AM
2009 Aug 24 5:40 AM
Hi,
If your using internal table to update use syntax
Update <ztable name> from table <internal table>.
if work area
update <ztable name> from <wa>.
since you want to update just zhof try using
update <ztable name> set zhof = wa-zhof where <some primary key condition>
Also check your code here:
update zco_hoff2 from it_zco_hoff2.
where as you have said earlier that your z table name is zcho_hoff2.
Just use COMMIT WORK instead of addition WAIT.
For more info write UPDATE/MODIFY in ur abap editor and do F1 on it.
Regards,
Amit
Edited by: Amit Iyer on Aug 24, 2009 10:11 AM
Edited by: Amit Iyer on Aug 24, 2009 10:12 AM
2009 Aug 24 5:41 AM
Please make sure that values in it_zco_hoff2 exist in ztable since you are using UPDATE, if not you should use MODIFY.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |