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

Update Table

Hi all,

If i do this I am not inserting a new line on table ADR6? I need to update this table with one new entry. How can i do that?

The code bellow is not working.

  • LOOP AT lt_xvbpa.

  • UPDATE adr6

  • SET addrnumber = lt_xvbpa-adrnr

  • flgdefault = c_mark

  • home_flag = c_mark

  • WHERE .

  • COMMIT WORK AND WAIT.

Thanks a lot

Best regards

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 08:34 AM

    update table dbname.

    insert new line

    DATA scarr_wa TYPE scarr.

    scarr_wa-carrid = 'FF'.

    scarr_wa-carrname = 'Funny Flyers'.

    scarr_wa-currcode = 'EUR'.

    scarr_wa-url = 'http://www.funnyfly.com'.

    INSERT INTO scarr VALUES scarr_wa.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 08:37 AM

    Hi,

    If u dont have any conditions in WHERE clause just remove it.

    • LOOP AT lt_xvbpa.

    • UPDATE adr6

    • SET addrnumber = lt_xvbpa-adrnr

    • flgdefault = c_mark

    • home_flag = c_mark.

    COMMIT WORK AND WAIT.

    ENDLOOP.

    The above code will do.

    Tnx,

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 22, 2007 at 08:39 AM

    Hi,

    Refer this code.

    &----


    *& Form SUB_READ_UPDATE_BSEG

    &----


    • text

    ----


    FORM sub_read_update_bseg.

    IF NOT it_final[] IS INITIAL.

    LOOP AT it_final INTO wa_final.

    UPDATE bseg SET zuonr = wa_final-ccnum

    WHERE bukrs EQ wa_final-bukrs

    AND belnr EQ wa_final-vbeln

    AND rfzei EQ wa_final-rfzei

    AND saknr NE ' '.

    ENDLOOP.

    *--Message data updated successfully

    MESSAGE i888 WITH text-002.

    LEAVE LIST-PROCESSING.

    ELSE.

    *--Message No data found

    MESSAGE i888 WITH text-003.

    LEAVE LIST-PROCESSING.

    ENDIF.

    ENDFORM. " SUB_READ_UPDATE_BSEG

    Regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 08:39 AM

    here one more thing is addrnumber is a primary key field...which will not allow your updates..i hope....

    anyhow try this....

    LOOP AT lt_xvbpa.

    UPDATE adr6

    SET addrnumber = lt_xvbpa-adrnr flgdefault = c_mark home_flag = c_mark where addrnumber = '30938'.

    COMMIT WORK AND WAIT.

    Message was edited by:

    Muthurajan Ramkumar

    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.