Skip to Content
avatar image
Former Member

SAPSQL_ARRAY_INSERT_DUPREC - A017 table

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 09 at 09:33 AM

    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...

    Add comment
    10|10000 characters needed 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.

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

    Try calling ME_INITIALIZE_INFORECORD before calling ME_POST_INFORECORD

    Add comment
    10|10000 characters needed characters exceeded