2009 Sep 02 3:04 PM
Hi,
I have an internal table declared as follows:
DATA: itab2 TYPE STANDARD TABLE OF fmusfga with header line.
The key of FMUSFGA table is RCLNT (which does not appear populated in SE16N) and GL_SIRID.
The internal table is assigned values using the "split" command as follows:
Loop at itab.
split itab-rec at '|' into gv_blank2
itab2-gl_sirid
itab2-refdocnr
gv_date "itab2-budat
itab2-racct
itab2-usnam
gv_year "itab2-ryear
gv_per "itab2-poper
itab2-rfistl
itab2-rfund
itab2-belnr
gv_hsl
itab2-fmcmmtstr_9
itab2-sgtxt
gv_blank.
I have printed out "itab2-gl_sirid" in the program and the values are being assigned correctly to the internal table, e.g.:
000000002947872487
000000002947872488
000000002947884656
Also, I have individually checked each GL_SIRID value in FMUSFGA in SE16N, and there are NO records in the database that have those GL_SIRID.
The code to update the table is:
INSERT FMUSFGA FROM TABLE itab2.
COMMIT WORK AND WAIT.
And yet I get the following error:
SAPSQL_ARRAY_INSERT_DUPREC
Why?
2009 Sep 02 3:18 PM
try this way..
if you are trying to insert fron table if one records fails to insert the commit work will not done so rest of the records will not inserted..
Loop at itab.
split itab-rec at '|' into gv_blank2
itab2-gl_sirid
itab2-refdocnr
gv_date "itab2-budat
itab2-racct
itab2-usnam
gv_year "itab2-ryear
gv_per "itab2-poper
itab2-rfistl
itab2-rfund
itab2-belnr
gv_hsl
itab2-fmcmmtstr_9
itab2-sgtxt
gv_blank.
"write this inside the loop
INSERT FMUSFGA FROM itab2. "remove table try to insert from work area or lin item
if sy-subrc = 0.
COMMIT WORK AND WAIT.
else.
roll back.
endif.
ENDLoop.
Hi,
I have an internal table declared as follows:
DATA: itab2 TYPE STANDARD TABLE OF fmusfga with header line.
The key of FMUSFGA table is RCLNT (which does not appear populated in SE16N) and GL_SIRID.
The internal table is assigned values using the "split" command as follows:
Loop at itab.
split itab-rec at '|' into gv_blank2
itab2-gl_sirid
itab2-refdocnr
gv_date "itab2-budat
itab2-racct
itab2-usnam
gv_year "itab2-ryear
gv_per "itab2-poper
itab2-rfistl
itab2-rfund
itab2-belnr
gv_hsl
itab2-fmcmmtstr_9
itab2-sgtxt
gv_blank.
I have printed out "itab2-gl_sirid" in the program and the values are being assigned correctly to the internal table, e.g.:
000000002947872487
000000002947872488
000000002947884656
Also, I have individually checked each GL_SIRID value in FMUSFGA in SE16N, and there are NO records in the database that have those GL_SIRID.
The code to update the table is:
INSERT FMUSFGA FROM TABLE itab2.
COMMIT WORK AND WAIT.
And yet I get the following error:
SAPSQL_ARRAY_INSERT_DUPREC
Why?
2009 Sep 02 3:18 PM
try this way..
if you are trying to insert fron table if one records fails to insert the commit work will not done so rest of the records will not inserted..
Loop at itab.
split itab-rec at '|' into gv_blank2
itab2-gl_sirid
itab2-refdocnr
gv_date "itab2-budat
itab2-racct
itab2-usnam
gv_year "itab2-ryear
gv_per "itab2-poper
itab2-rfistl
itab2-rfund
itab2-belnr
gv_hsl
itab2-fmcmmtstr_9
itab2-sgtxt
gv_blank.
"write this inside the loop
INSERT FMUSFGA FROM itab2. "remove table try to insert from work area or lin item
if sy-subrc = 0.
COMMIT WORK AND WAIT.
else.
roll back.
endif.
ENDLoop.
2009 Sep 02 3:18 PM
Have you checked to see if there are duplicate GL_SIRID in the file or internal table?
Rob
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |