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

updating a custom table

I am trying to update a custom table in BW with the following statement.

UPDATE customtable FROM TABLE ITAB1.

itab1 has entries but the customtable is not getting updated do i need to use any commit statement for that.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 04:16 PM

    For UPDATE to work, entries have to exist in the data base table for the entries you want to update from the internal table. So in your caase, the entries likely don't exist in the database and you are getting sy-subrc = 4.

    There is an implicit COMMIT at the end of the program, so adding one won't really help.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 04:05 PM

    Hi,

    Right after that stmt write 'COMMIT WORK'.

    This shud work.

    Regards,

    Vinod.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2007 at 04:06 PM

    Try MODIFY or INSERT, not sure about the syntax here.

    MODIFY ztable FROM TABLE ITAB1.
    
    or 
    
    INSERT ztable FROM TABLE ITAB1.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 04:09 PM

    Hello,

    Alwasy use Modify/Insert command to update the ZTABLE.

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 04:10 PM

    Hi,

    Yes..Give COMMIT WORK statement after the update statement.

    Example

    -


    UPDATE customtable FROM TABLE ITAB1.

    IF SY-SUBRC = 0.

    COMMIT WORK.

    ENDIF.

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 09, 2007 at 04:14 PM

    Which value get SY-SUBRC after your update.

    Remembre not to change primary keys of your records.

    regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 04:30 PM

    Hi,

    Use MODIFY statement..Which will insert a record if the matching key is not found..Also if the key is found it will update the record..

    MODIFY customtable FROM TABLE ITAB1.

    COMMIT WORK.

    THanks,

    Naren

    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.