Skip to Content
author's profile photo Former Member
Former Member

Update question

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 09: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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 10, 2008 at 09: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.