Custom Dashboard on Home screen
Requirement: Displaying Orders on Home screen of ADMIN or ASM (Area Sales Manager ) to review an order with the Incentive Amount(custom field which is having some ordering value) and then approve/reject the Incentive Amount in the order justifying the reason behind it by entering the Incentive Amount Rejection note. The ordering process is made very simple where SR needs to choose the Sold to Party, relevant products, enter product quantity and Incentive Amount while the other information get auto determined. The Order with Incentive Amount gets approved, First by ASM (Sales Manager) and then by ADMIN. This entire approval process of Orders in the CRM dashboard is extremely time and effort efficient.
Orders displayed in Custom Dashboard are based on:
•Display Custom Dashboard only to few countries
•Orders Should have the OMV value
•Custom Dashboard is enabled to only ASM/ADMIN
•Approve/Reject by ASM/ADMIN for the orders
Go to Component: BT115H_SLSO
Create a new view Zorderdashboard with required fields.
Now write the logic to get the orders based on territory and shop money value and status.
Write the logic in DO_PREPARE_OUTPUT.
1) Get the user logged in check he is ADMIN/ASM
2) Read all territories of the user by using FM CRM_TERRMAN_TERR_BY_EMP_OBJ.
3) Fetch all the territories that are assigned under ASM/ADMIN
4) Fetch all the employees of the territory and by using the CRMD_ORDER_INDEX table get all the orders.
5) Get the order details by using FM: CRM_ORDER_READ.
6) Then prepare the structure to display them in UI
The view needs to be displayed in home screen
So to display one view in another component we need to create the Component usage.
Create a window for the dashboard view
Now go to run time repository:
Add the window and the Dashboard view
Now add the interface view
Now add the interface view to component usage
Now add the same component usage in Home screen component.
Go to home screen component: WCC_SLS_HOME
Go to Run time repository and add the component usage
Now the view will be seen in the home screen.
Logic to enable the view only to ASM/ADMIN will be written in below methods:
DETACH_STATIC_OVW_VIEWS/REATTACH_STATIC_OVW_VIEWS
So in DETACH_STATIC_OVW_VIEWS Method
We should add the logic not to remove the custom view for ADM/ASM
View id is component usage.viewname
Component usage is CU_ORDERDASHBOARD
View name: ZBT115H_SLSO_P/ZWinDashboard
And for the method REATTACH_STATIC_OVW_VIEWS
We should add the logic to add the custom view for ADM/ASM
Now open the UI:
Configure the custom View in page configuration:
Take the order 5004721 and reject it.
Rejected order disappears from the screen after entering the rejected notes.
Check in GUI the rejected notes:
Now approve the order 5004799
Check the status in GUI:
Now login to ADMIN this 5004799 order will be available in ADMIN as it is approved by ASM.
Now approve the order 5004799 and check the status of the order and it will be completed.
We need to implement the whole logic of APPROVE/REJECT using events and to store the Rejected Notes/status using the FM CRM_ORDER_MAINTAIN for both ADMIN/ASM.
In this way entire approval process of Orders in the CRM dashboard is implemented.
Hope this helps!!
Hi Anitha,
Nice article. How did you manage approve and reject, did you create any workflow?
Thanks & Ragards,
Dharmakasi.
Hi Dharmakasi ,
By events ,one click actions.
In method
GET_OCA_T_TABLE
-id = 'APPROVE'.
"#EC NOTEXT
"ls_one_click_action-icon = 'edit.gif'. "#EC NOTEXT
ls_one_click_action-text = cl_wd_utilities=>get_otr_text_by_alias( 'ZCRM/APPROVE_OCA' ). "#EC NOTEXT
ls_one_click_action-tooltip = 'APPROVE'.
ls_one_click_action-active = 'X'. "#EC NOTEXT
APPEND ls_one_click_action TO rt_actions.
* * one click action "Delete"
CLEAR ls_one_click_action.
ls_one_click_action-id = 'REJECT'. "#EC NOTEXT
"ls_one_click_action-icon = 'delete.gif'. "#EC NOTEXT
ls_one_click_action-text = cl_wd_utilities=>get_otr_text_by_alias( 'ZCRM/REJECT_OCA' ). "#EC NOTEXT
ls_one_click_action-tooltip = 'Reject'.
ls_one_click_action-active = 'X'. "#EC NOTEXT
APPEND ls_one_click_action TO rt_actions.
Thanks,
Anitha