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

FM to update & delete data from a table

Hi

Can i have an FM to update and delete the data in a table either it is standard or a Z table. Plz its urgent

Regards

Nanda

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Nov 30, 2007 at 08:17 AM

    Hi,

    I dont think so, there is a FM for that try like this.

    *& 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

  • Posted on Nov 30, 2007 at 08:15 AM

    Hi

    look at SE16N_INTERFACE

    with param: I_EDIT = 'X'

    Best Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 30, 2007 at 08:17 AM

    Hi,

    It is not good practice to update or delete data in standard table by direct delete/update statements.

    For normal ztable, you can use

    delete db from table itab.

    Here itab should be a internal table and contain the data to be deleted.

    or

    delete from db where condition.

    update db from table itab.

    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.