Skip to Content

Data base update

Hello,

I have a internal table (t_itab) with shipref no and I want to update the database table (z1sd_05) with the statement "UPDATE z1sd_05 from table t_itab."

But in my database table z1sd_05, there are 20+ fields more like date, time, username etc., My question is when I update the shipref no to database table, is date, time, username is also going to update in the database table or not?..

If not, how to achive this functionality?..

Here, date, time, username are all system fields.

Regards,

Shreekant

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 24, 2007 at 03:37 AM

    Hi Shreekant ,

    The value will not be updated automatically , you will have to do it.

    For this i would suggest you to use an internal table which has all the feilds of the table you want to populate and populate the internal table with value and use the internal table to update the table.

    Regards

    Arun

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Arun,

      U understood my requirement, I already populated shipref to my internal table wihich is having all the fields of my database table. Next how do I modify date, time etc. based on my shipref no?... If u have any sample code, please send me..

      Actually I am little new to ABAP.

      Thanks,

      Shreekant

  • author's profile photo Former Member
    Former Member
    Posted on Apr 24, 2007 at 03:48 AM

    shreekant,

    Below are the syntax for Updation.Based on sysntax it will happen.Suppose if you

    use first one only those fields will update in database table.If you use third syntax it will update all the fields in database table by internal table fields.

    1. UPDATE dbtab SET f1 ... fn.

    3. UPDATE dbtab FROM TABLE itab. or

    UPDATE (dbtabname) FROM TABLE itab.

    So if you want to update all use first syntax

    UPDATE z1sd_05 SET shipref_no = itab-shiref_no

    date = sy-datum

    time = sy-uzeit

    username = sy-uname.

    Don't forget to reward if useful...

    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.