Skip to Content
0

SAPSQL_ARRAY_INSERT_DUPREC - A017 table

Feb 09 at 04:50 AM

59

avatar image
Former Member

Hi All,

I get dump SAPSQL_ARRAY_INSERT_DUPREC when i am creating purchase info record using FM 'ME_POST_INFORECRD' in a program. Multiple material can be given as input and multiple info records will be created in one execution. Materials will be looped one by one. For the first material, Info record gets created successfully. But, from the second material on wards, it starts to throw error 'Inserting duplicate record to A017 table'. In the dump details of the second material, i can see the first material and not the second one. Seems like some buffer data issue.

Kindly advise to rectify this .

Thank you,

Eldho

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Raymond Giuseppi
Feb 09 at 09:33 AM
0

When using unreleased (*) FM always perform a where-used search and replicate behavior of standard class/program, your code could look like

CALL FUNCTION 'ME_INITIALIZE_INFORECORD'.
CALL FUNCTION 'RV_CONDITION_RESET'
  EXPORTING
    free_memory ='X'.
CALL FUNCTION 'ME_POST_INFORECORD'
  TABLES
    t_eina_i = lt_eina
  EXCEPTIONS
    error_message = 1
    OTHERS        = 2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    wait   = 'X'
  IMPORTING
    return = lt_bapiret2.
REFRESH lt_eina.

Add the requested check/catch for error handling too.

(*) Actually do it also for released ones...

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Yes. This is the correct method. I was not using FM RV_CONDITION_RESET before. It works fine now. Thank you.

0
avatar image
Former Member Feb 09 at 05:06 AM
0

Try calling ME_INITIALIZE_INFORECORD before calling ME_POST_INFORECORD

Share
10 |10000 characters needed characters left characters exceeded