Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Abap Table control

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

Please post your code of selection and insertion.

Thanks

LG

Former Member
0 Kudos

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.

lijisusan_mathews
Active Contributor
0 Kudos

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