Continued from Creating Assignment Block with custom table in CRM Web UI (Part 1)
When a new sales order is created using SAP GUI, the BADI ORDER_SAVE is called. In the method CHECK_BEFOR_SAVE which is already implemented, a call to the class YCL_O2C_DELIVERY_SPECIFICATION has been made where the necessary logic for adding the ship to party meta data (YSDS) is updated in the sales order header text. This had been done in the method CHECK_BEFORE_SAVE.
For the Web UI part, the method CHECK_BEFORE_SAVE_WUI has been called from the Event handler EH_ONSAVE.
Given below are the additional lines.
Given below is a sample text that are added to the newly created sales order.
Success/ Error messages are captured in the method EH_ONSAVE (event handler is the menu of assignment block) and displayed. Necessary validation logic is provided here before updating the table contents.
Test Run
Now we can maintain the delivery specifications in SM30
Create New Sales order using CRM Web UI
If Ship to party is maintained in YSDS then the header text is updated
Also visible in SAP GUI