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: 

Insert coding error

Former Member
0 Kudos
78

hi ,

anybody tell why error this coming.

''Comma without preceding colon (after INSERT ?)''.

INSERT INTO KNA1(KUNNR,ANRED,NAME1,PFACH,STRAS,PSTLZ,ORT01,

TELF1,TELFX) VALUES(

CUSTOMER_T-KUNNR,

CUSTOMER_T-ANRED,

CUSTOMER_T-NAME1,

CUSTOMER_T-PFACH,

CUSTOMER_T-STRAS,

CUSTOMER_T-PSTLZ,

CUSTOMER_T-ORT01,

CUSTOMER_T-TELF1,

CUSTOMER_T-TELFX.

ENDIF.

4 REPLIES 4

Former Member
0 Kudos
50

Hi,

INSERT INTO KNA1 ( KUNNR,ANRED,NAME1,PFACH,STRAS,PSTLZ,ORT01,

TELF1,TELFX ) VALUES(

CUSTOMER_T-KUNNR,

CUSTOMER_T-ANRED,

CUSTOMER_T-NAME1,

CUSTOMER_T-PFACH,

CUSTOMER_T-STRAS,

CUSTOMER_T-PSTLZ,

CUSTOMER_T-ORT01,

CUSTOMER_T-TELF1,

CUSTOMER_T-TELFX ). -


> you miss <b>)</b> .

ENDIF.

Now it will work.

Thanks,

Former Member
0 Kudos
50

why don't you try to put your values in a structure and then insert it into kna1?

Something like this:

INSERT INTO KNA1 VALUES wa_kna1.

Hope this helps

Former Member
0 Kudos
50

Hi,

as I know, it's not possible to insert a few fields. You need to go over an internal table like this:

DATA: itab TYPE HASHED TABLE OF KNA1

WITH UNIQUE KEY carrid connid,

wa LIKE LINE OF itab.

wa-carrid = 'UA'. wa-connid = '0011'. wa-cityfrom = ...

INSERT wa INTO TABLE itab.

wa-carrid = 'LH'. wa-connid = '1245'. wa-cityfrom = ...

INSERT wa INTO TABLE itab.

wa-carrid = 'AA'. wa-connid = '4574'. wa-cityfrom = ...

INSERT wa INTO TABLE itab.

...

INSERT KNA1 FROM TABLE itab

Regards

Nicole

Former Member
0 Kudos
50

hi,

when ur inserting values into internal table ot databse table from a work area which is not given in your query.

INSERT INTO KNA1(KUNNR,ANRED,NAME1,PFACH,STRAS,PSTLZ,ORT01,

TELF1,TELFX) VALUES(

CUSTOMER_T-KUNNR,

CUSTOMER_T-ANRED,

CUSTOMER_T-NAME1,

CUSTOMER_T-PFACH,

CUSTOMER_T-STRAS,

CUSTOMER_T-PSTLZ,

CUSTOMER_T-ORT01,

CUSTOMER_T-TELF1,

CUSTOMER_T-TELFX).

ENDIF.

OR INSERT INTO <INTERNAL TABLE> FROM <WORKAREA>.

IF HELPFUL REWARD SOME POINTS.

with regards,

Suresh.A