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

comparsion of Internal table and database table values

Hi,

I m working on dialog modules....table controls

when i m editing some fields on 2nd screen and clicking save button, i m giving information Messge :Added succesfully to database table.

But when i m not changing anything and still clicking on Save button , i m getting same message....

I dont want that message....again when i m not editing...

What shud i compare and where??

Can anyone help me out.

I will be thankful...if anyone helps me out...

Regards,

Nidhi.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Feb 01, 2008 at 05:25 AM

    Hi,

    While inserting records you would be using INSERT/UPDATE statment. So check the sy-subrc of that satement & if 0, then display the success message.

    Best regards,

    Prashant

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 05:26 AM

    Hi friend,

    Check the Sy-subrc value before displaying the message like this.

    If sy-subrc = 0.

    Message I000(0) with 'data saved'.

    elseif

    Message E000(0) with 'data not edited'.

    endif.

    I think this will solve your issue.

    Please reward points if it is useful.

    Regards,

    Swetha.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 05:39 AM

    Hi

    After "save" button event check the field values that are on the screen to the corresponding record in the database table."IF" there is any change in any field u can display the message.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 05:44 AM

    USE SOME THING LIKE THIS: -

    WHEN CSA. "SAVE

    IF SAVE_OK_100 = CCR. "CREATE

    INSERT Z11_CUSTOMER1.

    INSERT Z11_CUST_SALES.

    INSERT Z11_CUST_BANK FROM TABLE T_BANK.

    IF SY-SUBRC = 0.

    MESSAGE I006 WITH TEXT-008.

    CLEAR Z11_CUSTOMER1.

    CLEAR Z11_CUST_SALES.

    REFRESH T_BANK.

    CLEAR SAVE_OK_100.

    CLEAR OK_CODE_101.

    CLEAR V_FLAG1.

    CLEAR V_FLAG2.

    CLEAR V_FLAG3.

    LEAVE TO SCREEN 0100.

    ENDIF.

    THANKS,

    GAURAV J

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 06:00 AM

    Hello frnd,

    Before displaying the value in table control first copy the content of the internal table in one more internal table.

    itab_new[] = itab_old[].

    Then display itab_old in table control.

    After editing, itab_old content will change auomatically, and it will be having the changed/updated value.

    In the SAVe user command, check whether itab_new = itab_old.

    if true.

    then display message.

    else.

    leave it.

    endif.

    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.