‎2008 Feb 01 2:40 PM
Hi All,
Can anyone tell me why this statement isn't working? When I run it in debug mode everything is fine and it comes back with a return code of 0 but it never posts to the database.
Any help is much appreciated.
INSERT zwebedi FROM TABLE t_zwebedi.
‎2008 Feb 01 2:53 PM
Hi Colm as said in the above post check the syntax.. and after that..
you need to write this code as well
Commit work and wait.this will close the LUW, and then update will be complete
‎2008 Feb 01 2:44 PM
here hare some alternatives check them out
loop itab into wa.
INSERT INTO dbtab VALUES wa. or
INSERT INTO (dbtabname) VALUES wa. or
INSERT dbtab FROM wa. or
INSERT (dbtabname) FROM wa.
ENDLOOP.
reward if helpful plz..
keep rockin
vivek
‎2008 Feb 01 2:45 PM
‎2008 Feb 01 2:51 PM
Hi,
check your internal table Because your syntax is right.
INSERT dbtab FROM TABLE itab. oder
INSERT (dbtabname) FROM TABLE itab.
Extras:
1. ... CLIENT SPECIFIED
2. ... ACCEPTING DUPLICATE KEYS
3. ... CONNECTION con
Effect
Mass insert: All lines of the internal table itab are inserted in one single operation. The lines of itab must fulfill the same conditions as the work area wa in variant 1.
When the command has been executed, the system field SY-DBCNT contains the number of inserted lines.
The Return Code is set as follows:
SY-SUBRC = 0:
All lines successfully inserted. Any other result causes a runtime error.
Note
If the internal table itab is empty, SY-SUBRC and SY-DBCNT are set to 0 after the call.
REGARDS,
GAURAV J.
‎2008 Feb 01 2:53 PM
Hi Colm as said in the above post check the syntax.. and after that..
you need to write this code as well
Commit work and wait.this will close the LUW, and then update will be complete
‎2008 Feb 01 2:58 PM
hi Gavin,
Write a commit work statement immediately after the insert statement.
i.e,
.
INSERT zwebedi FROM TABLE t_zwebedi.
commit work.
‎2008 Feb 01 3:00 PM
Hi,
Check this Example.
TABLES:MARA.
DATA:ITAB LIKE MARA .
START-OF-SELECTION.
ITAB-MATNR = '123ABCD'. .
ITAB-MBRSH = 'C'.
ITAB-MTART = 'FERT' .
ITAB-MEINS = 'KG' .
INSERT MARA FROM ITAB.
MODIFY MARA .
Or..
TABLES:MARA.
DATA:ITAB LIKE MARA OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
ITAB-MATNR = '123ABCDA'. .
ITAB-MBRSH = 'C'.
ITAB-MTART = 'FERT' .
ITAB-MEINS = 'KG' .
APPEND ITAB.
ITAB-MATNR = '123ABCDB'. .
ITAB-MBRSH = 'C'.
ITAB-MTART = 'FERT' .
ITAB-MEINS = 'KG' .
APPEND ITAB.
LOOP AT ITAB.
INSERT MARA FROM ITAB.
MODIFY MARA .
ENDLOOP.
‎2008 Feb 01 3:14 PM
simply use
MODIFY zwebedi FROM TABLE t_zwebedi.
commit work.
a®
‎2008 Feb 01 3:26 PM
HI,
U r syntax is correct. use commit work after that it will work.
Pls reward points if useful.
Regards,
Raghu