Application Development and Automation 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: 
Read only

Insert

Former Member
0 Likes
667

hi all

In my Function module,

i m testing my FM ,In a perform i m doing insertion in a database table

now the insertion goes fine but when i run the FM with the same parameters it creates a duplicate entry

beacuse of this insertion

any idea how i can handle this?

5 REPLIES 5
Read only

Former Member
0 Likes
647

Hi,

Instead of INSERT use MODIFY statement.

If a record with the same key already exists, then it will modify that record in the DB table, else it will insert a new record.

Cheers,

Aditya

Edited by: Aditya Laud on Feb 6, 2008 8:29 AM

Read only

Former Member
0 Likes
647

before inserting into the table in the FM write a select to

check if the entry already exists .. if no then only insert into

the table ...

Read only

0 Likes
647

hello gurnam

i guess ur idea can help me

but wht kinda select?

Read only

Former Member
0 Likes
647

Can You paste Your FM code?

Read only

Former Member
0 Likes
647

May be in u r database tabel u are not set the Key fieldds.

other possible way is check the insert command containes the statement ALLOW DUPLICATES.