Creating Assignment block in CRM Web UI is a very common requirement in CRM Web UI development and I will try to be as much descriptive as possible giving details of every step. Your comments and suggestions for improvement are most welcome.
1. Introduction
The development consists out of three parts:
- a) Create maintenance tables
- b) Add assignment block in web UI account overview page (new assignment block)
- c) Copying delivery service related data into sales order header
2. MAJOR FEATURES
For Web UI:
Web UI Component BP_HEAD has been enhanced and a new assignment block will be created.
3. TECHNICAL DETAILS
Web UI Component BP_HEAD has been enhanced and a new BSP application YBP_O2C_BP_HEAD has been created. The View AccountSdsOV has been added to it.
Web UI Component Name:
BP_HEAD
BSP Application Name:
YB_O2C_BP_HEAD
Class
YCL_O2C_DELIVERY_SPECIFICATION, other classes generated automatically by Web UI Wizard.
Details:
Web UI component BP_HEAD has been enhanced
A new view has been created in the enhancement in the BSP application YB_O2C_BP_HEAD called AccountSdsOV. This view is for the assignment block for YSDS maintenance. The new block had been added to BP_HEAD/BPHEADOverview.
For adding Meta data (YSDS) to newly created sales orders for a given ship to party has been done using the class YCL_O2C_DELIVERY_SPECIFICATIONS
After creating the necessary data elements the table YSDS is created to save the data maintained in the assignment block
Now the KEY tables are maintained
Creating the Assignment Block:
The Web UI component BP_HEAD was enhanced so as to create the new view for assignment block.
A new view has been created with 2 context nodes
The Context for BUILHEADER is mapped to model head Bol entity is BUILHEADER. The Binding is done with BUILHEADER.
For the value node YSDSVALNODE the Dictionary structure YSDS is used.
The Configuration is done in the following manner.
Three buttons for Edit, Save, Cancel has been added to the top menu of the assignment block
In the implementation class an attrbute has to be added for the button
To make the list of buttons and their functionality the following code has been written in the do_prepare_output method of the implementation class.
Also the data from YSDS table is fetched and displayed on the screen.
In order to have a drop down list, the methods of the attributes, namely GET_V_XXXX and GET_P_XXXX has been adjusted accordingly for all the fields where drop down list is required.
Adding the following code in GET_P_XXXX helps in creation of drop down list.
The records for the drop down list are added in GET_V_XXXX
This has been done for all the the fields of YSDS except PARTNER.
Three event handler methods are created for Edit, Save and Cancel functions in the assignment block menu.
The cancel event changes edit mode to display mode.
The edit event changes the assignment block to editable one.
The save event has the necessary logic for saving the changes to table.
In order to add this view as an assignment block, the view is added in the View area shown below.
Now we go to component structure brower and enhance the view BPHEADOverview,
After editing the component page we add the assignment block we had created to the available assignment blocks (left to right).
The new assignment block is now available for use.
Continued in Creating Assignment Block with custom table in CRM Web UI (Part 2)