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

Runtime Errors SAPSQL_ARRAY_INSERT_DUPREC Exception CX_SY_OPEN_SQL_DB

Former Member
0 Likes
3,219

Hi All,

I am getting this Runtime Errors SAPSQL_ARRAY_INSERT_DUPREC
Exception CX_SY_OPEN_SQL_DB

The current ABAP program "SAPLV60U" had to be terminated because it has

come across a statement that unfortunately cannot be executed.

"SAPSQL_ARRAY_INSERT_DUPREC" "CX_SY_OPEN_SQL_DB"

"SAPLV60U" or "LV60UF0V"

"VBUK_BEARBEITEN"

Source Code Extract

Line

SourceCde

475

stru LIKE vbuk,

476

END OF da_xvbuki.

477

DATA: BEGIN OF da_xvbuku OCCURS 20,

478

stru LIKE vbuk,

479

END OF da_xvbuku.

480

* Positionen anlegen oder ändern

481

LOOP AT xvbuk.

482

vbuk = xvbuk.

483

CASE xvbuk-updkz.

484

WHEN updkz_new.

485

beleg = vbuk-vbeln.

486

* CHECK: BELEG-NR NE 0.

487

IF beleg-id = '$'.

488

CHECK: beleg-nr NE 0.

489

PERFORM vbrk_belegnummer_ermitteln.

490

vbuk-vbeln = xvbrk-vbeln.

491

xvbuk-vbeln = xvbrk-vbeln.

492

MODIFY xvbuk.

493

ENDIF.

494

da_xvbuki = xvbuk.

495

APPEND da_xvbuki.

496

WHEN updkz_update.

497

da_xvbuku = xvbuk.

498

APPEND da_xvbuku.

499

ENDCASE.

500

ENDLOOP.

501

UPDATE vbuk FROM TABLE da_xvbuku.

502

IF sy-subrc > 0.

503

MESSAGE a101 WITH 'VBUK' sy-subrc da_xvbuku-stru-vbeln.

504

ENDIF.

>>>>>

INSERT vbuk FROM TABLE da_xvbuki.

506

IF sy-subrc > 0.

507

MESSAGE a100 WITH 'VBUK' sy-subrc da_xvbuki-stru-vbeln.

508

ENDIF.

509

510

ENDFORM. "VBUK_BEARBEITEN

511

*eject

512

513

*---------------------------------------------------------------------*

514

* FORM VBUP_BEARBEITEN *

515

*---------------------------------------------------------------------*

516

* Die Tabelle VBUP wird geaendert *

517

*---------------------------------------------------------------------*

518

FORM vbup_bearbeiten.

519

520

xvbrk_tabix = 0.

521

DATA: BEGIN OF da_xvbupi OCCURS 1,

522

stru LIKE vbup,

523

END OF da_xvbupi.

524

DATA: BEGIN OF da_xvbupu OCCURS 100,

Please help me guys out of it...........

5 REPLIES 5
Read only

jay_kumar8
Active Participant
0 Likes
1,659

Hi,

Please check the SAP notes.

I think this is the only solution.

Regards

Raj

Read only

0 Likes
1,659

Yes

  • Check number range definition
  • Look for OSS notes if no SD billing user exit involved
  • Else check any error in such exit (or other change from BAdI to Enhancements)

Hint: Look also with SM13 to actual parameters committed in the transaction.

Regards,

Raymond

Read only

Former Member
0 Likes
1,659

Hi Das,

A simple way is 'INSERT vbuk FROM TABLE da_xvbuki ACCEPTING DUPLICATE KEYS.'

or you could manually catch that exception void program dump.

regards,

Archer

Read only

matt
Active Contributor
0 Likes
1,659

If the error is occurring in a SAP supplied program, he can't edit it.

Read only

Former Member
0 Likes
1,659

Hi,

There is duplicate value in VBUK, check that number from vbuk and check the it is valid or not.

check the number range and increase that number.

regards,

Chandu