Generally a BAPI should be able to record and classify all possible errors that may occur. But providing a misleading error from BAPI cannot be of any help.
The BAPI “BAPI_INB_DELIVERY_CHANGE” is used to change an Inbound Delivery. This BAPI returns a misleading error, VL302 “Delivery & does not exist”when the Inbound Delivery passed into the BAPI for changing is already opened and locked in change mode.
SAP has provided a note “520335 – Message VL302 with locked delivery”, for the correction of this particular error. But this SAP Note is applicable only for “SAP_APPL 46C”. In ECC 6.0 version, the corrections mentioned in this note is still not applied. As per the correction instruction, inside FORM FILL_COMMON_PART, after the CALL FUNCTION ‘LE_DELIVERY_GET_BUFFERED’, instead of passing hard coded value 1 to “cf_subrc = 1.” actually we need to pass the sy-subrc value to “cf_subrc = sy-subrc.”. This is not yet applied in ECC 6.0 version.
In debugging when the mentioned changes have been done in the value of “cf_subrc = sy-subrc”, the correct error message “This delivery (&1) is currently being processed by another user (&2)” is being returned by the BAPI.
After identifying the problem in “SAP_APPL 46C” and restricting the correction instructions to “SAP_APPL 46C”, SAP has not yet applied the changes to the higher versions.
Hope SAP will release a note to handle this misleading error message.