‎2009 Aug 21 4:52 PM
Hi,
I have having issues with a scenario while creating delivery in a 4.7 system. When creating a return order (using FM SD_SALESDOCUMENT_CREATE) our system is configured to automatically generate deliveries for the return SO.
The scenario we are facing an issue in is, during data processing, a delivery is created using FM W_FRM_DELIVERY_CREATE_GENERAL, delivery is then processed for picking and PGI using FM WS_DELIVERY_UPDATE.
For the next record, a return order is created using FM SD_SALESDOCUMENT_CREATE, which also automatically tries to create the delivery. At this point we get an update terminate upon COMMIT and dump says SAPSQL_ARRAY_INSERT_DUPREC pointing towards form VBFA_BEARBEITEN.
Based on my analysis, while updating table VBFA the internal table DA_XVBFAI also has document flow for the previously processed regular sales order for which the system tries to insert a record in VBFA. This is a duplicate record and the update is terminated. The buffer nees to be refreshed and I tried using FM SHP_DELIVERY_BUFFER_REFRESH and LE_DELIVERY_REFRESH_BUFFER. None of these seem to refresh the VBFA buffer.
I would appreciate if anyone can share their experience with this issue. Thanks for your help!
-Roger
‎2009 Aug 21 5:27 PM
Hi,
Try using one of these function modules BUTX_FRG0010_CLEAR_BUFFER or CK_F_SHARED_BUFFER_DELETE or COM_IL_DB_RESET_BUFFER or SNC_USER_FLUSH_BUFFER .
KR Jaideep,
‎2009 Aug 21 8:46 PM
I checked these functions and none of these refresh the delivery buffer.
‎2009 Sep 02 6:54 PM
This issue was resolved by calling function RV_DELIVERY_INIT
‎2011 Jul 28 7:13 AM
May I know how you used this fm as right now we also encountered the problem of SAPSQL_ARRAY_INSERT_DUPREC during the delivery processing.
Thank you.
‎2014 Jan 22 2:15 PM
‎2021 Mar 26 5:27 AM
This suggestion solve my problem too. I used FM BAPI_CUSTOMERRETURN_CREATE to create Sales Document and Delivery, But I was getting an error because delivery is saved in update tasking. I have tried a lot of solution and FM. But this one solved my problem. Tks.
‎2021 May 13 10:58 PM
Me too, solved with RV_DELIVERY_INI just before of call bapi.