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 syntax

Former Member
0 Likes
685
data: wa_zcitorderout like zcitorderout.
wa_zcitorderout-vbeln = nast-objky. 
insert zcitorderout from wa_zcitorderout accepting duplicate keys.

The error i am getting is "." expected after "WA_ZCITORDEROUT".

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
660

Hi,

You can NOT use option accepting duplicate keys with wa.

Option accepting duplicate keys only work with table itab NOT wa.

INSERT dbtab FROM TABLE itab. or

INSERT (dbtabname) FROM TABLE itab.

Additions

... CLIENT SPECIFIED

... ACCEPTING DUPLICATE KEYS

Please try to build internal table.


data: begin of itab occurs 0.
           include structure zcitorderout.
data: end of itab.

data: wa_zcitorderout like zcitorderout.


wa_zcitorderout-vbeln = nast-objky. 

itab = wa_zcitorderout.
append itab.

insert zcitorderout from table itab accepting duplicate keys.

Regards,

Ferry Lianto

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
660

Try.....

insert zcitorderout from wa_zcitorderout. 

Regards,

Rich Heilman

Read only

Former Member
0 Likes
660

You cannot use ACCEPTING DUPLICATE KEYS with work area. It has to be with an internal table.

Read only

0 Likes
660

That is valid only in conjunction with "FROM TABLE ". If you need that any duplicate key records should overwrite existing rows, you can use MODIFY ztable FROM wa. This will add rows if there is no record with the same key exist in the table or change if there exists a record with the same key.

Message was edited by:

Srinivas Adavi

Read only

ferry_lianto
Active Contributor
0 Likes
661

Hi,

You can NOT use option accepting duplicate keys with wa.

Option accepting duplicate keys only work with table itab NOT wa.

INSERT dbtab FROM TABLE itab. or

INSERT (dbtabname) FROM TABLE itab.

Additions

... CLIENT SPECIFIED

... ACCEPTING DUPLICATE KEYS

Please try to build internal table.


data: begin of itab occurs 0.
           include structure zcitorderout.
data: end of itab.

data: wa_zcitorderout like zcitorderout.


wa_zcitorderout-vbeln = nast-objky. 

itab = wa_zcitorderout.
append itab.

insert zcitorderout from table itab accepting duplicate keys.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
660

for

insert zcitorderout from wa_zcitorderout. you can only use extension

1. ... CLIENT SPECIFIED

2. ... CONNECTION con

if you are using

INSERT dbtab FROM TABLE itab.

you can use these.

1. ... CLIENT SPECIFIED

2. ... ACCEPTING DUPLICATE KEYS

3. ... CONNECTION con

regards

shiba dutta