cancel
Showing results for 
Search instead for 
Did you mean: 

Using BADI ORDER_SAVE to implement order split?

Former Member
0 Kudos

I'm working in a CRM 4.0 system in which I need to create an order split based on sales organizations. My initial idea was to create an implementation of the BADI ORDER_SAVE in which I call the method CHANGE_BEFORE_UPDATE where I want to read the available sales order data and perform the split.

The scenario could be that a sales order comes in from internet sales or is generated directly in CRM with one line from sales organization X and one from sales organization Y. I want to read the available line item data and split the order in two orders. One for each sales organization.

I have been looking through the functions in function group CRM_ORDER_API and through the available methods for business object BUS2000115, but I cannot seem to find anything that works at the point in time where my BADI is called.

In my system one order containing two different sales organizations will fail, so an alternative might be to have a batch job running that reads the failed orders after they have been saved in CRM and splits them according to my requirements using the function module CRM_ORDER_MAINTAIN.

Would any of you CRM gurus have a suggestion to how I can implement the first scenario as I find this solution a bit more elegant than the second?

Best regards,

Anders

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Anders,

I had to do some updating of an order too, but it didn't work in the change_before_update. When I implemented the code in method prepare it worked.

Cheers,

Stefan

stephenjohannes
Active Contributor
0 Kudos

Anders,

Another approach is the following: Save the order generated by ISA as a different document type from the target split order. The next step is to use the SPPFCADM action configuration to build a scheduled action that is kicked off when your document is saved(I believe you can make the order save as a triggering condition). Then in the new action class read the document determine whether it needs to be split and generate the subsequent sales documents as needed.

The problem with splitting out the original document is that you lose track of the "logical" orginal order, and you face the issue of deleting the items from the original document. The benefit of creating subsequent documents is that you maintain the document flow, and only have to create new orders which is much simpler.

Good luck,

Stephen