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 Statement not working

Former Member
0 Likes
1,858

Hi ABAP Gurus,

In ECC5.0, I am populating my data in a workarea named ZDCOM and I want to update the data from the workarea in the same name database table ZDCOM. For this I am using the command INSERT ZDCOM. But it is not working as the table ZDCOM doesn't gets updated.

Please help me out.

Thanks in advance.

Regards,

Himanshu Aggarwal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,176

use commit work after insert statement.

7 REPLIES 7
Read only

Former Member
0 Likes
1,176

Check out this example

TABLES SCUSTOM. 
SCUSTOM-MANDT     = '002'. 
SCUSTOM-ID        = '12400177'. 
SCUSTOM-NAME      = 'Robinson'. 
SCUSTOM-POSTCODE  = '69542'. 
SCUSTOM-CITY      = 'Heidelberg'. 
SCUSTOM-CUSTTYPE  = 'P'. 
SCUSTOM-DISCOUNT  = '003'. 
SCUSTOM-TELEPHONE = '01234/56789'. 

INSERT INTO SCUSTOM CLIENT SPECIFIED VALUES SCUSTOM.

So your insert statement has to be


INSERT INTO ZDCOM CLIENT SPECIFIED VALUES ZDCOM.
COMMIT WORK.

Regards,

Santosh

Regards,

Santosh

Read only

Former Member
0 Likes
1,177

use commit work after insert statement.

Read only

Former Member
0 Likes
1,176

Hi,

While you are inserting, just check whether the INSER is failin gor not? just insert all the char types only and check the statemtns

Regards

Sudheer

Read only

Former Member
0 Likes
1,176

the thing you are using for insert is obsolete now. try to use

INSERT into ZDCOM values ZDCOM.

regards

shiba dutta

Read only

Former Member
0 Likes
1,176

hi,

try using the internal table with header line (i don know if u already do).

then chk this code it might help u.

tables spfli.

types: begin of line,

carrid type spfli-carrid,

connid type spfli-connid,

end of line.

data itab type table of line with header line.

*data itab type line.

select carrid connid from spfli into corresponding fields of table itab where carrid = 'LH'.

loop at itab .

READ TABLE itab INTO itab INDEX 1.

if sy-subrc eq 0.

itab-carrid = 'bb'.

itab-connid = '002'.

insert itab into itab.

endif.

endloop.

hope this helps

PLz reward if helpful.

Read only

Former Member
0 Likes
1,176

Himanshu,

Use the below line:

INSERT INTO ZDCOM VALUES ZDCOM.

Susanth

Read only

Former Member
0 Likes
1,176

Himanshu,

Is your problem resolved???