06-11-2010 12:50 PM
I am gettin return code as 2 for Function module SD_SALES_DOCUMENT_ENQUEUE, what may be the reason.
I am also getting the error as the sales order is locked by user.
06-11-2010 12:55 PM
that can be fore two reasons..
1. some user already is in change mode for that sales order
2. in your program itself you are calling that FM in loop and you are passing the same sales order more than once to that FM without DEQUEUE..
check you code and then with users
06-11-2010 1:02 PM
try SM12 to see if there are any locks corresponding to the sales order.
Sometimes these locks need deleting, if a session has failed somewhere whilst updating the sales order.