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 Queries Which Insert Duplicate Data Into Database

Former Member
0 Likes
479

Dear Sir,

I Have One Issue That in My Internal Table Same VBELN(Keyfield)Field Has Three Different Rows Conating There Diiferent Data. I want The Three Rows Should Be Insert In database Table With Specified Key(VBELN).

Can Anybody Help me...

internal table coming in folowing format--

VBELN matnr maktx meins

123 hghjfd hfg kg

123 iotuyt jki pc

123 9867ii bnm pc

I want All Rows should be saved in database ztable ..

what is sql queries i have written...plz help me...

3 REPLIES 3
Read only

Former Member
0 Likes
457

Hi,

You can not insert the duplicate record in the table with the same primary key.

If you want to insert multiple rows in the database having same value of VBLEN, then dont mark that field as a key.

The syntax of sql is something like this.

insert <table_name> from table <itab_name>.

Hope this will help you.

~ Ramanath.

Read only

Former Member
0 Likes
457

Hi,

If the DB table has VBELN as the only key field(other than MANDT) then you cannot do that.

If it has some other key field as well then you can do so by using INSERT statment.

INSERT <DB tablename> from <internal table name>

<b><REMOVED BY MODERATOR></b>

Regards,

Amit

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
457

You'll have to change the table to include MATNR as well as VBELN as the primary key.

Rob