How to create Additional Sales order line

Princee

Member
Hi ,
We have a requirement when user enter a sales order line in Sales order application it will check for the quantity entered and validate with a quantity available stored in a custom file and if quantity order is more than the available qty , then it will create a sales order line with the available quantity and also it will create another sales order line with the remaining qty with some flag set .this validation and creation of additional sales order lines should be followed for every line a user enter a sales order line in APplication .

this modification need to be done in Sales order master business function as this functionality should work for the sales order coming from external system who can use MBF.

we are using E9.1 and P42101 application .

If anyone have already worked on this type of requirement ?

Thank you in Advance.
 
I have done several different scenarios like this in the SOE MBF (B4200310/B4200311). Do you need it to be real-time as in when F4211FSEditLine is called the new line is created or do you need it when the order is saved in F4211FSEndDoc?

If in EditLine you will have several things to think about:
1. effectively there will be a recursive type situation in that EditLine will have to call EditLine so you will need to guard against infinite recursion (several different ways you can accomplish that).
2. You may still need to make some slight mods to P42101 to show the new line by refreshing the grid from the SOE MBF cache (I had this requirement for one of the scenarios and if I remember correctly the code to do this is pretty much all ready in P42101, you just have to know when to execute it).
3. What happens when the user changes the initial line that auto created the second line?


If at the end of the order (F4211FSEndDoc).
You will probably just need to read through the UI11/UI12 cache and the create new lines accordingly by calling F4211FSEditLine.
OR if you want easy but higher DB I/O
Wait until the order is saved, ready through F4211 and use AdvancedSODetailLineSplit (B4200450).

In either scenario, depending on the specifics of your use case, you may have to account for situations where the order lines are changed after the order is saved. What do you do if they adjust the source line, what do you do if the adjust the auto-created line. Maybe you only care about doing this at original order entry in which case the complexity goes way down.
 
Back
Top