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

Updating a table and displaying the result

hi all,

i have developed a report where i update a table with correct feild.

i display the output with write message, if a record is been updated once it gives me -->order no. 12345 updated . but if i execute the report again it gives me the same order no updation

Well, once i update the table with the correct field it should not give me the updation

message again

i am not getting how to do this.

any advice?

thnkx

bhanu

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 07:01 AM

    Hi Bhanu,

    before updating the table check whether the correct field exists already..if so then do not update...then ur pblm wil be resolved..

    Regards,

    Kaveri..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 07:02 AM

    Hi Bhanu,

    AS Per my understanding, if you are updating a field once if u are updating the field with same value next time it is again updating the same value and giving you the message it ahs been updated sucessfully. When you don't want to do this then try to compare the previous value and present value and if they are same then don't update if not update it.

    This is solution as per my understanding. If it is useful please reward and if I am wrong Please correct.

    Thanks,

    Murthy

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 07:06 AM

    Hi,

    Before updating select the value from the table and check that if that entry exists,if yes then don't update and give message that already updated,if no then update the field and give message as field updated..

    Regards,

    nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 07:06 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 Dec 03, 2007 at 07:09 AM

    I HAVE TAKEN THE FIELD LIKE THIS-->

    WA_NEW-DATE IF NOT INITIAL.

    UPDATE TABLE NAME.

    NOW IF I WANT TO CHECK IF ITS ALREADY UPDATED

    THEN?

    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.