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

Update question

Former Member
0 Likes
564

Hi Experts,

I have the following code: I would like to update the table t_yeban with the value in z_menge. I am getting an error at the statement

update t_yeban. I know this is not the right statement. Please help.

Code:

FUNCTION Z_XYZ.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      T_XEBAN STRUCTURE  EBAN OPTIONAL
*"      T_XEBKN STRUCTURE  EBKN OPTIONAL
*"      T_YEBAN STRUCTURE  EBAN OPTIONAL
*"      T_YEBKN STRUCTURE  EBKN OPTIONAL
*"----------------------------------------------------------------------



data: z_menge LIKE EBAN-MENGE.

if lines( t_xeban[] ) gt 0.


 z_menge = t_yeban-menge.
 z_menge = z_menge * -1.
 t_yeban-menge = z_menge.
 update t_yeban.



endif.




ENDFUNCTION.

Thanks.

Regards,

bw_newbie

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
526

Try keyword MODIFY instead of UPDATE. If t_yeban is a table without a header line you will need to specify a header line with the modify statement, eg: modify t_yeban from s_yeban.

-roger

3 REPLIES 3
Read only

Former Member
0 Likes
527

Try keyword MODIFY instead of UPDATE. If t_yeban is a table without a header line you will need to specify a header line with the modify statement, eg: modify t_yeban from s_yeban.

-roger

Read only

Former Member
0 Likes
526

Hye..

There is no update on internal tables.

Use either append or modify.

append wa to itab. " inserts row in the internal table at the end.

modify itab from wa. " inserts the row in current loop index.

Thanks,

Imran.

Read only

Former Member
0 Likes
526

Thanks a lot Roger and Imran. Modify statement within LOOP...ENDLOOP worked.

I have assigned points and closing the thread.

Thanks again.

Regards,

bw_newbie