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

SAP Abap Table control

Hi friends,

I created a table control in abap. And when I add a new record, it add to the db table but the previous content becomes double.

help me please.....

Anoop

Moderator Message: Welcome to SCN. I suggest you search the forums for similar issues. I'm sure you will find many similar threads with solutions. Please do not duplicate the forums with redundant information.

Edited by: kishan P on Jul 18, 2011 11:33 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 17, 2011 at 10:17 AM

    Hi,

    As per my understanding, I have tried to provide a possible solution...

    when you do any user-command like enter or click of button, PAI and PBO are triggered. So you would have written a query to fetch data from DB in PAI or PBO. So when you do any action on screen, PAI and PBO are triggered and every time query is fired. So internal table which is bind to the table control has records appended when query is fired every time and record gets double. So you need to execute query and append the records in internal table only once. You can achieve this functionality by writing them in condition and this condition should only execute once when tcode is executed.

    Hope it helps..

    Thanks & Regards,

    Mihir

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 18, 2011 at 04:59 AM

    Hi

    Please post your code of selection and insertion.

    Thanks

    LG

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 18, 2011 at 05:22 AM

    Hi,

    For table control: It is always a best practice to first check if there exist a record in that table with same data which you are trying to insert now and if it does not, then only insert it. Otherwise just update it.

    Thanks,

    Venkatesh.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 18, 2011 at 05:23 AM

    Are you directly saving the record to DB or Table control is assigned to internal table and the internal table updates the DB??

    And is the duplicate record coming when u click the Add new button ?

    This could be probably because you are not clearing your work area before adding teh new row..

    if you could give your code, we could help better i think

    Suzie

    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.