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

problem in saving my value into ztable.

Former Member
0 Likes
768

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
728

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

4 REPLIES 4
Read only

Former Member
0 Likes
729

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

Read only

0 Likes
728

thank u thank u

Read only

Former Member
0 Likes
728

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

Read only

Former Member
0 Likes
728

Please make sure that values in it_zco_hoff2 exist in ztable since you are using UPDATE, if not you should use MODIFY.