04-10-2008 9:40 PM
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
04-10-2008 9:53 PM
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
04-10-2008 9:53 PM
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
04-10-2008 10:10 PM
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.
04-10-2008 10:12 PM
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