Hi All,
I need to create a Production order with user given serial numbers throug IDOC( Simillar to Tcode 'CO01' ). So I am Creating Prod order seperatly and then attaching Serial number to it and finally releasing it in my code. My question is too lenghty kindly go thru ![]()
Following are the steps that i am using to create PO.
1 Step: Create Productio order.
BAPI_PRODORD_CREATE This BAPI creates PO.
BAPI_TRANSACTION_COMMIT Commits the above work.
2 Step: Attach serial number to above PO.
here i am sending User given serial numbers to below FM keeping I_AUTOMATIC blank.
SERNR_ADD_TO_PP This attaches serial number to PO
SERIAL_LISTE_POST_PP This is to update Serial number( without this serial numers will not be attached to PO).
BAPI_TRANSACTION_COMMIT Commits the above work.
3 Step: Finally Release PO using below BAPI
BAPI_PRODORD_RELEASE Release PO
BAPI_TRANSACTION_COMMIT Commits the above work.
Now i need to run this through IDOC
Everything is working fine as per the flow except code goes to dump when it is executing SERIAL_LISTE_POST_PP saying SAPSQL_ARRAY_INSERT_DUPREC Duplicate insertion of entries in SER05,as all the above process is in loop. As far as my knowledge it needs certain delay time in between SERNR_ADD_TO_PP and SERIAL_LISTE_POST_PP. Can you guys please check my above logic and find out what might be the cause if any or give me some reasonable delay time that updates SER05.
PS : Commit work cannot be done between SERNR_ADD_TO_PP and SERIAL_LISTE_POST_PP as it will take system generated serial numbers instead of user given.
Thanks,
Prasanna