Hi
I have a function module which is used to create and reverse a GR for a purchase order based on movement type. When the movement type is 101 it creates the GR and when it is 102 reverses the GR.
For creating the GR, function module BAPI_ENRTYSHEET_CREATE is used which creates a service entry sheet and inserts this record in ESKN table.
his function module is followed by BAPI_TRANSACTION_COMMIT and BAPI_ENTRYSHEET_RELEASE.
For reversing the GR, function module BAPI_ENTRYSHEET_RESET_RELEASE is used in which corresponding service entry sheet is fetched based on PO number and item number and this record is inserted in ESKN table.
I have a situation in which we are creating a GR for a PO of movement type 101 and the corresponding details are inserted into ESKN table and then we are reversing the GR of movement type 102 for the same PO, here details corresponding to this GR has to be inserted into ESKN table but it is trying to insert the details of previous record of movement type 101 and throwing the dump as duplicate entries.
please help to avoid this error.
Thanks.