When we display a transaction in CRM WebUI, there is a CRM ‘Print Page’ function. For example, open an interaction record detail screen from webui, click the print icon(or Ctrl+P):
a new window will be opened with the printed information:
- Print.do under BSPWD_BASICS is specified in WorkAreaHostContent.htm file under BSPWD_BASICS->Page Fragments->WorkAreaHostContent.htm.
- WorkAreaHostContent.htm is specified in BSPWD_BASICS/WorkAreaHostViewSet.htm.
- BSPWD_BASICS/WorkAreaHostViewSet is embedded in CRM_UI_FRAME.
Steps for enhancement:
- Execute BSP_WD_CMPWB, enhance BSPWD_BASICS. I named enhanced bsp application ZBWD_BASICSGW.
- Enhance ‘Print’ view.
- Even though it shows error, just click ‘Ok’ button to ignore it.
- It will also show information ‘View BSPWD_BASICS/print is not defined in the runtime repository that was loaded’.
- But the enhanced print view is now under my bsp application ZBWD_BASICSGW.
- Now enhance BSPWD_CMPWB/WorkAreaHostViewSet.
- Name controller class ZLBSPWD_BASICS_WA_HOSTVS when required.
- Give name to context attribute type ZLBSPWD_CONTEXT.
- Don’t forget to change method and active it.
- Now copy WorkAreaHostContent.htm.
- Input the bsp application name you created just now. Please notice, give a new page name.
- This ZWorkAreaHostContent.htm will appear under ZBWD_BASICSGW. Edit this file, change the codes as highlighted: BSPWD_BASICS is replaced by your own new Z bsp application. Here it is ZBWD_BASICSGW. After the change, save and active.
- In order to bring the ZWorkAreaHostContent.htm in, now we should edit the enhanced BSPWD_BASICS/WorkAreaHostViewSet.htm file. Double click on WorkAreaHostViewSet.htm.
- Change, save and active.
- In order to make the framework call the above enhanced views, we need to enhance CRM_UI_FRAME also.
- There is no ‘Enhance’ function for BSPWD_BASICS/WorkAreaHostViewSet under CRM_UI_FRAME. We need to use another way to bring the enhanced view in. Please see the next step.
- Execute T-code SM34, maintain view BSPWDVC_CMP_EXT. Select CRM_UI_FRAME for enhancement set ZENH_GW_NEW, double click ‘Controller Substitutes’.
- Add an entry manually.
- Now we come back to CRM_UI_FRAME, the enhanced view is visible.
- Now set breakpoint in print.htm file under ZBWD_BASICSGW.
- Open CRM webui, display a transaction, click ‘Print’.
- We can see the print.htm file under customer bsp application ZBWD_BASICSGW is executed. Now we can add our own codes in the print.htm file: