Skip to Content
0
Jul 07 at 02:46 PM

SD_SALESDOCUMENT_CREATE: Multiple sales order creation in same LUW triggers exception

65 Views

Dear Community,

I'm trying to create multiple sales order using multiple successive calls to function moduleSD_SALESDOCUMENT_CREATE (which is also used by BAPI_SALESORDER_CREATEFROMDAT2). My intention is to do a COMMIT at some upper layer, so I do NOT commit between the creation (also I might switch to the new RESTful Application Programming Model in the future, and COMMITing is restricted there).

However, I get an exception when performing the second call: "Illegal state transition from "DO_SAVE" to "CLEANUP"". This has to do with some BusinessObject functionality level inside the FM, but to me this rather looks like a bug, as from the FM interface level you're completely agnostic of this functionality.

Is there a better way for creating multiple sales orders in one LUW?

Many thanks,

Tudor